Skip to content

Instantly share code, notes, and snippets.

@jay-johnson
Last active July 19, 2016 14:07
Show Gist options
  • Save jay-johnson/bfcad7c25436d7ac6d2be315edb703f0 to your computer and use it in GitHub Desktop.
Save jay-johnson/bfcad7c25436d7ac6d2be315edb703f0 to your computer and use it in GitHub Desktop.
nginx Jenkins Pipeline building example
stage 'Building nginx Container for Docker Hub'
docker.withRegistry("${registry_url}", "${docker_creds_id}") {
// Set up the container to build
maintainer_name = "jayjohnson"
container_name = "django-nginx"
stage "Building Container"
echo "Building nginx with docker.build(${maintainer_name}/${container_name}:${build_tag})"
container = docker.build("${maintainer_name}/${container_name}:${build_tag}", 'nginx')
// add more tests
stage "Pushing"
container.push()
currentBuild.result = 'SUCCESS'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment