0
1
Fork 0

#3974 Create test branch

This commit is contained in:
Juan Ferrer 2022-05-05 11:05:05 +02:00
parent 32b794225a
commit 2d12be21cb
5 changed files with 33 additions and 12 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"]

22
Jenkinsfile vendored
View File

@ -8,12 +8,28 @@ pipeline {
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 {
branch 'master'
branch 'test'
}
agent {
docker {
@ -31,6 +47,7 @@ pipeline {
stage('Build') {
when {
branch 'master'
branch 'test'
}
environment {
CREDS = credentials('docker-registry')
@ -44,6 +61,7 @@ pipeline {
stage('Deploy') {
when {
branch 'master'
branch 'test'
}
environment {
DOCKER_HOST = "${env.SWARM_HOST}"
@ -54,8 +72,8 @@ pipeline {
}
}
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,10 +1,12 @@
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:
@ -17,12 +19,12 @@ services:
- /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 +39,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": {