[17.02.20] Setup kubernetes auth and bring back github tagging
This commit is contained in:
parent
56565ec3d1
commit
cc02c29f20
@ -79,13 +79,26 @@ try {
|
|||||||
|
|
||||||
sh "sed -it 's/RESOURCE_NAME/${env.APPLICATION_NAME}/g' configuration/kubernetes/service.yaml"
|
sh "sed -it 's/RESOURCE_NAME/${env.APPLICATION_NAME}/g' configuration/kubernetes/service.yaml"
|
||||||
sh "sed -it 's/LABEL/${env.APPLICATION_LABEL}/g' configuration/kubernetes/service.yaml"
|
sh "sed -it 's/LABEL/${env.APPLICATION_LABEL}/g' configuration/kubernetes/service.yaml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
|
|
||||||
|
withCredentials([kubeconfigContent(credentialsId: 'Kubernetes', variable: 'CONFIG')]) {
|
||||||
deploy( 1 )
|
echo $CONFIG
|
||||||
|
}
|
||||||
|
// kubernetesDeploy(kubeconfigId: 'Kubernetes', // REQUIRED
|
||||||
|
//
|
||||||
|
// configs: '<ant-glob-pattern-for-resource-config-paths>', // REQUIRED
|
||||||
|
// enableConfigSubstitution: false,
|
||||||
|
//
|
||||||
|
// secretNamespace: "${env.NAMESPACE}",
|
||||||
|
// secretName: '<secret-name>',
|
||||||
|
// dockerCredentials: [
|
||||||
|
// [credentialsId: '<credentials-id-for-docker-hub>'],
|
||||||
|
// [credentialsId: '<credentials-id-for-other-private-registry>', url: '<registry-url>'],
|
||||||
|
// ]
|
||||||
|
// )
|
||||||
|
deploy()
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Tag Repository') {
|
stage('Tag Repository') {
|
||||||
@ -94,8 +107,20 @@ try {
|
|||||||
withDockerRegistry([credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) {
|
withDockerRegistry([credentialsId: 'Registry', url: "${env.DOCKER_REPOSITORY_URL}"]) {
|
||||||
def image = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}")
|
def image = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:${env.APPLICATION_VERSION}")
|
||||||
image.push()
|
image.push()
|
||||||
|
def latest = docker.build("${env.DOCKER_REPOSITORY}/db-gateway:latest")
|
||||||
|
latest.push()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
withCredentials(
|
||||||
|
[usernamePassword(
|
||||||
|
credentialsId: env.BITBUCKET_CREDENTIALS_ID,
|
||||||
|
passwordVariable: 'GIT_PASSWORD',
|
||||||
|
usernameVariable: 'GIT_USERNAME'
|
||||||
|
)]
|
||||||
|
) {
|
||||||
|
sh "git tag ${env.APPLICATION_VERSION}"
|
||||||
|
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@${env.GIT_REPOSITORY_PATH} ${env.APPLICATION_VERSION}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user