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