0
1
Fork 0

Merge pull request 'test' (#1) from test into master

Reviewed-on: verdnatura/hedera-web#1
This commit is contained in:
Juan Ferrer 2022-05-05 09:43:20 +00:00
commit 07632e077e
5 changed files with 44 additions and 18 deletions

View File

@ -1,6 +1,9 @@
# Not using buster because of bug: https://bugs.php.net/bug.php?id=78870
FROM debian:stretch-slim
ARG VERSION
ENV VERSION $VERSION
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
@ -37,8 +40,9 @@ RUN apt-get update \
cron
ARG BUILD_ID=unknown
RUN echo $VERSION
RUN apt-get update \
&& apt-get install -y php-vn-lib hedera-web \
&& apt-get install -y php-vn-lib hedera-web=$VERSION \
&& rm -rf /var/lib/apt/lists/*
CMD ["apachectl", "-D", "FOREGROUND"]

29
Jenkinsfile vendored
View File

@ -4,16 +4,35 @@ pipeline {
agent any
environment {
PROJECT_NAME = 'hedera-web'
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
}
stages {
stage('Checkout') {
steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = packageJson.version
switch (env.BRANCH_NAME) {
case 'master':
env.NODE_ENV = 'production'
env.REPLICAS = 3
break
case 'test':
env.NODE_ENV = 'test'
env.REPLICAS = 1
break
}
}
setEnv()
}
}
stage('Package') {
when {
anyOf {
branch 'master'
branch 'test'
}
}
agent {
docker {
@ -30,7 +49,10 @@ pipeline {
}
stage('Build') {
when {
anyOf {
branch 'master'
branch 'test'
}
}
environment {
CREDS = credentials('docker-registry')
@ -43,18 +65,21 @@ pipeline {
}
stage('Deploy') {
when {
anyOf {
branch 'master'
branch 'test'
}
}
environment {
DOCKER_HOST = "${env.SWARM_HOST}"
}
steps {
dockerStackDeploy()
sh "docker stack deploy --with-registry-auth --compose-file docker-compose.yml ${env.STACK_NAME}"
}
}
}
post {
always {
unsuccessful {
sendEmail()
}
}

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.407.65) stable; urgency=low
hedera-web (1.407.66) stable; urgency=low
* Initial Release.

View File

@ -1,28 +1,28 @@
version: '3.7'
services:
main:
image: registry.verdnatura.es/hedera-web
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
build:
context: .
dockerfile: Dockerfile
args:
- VERSION=${VERSION:?}
ports:
- 80
configs:
- source: config
target: /etc/hedera-web/config.my.php
- source: test
target: /etc/hedera-web/config.test.php
volumes:
- /mnt/appdata:/mnt/storage
- /mnt/appdata/image:/var/lib/hedera-web/image-db
- /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access
deploy:
replicas: 3
replicas: ${REPLICAS:?}
placement:
constraints:
- node.role == worker
cron:
image: registry.verdnatura.es/hedera-web
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
command: 'cron -f'
configs:
- source: config
@ -37,7 +37,4 @@ services:
configs:
config:
external: true
name: ${PROJECT_NAME:?}_config
test:
external: true
name: ${PROJECT_NAME:?}_test
name: ${PROJECT_NAME:?}-${BRANCH_NAME:?}

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.407.65",
"version": "1.407.66",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {