Merge branch 'feature/main-02-AddBuildHistory'
This commit is contained in:
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@@ -100,7 +100,18 @@ pipeline {
|
||||
}
|
||||
|
||||
agent any
|
||||
environment {
|
||||
JENKINS_BASE_URL = 'http://jenkins:8080'
|
||||
JENKINS_JOB_NAME = 'Espetos'
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
usernamePassword(
|
||||
credentialsId: 'jenkins-api-token',
|
||||
usernameVariable: 'JENKINS_USER',
|
||||
passwordVariable: 'JENKINS_TOKEN'
|
||||
)
|
||||
]) {
|
||||
sh '''
|
||||
set -e
|
||||
|
||||
@@ -126,7 +137,12 @@ pipeline {
|
||||
docker rm -f cafeteria-backend
|
||||
docker run -d \
|
||||
--name cafeteria-backend \
|
||||
-p "$BACKEND_PORT":"$BACKEND_PORT" \
|
||||
--network ci-net \
|
||||
-e JENKINS_BASE_URL \
|
||||
-e JENKINS_JOB_NAME \
|
||||
-e JENKINS_USER \
|
||||
-e JENKINS_TOKEN \
|
||||
-p "$BACKEND_PORT":"$BACKEND_PORT" \
|
||||
cafeteria-backend:previous
|
||||
exit 1
|
||||
fi
|
||||
@@ -153,6 +169,7 @@ pipeline {
|
||||
fi
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user