forked from verdnatura/hedera-web
#3974 Create test branch
This commit is contained in:
parent
32b794225a
commit
2d12be21cb
|
@ -1,6 +1,9 @@
|
||||||
# Not using buster because of bug: https://bugs.php.net/bug.php?id=78870
|
# Not using buster because of bug: https://bugs.php.net/bug.php?id=78870
|
||||||
FROM debian:stretch-slim
|
FROM debian:stretch-slim
|
||||||
|
|
||||||
|
ARG VERSION
|
||||||
|
ENV VERSION $VERSION
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
@ -37,8 +40,9 @@ RUN apt-get update \
|
||||||
cron
|
cron
|
||||||
|
|
||||||
ARG BUILD_ID=unknown
|
ARG BUILD_ID=unknown
|
||||||
|
RUN echo $VERSION
|
||||||
RUN apt-get update \
|
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/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
CMD ["apachectl", "-D", "FOREGROUND"]
|
CMD ["apachectl", "-D", "FOREGROUND"]
|
||||||
|
|
|
@ -8,12 +8,28 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
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()
|
setEnv()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Package') {
|
stage('Package') {
|
||||||
when {
|
when {
|
||||||
branch 'master'
|
branch 'master'
|
||||||
|
branch 'test'
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
|
@ -31,6 +47,7 @@ pipeline {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
when {
|
when {
|
||||||
branch 'master'
|
branch 'master'
|
||||||
|
branch 'test'
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
CREDS = credentials('docker-registry')
|
CREDS = credentials('docker-registry')
|
||||||
|
@ -44,6 +61,7 @@ pipeline {
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
when {
|
when {
|
||||||
branch 'master'
|
branch 'master'
|
||||||
|
branch 'test'
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
DOCKER_HOST = "${env.SWARM_HOST}"
|
DOCKER_HOST = "${env.SWARM_HOST}"
|
||||||
|
@ -54,7 +72,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
unsuccessful {
|
||||||
sendEmail()
|
sendEmail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (1.407.65) stable; urgency=low
|
hedera-web (1.407.66) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
version: '3.7'
|
version: '3.7'
|
||||||
services:
|
services:
|
||||||
main:
|
main:
|
||||||
image: registry.verdnatura.es/hedera-web
|
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
- VERSION=${VERSION:?}
|
||||||
ports:
|
ports:
|
||||||
- 80
|
- 80
|
||||||
configs:
|
configs:
|
||||||
|
@ -17,12 +19,12 @@ services:
|
||||||
- /mnt/appdata/image:/var/lib/hedera-web/image-db
|
- /mnt/appdata/image:/var/lib/hedera-web/image-db
|
||||||
- /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access
|
- /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access
|
||||||
deploy:
|
deploy:
|
||||||
replicas: 3
|
replicas: ${REPLICAS:?}
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- node.role == worker
|
- node.role == worker
|
||||||
cron:
|
cron:
|
||||||
image: registry.verdnatura.es/hedera-web
|
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
|
||||||
command: 'cron -f'
|
command: 'cron -f'
|
||||||
configs:
|
configs:
|
||||||
- source: config
|
- source: config
|
||||||
|
@ -37,7 +39,4 @@ services:
|
||||||
configs:
|
configs:
|
||||||
config:
|
config:
|
||||||
external: true
|
external: true
|
||||||
name: ${PROJECT_NAME:?}_config
|
name: ${PROJECT_NAME:?}-${BRANCH_NAME:?}
|
||||||
test:
|
|
||||||
external: true
|
|
||||||
name: ${PROJECT_NAME:?}_test
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "1.407.65",
|
"version": "1.407.66",
|
||||||
"description": "Verdnatura web page",
|
"description": "Verdnatura web page",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue