Skip to content

Instantly share code, notes, and snippets.

@thcipriani
Created September 18, 2017 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thcipriani/c87b0f3e4292d9c86df9c70803cbfafd to your computer and use it in GitHub Desktop.
Save thcipriani/c87b0f3e4292d9c86df9c70803cbfafd to your computer and use it in GitHub Desktop.
node {
def jobName = "${JOB_NAME}:${BUILD_ID}".toLowerCase()
def jobImg
// Setup stage
// ---
// Ensure we get what we came for here
stage('PreSetup') {
pwd()
sh 'ls'
}
stage('Setup') {
if (! fileExists('blubber.json')) {
error('No blubber.json found in repo root!')
}
blubber blubber.json production
}
// Build stage
// ---
// Build the docker image from the Dockerfile.ci file in the repo root
stage('Build') {
jobImg = docker.build("${jobName}", '-f Dockerfile .')
}
docker.withRegistry('https://ci-staging-docker-registry01.ci-staging.eqiad.wmflabs', 'ci-staging-jenkins') {
jobImg.push('latest')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment