From de53a9d3a048283ac87415fd560c98efca017c48 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 1 Jan 2019 23:43:00 +0100 Subject: [PATCH] #814 Deploy fixes --- Jenkinsfile | 25 ++++++++++++++++--------- gulpfile.js | 6 +++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4ef48e2a3..eb29e62f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,5 @@ #!/usr/bin/env groovy -env.COMPOSE_HTTP_TIMEOUT = 300; -env.COMPOSE_PROJECT_NAME = salix - switch (env.BRANCH_NAME) { case 'test': env.NODE_ENV = 'test'; @@ -14,7 +11,9 @@ switch (env.BRANCH_NAME) { node { stage ('Print environment variables') { - echo "Branch ${env.BRANCH_NAME}, build number ${env.BUILD_NUMBER}, environment ${env.NODE_ENV}" + echo "Branch: ${env.BRANCH_NAME}" + echo "Build number: ${env.BUILD_NUMBER}" + echo "Node environment: ${env.NODE_ENV}" } stage ('Checkout') { checkout scm @@ -31,13 +30,21 @@ node { sh "gulp build" } } - stage ('Generating new dockers') { + stage ('Docker deployment') { + environment { + COMPOSE_HTTP_TIMEOUT = 300 + COMPOSE_PROJECT_NAME = 'salix' + DOCKER_TLS_VERIFY = 1 + } + sh "docker-compose build" - env.DOCKER_HOST = 'tcp://vch1.verdnatura.es:2376'; - sh "docker-compose up -d" + withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) { + env.DOCKER_HOST = 'tcp://vch1.verdnatura.es:2376'; + sh "docker-compose up -d" - env.DOCKER_HOST = 'tcp://vch2.verdnatura.es:2376'; - sh "docker-compose up -d" + env.DOCKER_HOST = 'tcp://vch2.verdnatura.es:2376'; + sh "docker-compose up -d" + } } } diff --git a/gulpfile.js b/gulpfile.js index 6b4f04109..956552aa6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -78,7 +78,7 @@ gulp.task('e2e-only', () => { if (argv.show || argv.s) process.env.E2E_SHOW = true; - return gulp.src('./e2e_tests.js') + return gulp.src('./e2e/tests.js') .pipe(jasmine({reporter: 'none'})); }); @@ -88,7 +88,7 @@ gulp.task('smokes', ['docker'], async() => { gulp.task('smokes-only', () => { const jasmine = require('gulp-jasmine'); - return gulp.src('./smokes_tests.js') + return gulp.src('./smokes-tests.js') .pipe(jasmine({reporter: 'none'})); }); @@ -125,7 +125,7 @@ gulp.task('install', () => { const install = require('gulp-install'); const print = require('gulp-print'); - let packageFiles = []; + let packageFiles = ['front/package.json']; let services = fs.readdirSync(servicesDir); services.forEach(service => { packageFiles.push(`${servicesDir}/${service}/package.json`);