Skip to content

Commit

Permalink
Merge pull request #17 from icgc-argo/RC/1.3.0
Browse files Browse the repository at this point in the history
Rc/1.3.0
  • Loading branch information
lepsalex authored Dec 8, 2020
2 parents def7f61 + 9ad485c commit 85be573
Show file tree
Hide file tree
Showing 3 changed files with 708 additions and 213 deletions.
57 changes: 46 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
def dockerRepo = "ghcr.io/icgc-argo/workflow-gateway"
def gitHubRepo = "icgc-argo/workflow-gateway"
def chartVersion = "0.3.0"
def commit = "UNKNOWN"
def version = "UNKNOWN"

Expand Down Expand Up @@ -46,18 +49,34 @@ spec:
}
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId:'argoDockerHub', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login -u $USERNAME -p $PASSWORD'
withCredentials([usernamePassword(credentialsId:'argoContainers', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login ghcr.io -u $USERNAME -p $PASSWORD'
}

// DNS error if --network is default
sh "docker build --network=host . -t icgcargo/workflow-gateway:edge -t icgcargo/workflow-gateway:${version}-${commit}"
sh "docker build --network=host . -t ${dockerRepo}:edge -t ${dockerRepo}:${version}-${commit}"

sh "docker push icgcargo/workflow-gateway:${version}-${commit}"
sh "docker push icgcargo/workflow-gateway:edge"
sh "docker push ${dockerRepo}:${version}-${commit}"
sh "docker push ${dockerRepo}:edge"
}
}
}

stage('deploy to rdpc-collab-dev') {
when {
branch "develop"
}
steps {
build(job: "/provision/helm", parameters: [
[$class: 'StringParameterValue', name: 'AP_RDPC_ENV', value: 'dev' ],
[$class: 'StringParameterValue', name: 'AP_CHART_NAME', value: 'workflow-gateway'],
[$class: 'StringParameterValue', name: 'AP_RELEASE_NAME', value: 'gateway'],
[$class: 'StringParameterValue', name: 'AP_HELM_CHART_VERSION', value: "${chartVersion}"],
[$class: 'StringParameterValue', name: 'AP_ARGS_LINE', value: "--set-string image.tag=${version}-${commit}" ]
])
}
}

stage('Release & Tag') {
when {
branch "master"
Expand All @@ -66,20 +85,36 @@ spec:
container('docker') {
withCredentials([usernamePassword(credentialsId: 'argoGithub', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git tag ${version}"
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/icgc-argo/workflow-gateway --tags"
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${gitHubRepo} --tags"
}

withCredentials([usernamePassword(credentialsId:'argoDockerHub', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login -u $USERNAME -p $PASSWORD'
withCredentials([usernamePassword(credentialsId:'argoContainers', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login ghcr.io -u $USERNAME -p $PASSWORD'
}

// DNS error if --network is default
sh "docker build --network=host . -t icgcargo/workflow-gateway:latest -t icgcargo/workflow-gateway:${version}"
sh "docker build --network=host . -t ${dockerRepo}:latest -t ${dockerRepo}:${version}"

sh "docker push icgcargo/workflow-gateway:${version}"
sh "docker push icgcargo/workflow-gateway:latest"
sh "docker push ${dockerRepo}:${version}"
sh "docker push ${dockerRepo}:latest"
}
}
}

stage('deploy to rdpc-collab-qa') {
when {
branch "master"
}
steps {
build(job: "/provision/helm", parameters: [
[$class: 'StringParameterValue', name: 'AP_RDPC_ENV', value: 'qa' ],
[$class: 'StringParameterValue', name: 'AP_CHART_NAME', value: 'workflow-gateway'],
[$class: 'StringParameterValue', name: 'AP_RELEASE_NAME', value: 'gateway'],
[$class: 'StringParameterValue', name: 'AP_HELM_CHART_VERSION', value: "${chartVersion}"],
[$class: 'StringParameterValue', name: 'AP_ARGS_LINE', value: "--set-string image.tag=${version}" ]
])
}
}

}
}
Loading

0 comments on commit 85be573

Please sign in to comment.