0
1
Fork 0

Docker deployment

This commit is contained in:
Juan Ferrer 2020-01-21 09:00:03 +01:00
parent 77a8787ad2
commit c9703bbeee
4 changed files with 47 additions and 14 deletions

View File

@ -23,10 +23,11 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN a2dissite 000-default
ARG STAMP=unknown
RUN apt-get update \
&& apt-get install -y hedera-web \
&& rm -rf /var/lib/apt/lists/*
RUN a2dissite 000-default
CMD ["apachectl", "-D", "FOREGROUND"]

52
Jenkinsfile vendored
View File

@ -4,27 +4,59 @@ pipeline {
environment {
PROJECT_NAME = 'hedera-web'
}
agent {
docker {
image 'registry.verdnatura.es/vn-debuild'
registryUrl 'https://registry.verdnatura.es/'
registryCredentialsId 'docker-registry'
args '-v /mnt/storage/reprepro:/reprepro'
}
}
stages {
stage('Checkout') {
steps {
configFileProvider([
configFile(fileId: "${PROJECT_NAME}.groovy",
variable: 'GROOVY_FILE')
]) {
load env.GROOVY_FILE
}
sh 'printenv'
}
}
stage('Package') {
when {
branch 'master'
}
agent {
docker {
image 'registry.verdnatura.es/vn-debuild'
registryUrl 'https://registry.verdnatura.es/'
registryCredentialsId 'docker-registry'
args '-v /mnt/storage/reprepro:/reprepro'
}
}
steps {
sh 'debuild -us -uc -b'
sh 'vn-includedeb'
}
}
stage('Build') {
when {
branch 'master'
}
environment {
CREDS = credentials('docker-registry')
}
steps {
nodejs('node-lts') {
sh 'gulp build'
}
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
sh 'docker-compose build --parallel'
sh 'docker-compose push'
}
}
stage('Deploy') {
when {
branch 'master'
}
steps {
sh 'debuild -us -uc -b'
sh 'vn-includedeb'
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.PROJECT_NAME}"
}
}
}

2
debian/postinst vendored
View File

@ -8,8 +8,8 @@ if [ -e /usr/share/apache2/apache2-maintscript-helper ]
then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf hedera-web.conf
apache2_invoke enmod rewrite headers
fi
#service php7.3-fpm restart
#service cron restart

View File

@ -29,4 +29,4 @@ configs:
name: ${PROJECT_NAME:?}_test
apache:
external: true
name: ${PROJECT_NAME:?}_apache
name: ${PROJECT_NAME:?}_apache