Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
[DCOS-44511] Add a Jenkinsfile for THE docker image (#2977)
Browse files Browse the repository at this point in the history
  • Loading branch information
porridge authored Mar 13, 2019
1 parent 6f1ee9f commit 11ae35a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Jenkinsfile.dcos-commons
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env groovy
// Configuration for https://jenkins.mesosphere.com/service/jenkins/job/dcos-commons%20docker%20image/
pipeline {
agent {
label 'mesos'
}

environment {
IMAGE = "dcos-commons"
DOCKERFILE = "Dockerfile"

// Get credentials for publishing to Docker hub.
DOCKER = credentials('docker-hub-credentials')
}

stages {
stage('docker login') {
steps {
// Login to the Docker registry.
sh("docker login -u ${DOCKER_USR} -p ${DOCKER_PSW}")
}
}

stage('build') {
steps {
// Build Docker image.
sh("docker build -f ${DOCKERFILE} -t mesosphere/${IMAGE}:latest .")
}
}

stage('publish') {
// Only run this step on the master branch.
when {
branch 'master'
}

steps {
script {
sh("docker push mesosphere/${IMAGE}:latest")
}
}
}
}
}
2 changes: 2 additions & 0 deletions Jenkinsfile.dcos-commons-base
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env groovy
// Configuration for https://jenkins.mesosphere.com/service/jenkins/job/dcos-commons-base%20docker%20image/
pipeline {
agent {
label 'mesos'
Expand Down

0 comments on commit 11ae35a

Please sign in to comment.