Replaced dir block by 'cd' command
This commit is contained in:
40
.jenkins/Jenkinsfile
vendored
40
.jenkins/Jenkinsfile
vendored
@ -62,29 +62,27 @@ pipeline {
|
||||
sh 'git clone ${DEPLOY_REPO} --branch fluxcd'
|
||||
}
|
||||
}
|
||||
|
||||
dir('user-microservice-deploy/apps/user-microservice') {
|
||||
sh '''
|
||||
# Podmień tag obrazu w pliku deploy.yaml
|
||||
awk -v commit="$GIT_COMMIT" '
|
||||
$0 ~ /name:[[:space:]]*api/ { in_api_container = 1; print; next }
|
||||
in_api_container && $0 ~ /^[[:space:]]*image:[[:space:]]*/ {
|
||||
sub(/:[^:[:space:]]+$/, ":" commit)
|
||||
in_api_container = 0
|
||||
print
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' deploy.yaml > deploy.tmp && mv deploy.tmp deploy.yaml
|
||||
sh 'cd user-microservice-deploy/apps/user-microservice'
|
||||
sh '''
|
||||
# Podmień tag obrazu w pliku deploy.yaml
|
||||
awk -v commit="$GIT_COMMIT" '
|
||||
$0 ~ /name:[[:space:]]*api/ { in_api_container = 1; print; next }
|
||||
in_api_container && $0 ~ /^[[:space:]]*image:[[:space:]]*/ {
|
||||
sub(/:[^:[:space:]]+$/, ":" commit)
|
||||
in_api_container = 0
|
||||
print
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' deploy.yaml > deploy.tmp && mv deploy.tmp deploy.yaml
|
||||
'''
|
||||
|
||||
sshagent(['gitea-deploy-key']) {
|
||||
sh '''
|
||||
git add deploy.yaml
|
||||
git diff-index --quiet HEAD || git commit -m "JENKINS: Changed deployed version to $GIT_COMMIT"
|
||||
git push origin fluxcd
|
||||
'''
|
||||
}
|
||||
sshagent(['gitea-deploy-key']) {
|
||||
sh '''
|
||||
git add deploy.yaml
|
||||
git diff-index --quiet HEAD || git commit -m "JENKINS: Changed deployed version to $GIT_COMMIT"
|
||||
git push origin fluxcd
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user