<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
  <description>Builds and pushes a new version of graphql-@SERVICE@ image to AWS EC2 Container Service Registry (ECR for short)</description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <hudson.plugins.buildblocker.BuildBlockerProperty plugin="build-blocker-plugin@">
      <useBuildBlocker>false</useBuildBlocker>
      <blockLevel>GLOBAL</blockLevel>
      <scanQueueFor>DISABLED</scanQueueFor>
      <blockingJobs></blockingJobs>
    </hudson.plugins.buildblocker.BuildBlockerProperty>
    <com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer">
      <doNotScan>false</doNotScan>
    </com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
    <com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty plugin="naginator">
      <optOut>false</optOut>
    </com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.model.StringParameterDefinition>
          <name>GIT_COMMIT</name>
          <description>Commit version to checkout and build Docker image to.</description>
          <defaultValue></defaultValue>
        </hudson.model.StringParameterDefinition>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
    <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents">
      <maxConcurrentPerNode>0</maxConcurrentPerNode>
      <maxConcurrentTotal>0</maxConcurrentTotal>
      <categories class="java.util.concurrent.CopyOnWriteArrayList"/>
      <throttleEnabled>false</throttleEnabled>
      <throttleOption>project</throttleOption>
      <limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
      <paramsToUseForLimit></paramsToUseForLimit>
    </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
  </properties>
  <scm class="hudson.plugins.git.GitSCM" plugin="git">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>git@github.com:theorchard/graphql-@SERVICE@.git</url>
        <credentialsId>@GITHUB_CREDENTIAL_ID@</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>${GIT_COMMIT}</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions>
      <hudson.plugins.git.extensions.impl.AuthorInChangelog/>
    </extensions>
  </scm>
  <canRoam>true</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
      <command>
        if [[ -f ~/.docker/config.json || -f ~/.dockercfg ]]; then
          rm -rf ~/.docker/config.json
          rm -rf ~/.dockercfg
        fi

        aws ecr get-login-password --region us-east-1 \
          | docker login --username AWS --password-stdin 086679231553.dkr.ecr.us-east-1.amazonaws.com

        echo $GIT_COMMIT
        docker --version
        
#setup npm registries
./scripts/setup.sh
      </command>
    </hudson.tasks.Shell>
    <com.cloudbees.dockerpublish.DockerBuilder plugin="docker-build-publish">
      <server plugin="docker-commons"/>
      <registry plugin="docker-commons">
        <url>https://086679231553.dkr.ecr.us-east-1.amazonaws.com/</url>
        <credentialsId>@ECR_CREDENTIAL_ID@</credentialsId>
      </registry>
      <repoName>graphql-@SERVICE@</repoName>
      <noCache>false</noCache>
      <forcePull>true</forcePull>
      <dockerfilePath>./Dockerfile</dockerfilePath>
      <skipBuild>false</skipBuild>
      <skipDecorate>false</skipDecorate>
      <repoTag>${GIT_COMMIT}</repoTag>
      <skipPush>false</skipPush>
      <createFingerprint>true</createFingerprint>
      <skipTagLatest>false</skipTagLatest>
      <buildAdditionalArgs>--build-arg PACKAGECLOUD_USER --build-arg GITHUB_TOKEN</buildAdditionalArgs>
      <forceTag>false</forceTag>
    </com.cloudbees.dockerpublish.DockerBuilder>
  </builders>
  <publishers>
    <jenkins.plugins.slack.SlackNotifier plugin="slack">
      <baseUrl></baseUrl>
      <teamDomain>orcd</teamDomain>
      <authToken></authToken>
      <tokenCredentialId>@SLACK_CREDENTIAL_ID@</tokenCredentialId>
      <botUser>false</botUser>
      <room>@SLACK_ROOMS@</room>
      <startNotification>false</startNotification>
      <notifySuccess>false</notifySuccess>
      <notifyAborted>false</notifyAborted>
      <notifyNotBuilt>true</notifyNotBuilt>
      <notifyUnstable>true</notifyUnstable>
      <notifyRegression>false</notifyRegression>
      <notifyFailure>true</notifyFailure>
      <notifyBackToNormal>true</notifyBackToNormal>
      <notifyRepeatedFailure>false</notifyRepeatedFailure>
      <includeTestSummary>false</includeTestSummary>
      <includeFailedTests>false</includeFailedTests>
      <commitInfoChoice>AUTHORS_AND_TITLES</commitInfoChoice>
      <includeCustomMessage>true</includeCustomMessage>
      <customMessage>Commit SHA $GIT_COMMIT</customMessage>
      <customMessageSuccess></customMessageSuccess>
      <customMessageAborted></customMessageAborted>
      <customMessageNotBuilt></customMessageNotBuilt>
      <customMessageUnstable></customMessageUnstable>
      <customMessageFailure></customMessageFailure>
    </jenkins.plugins.slack.SlackNotifier>
  </publishers>
  <buildWrappers>
    <org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper plugin="credentials-binding@1.20">
      <bindings>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <credentialsId>apollo-engine-graphql-theorchard-api-key</credentialsId>
          <variable>APOLLO_ENGINE_API_KEY</variable>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <credentialsId>packagecloud_repo_token</credentialsId>
          <variable>PACKAGECLOUD_USER</variable>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <credentialsId>github_packages_token</credentialsId>
          <variable>GITHUB_TOKEN</variable>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
      </bindings>
    </org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
  </buildWrappers>
</project>
