environment test
This commit is contained in:
parent
527c821e3e
commit
ba5bd2d937
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
@ -42,6 +42,8 @@ podTemplate(
|
|||
def shortGitCommit = "${gitCommit[0..10]}"
|
||||
def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", returnStdout: true)
|
||||
def docker_registry_url = "harbor.loafle.net"
|
||||
def app_version_value = sh(returnStdout: true, script: "cat build.gradle | grep -o 'version = [^,]*'").trim()
|
||||
def app_version = app_version_value.split(/=/)[1]
|
||||
|
||||
stage('Test') {
|
||||
try {
|
||||
|
@ -74,8 +76,8 @@ podTemplate(
|
|||
passwordVariable: 'HARBOR_PASSWORD']]) {
|
||||
sh """
|
||||
docker login -u "${HARBOR_USER}" -p "${HARBOR_PASSWORD}" ${docker_registry_url}
|
||||
docker build -t ${docker_registry_url}/prototype/cicd-java-spring-boot:${gitCommit} --build-arg JAR_NAME="cicd-${gitCommit}.jar" .
|
||||
docker push ${docker_registry_url}/prototype/cicd-java-spring-boot:${gitCommit}
|
||||
docker build -t ${docker_registry_url}/prototype/cicd-java-spring-boot:${app_version} --build-arg JAR_NAME="cicd-${app_version}.jar" .
|
||||
docker push ${docker_registry_url}/prototype/cicd-java-spring-boot:${app_version}
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user