forked from verdnatura/hedera-web
Docker deployment
This commit is contained in:
parent
77a8787ad2
commit
c9703bbeee
|
@ -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"]
|
||||
|
|
|
@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -29,4 +29,4 @@ configs:
|
|||
name: ${PROJECT_NAME:?}_test
|
||||
apache:
|
||||
external: true
|
||||
name: ${PROJECT_NAME:?}_apache
|
||||
name: ${PROJECT_NAME:?}_apache
|
||||
|
|
Loading…
Reference in New Issue