make gitea/Jenkinsfile declarative

- fix environment
This commit is contained in:
2019-02-10 10:50:16 -05:00
parent c447bd544e
commit 3697bddcf4

View File

@@ -1,6 +1,8 @@
pipeline {
def workdir = 'dockerfiles/services/gitea'
def docker_host = 'dkhost:2376'
environment {
WORKDIR = 'dockerfiles/services/gitea'
DOCKER_HOST = 'dkhost:2376'
}
agent { label 'docker' }
options {
@@ -20,17 +22,17 @@ pipeline {
stage('build') {
steps {
dir(workdir) {
sh "DOCKER_HOST=${docker_host} docker-compose -f docker-compose.yml pull"
dir(WORKDIR) {
sh "DOCKER_HOST=${DOCKER_HOST} docker-compose -f docker-compose.yml pull"
}
}
}
stage('deploy') {
steps {
dir(workdir) {
dir(WORKDIR) {
sh """
export DOCKER_HOST=${docker_host}
export DOCKER_HOST=${DOCKER_HOST}
docker stack deploy --with-registry-auth --prune -c docker-compose.yml gitea
../scaleout.sh gitea_app 180
"""
@@ -40,7 +42,7 @@ pipeline {
stage('smoke tests') {
steps {
dir(workdir) {
dir(WORKDIR) {
sleep 60
sh "curl -If http://dkhost:10080"
}