feat: refs #6695 try up db
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2024-09-25 14:12:02 +02:00
parent 621e39afbe
commit 1b47612c5e
4 changed files with 76 additions and 22 deletions

View File

@ -1,3 +1,3 @@
node_modules
print/node_modules
front
e2e

42
Jenkinsfile vendored
View File

@ -186,27 +186,27 @@ pipeline {
}
}
}
stage('Push') {
when {
expression { RUN_BUILD }
}
environment {
CREDENTIALS = credentials('docker-registry')
}
steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
}
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
sh 'docker-compose push'
script {
if (env.BRANCH_NAME == 'master') {
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
sh 'docker push $IMAGE:latest'
}
}
}
// stage('Push') {
// when {
// expression { RUN_BUILD }
// }
// environment {
// CREDENTIALS = credentials('docker-registry')
// }
// steps {
// script {
// def packageJson = readJSON file: 'package.json'
// env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
// }
// sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
// sh 'docker-compose push'
// script {
// if (env.BRANCH_NAME == 'master') {
// sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
// sh 'docker push $IMAGE:latest'
// }
// }
// }
}
stage('Deploy') {
when {

32
db/Dockerfile Normal file
View File

@ -0,0 +1,32 @@
FROM node:20-bullseye AS base
# FROM back AS base
ENV TZ Europe/Madrid
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libkrb5-dev libssl-dev
RUN npm i -g pnpm
WORKDIR /salix
COPY db db
# COPY node_modules node_modules
COPY myt.config.yml .
# RUN ls
RUN pnpm i @verdnatura/myt
FROM base AS db
WORKDIR /salix
# RUN cat myt.config.yml
# RUN ls
# RUN cd db
# RUN ls
RUN usermod -aG docker $USER
# RUN npx myt run -d
CMD ["npx", "myt", "run", "-d"]

22
docker-compose.test.yml Normal file
View File

@ -0,0 +1,22 @@
version: '3.7'
services:
front:
image: registry.verdnatura.es/salix-front:${VERSION:?}
build:
context: front
back:
image: registry.verdnatura.es/salix-back:${VERSION:?}
build:
context: .
dockerfile: back/Dockerfile
volumes:
- ./storage:/salix/storage
db:
image: db
build:
context: .
dockerfile: db/Dockerfile
target: db
volumes:
- /var/run/docker.sock:/var/run/docker.sock
user: root