diff --git a/Jenkinsfile b/Jenkinsfile index 9c35c2f7d..d77a2d521 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,12 +39,8 @@ pipeline { NODE_ENV = "" } steps { - // sh "docker network ls | grep testing-\${env.STACK_NAME} | awk '{print \$1}' | xargs -r docker network rm" - // sh "docker network ls | grep testing-salix-5739 | awk '{print \$1}' | xargs -r docker network rm" - // sh "docker network create testing-salix-5739-dockerrefactor_default" sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml rm --stop" sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml build --force-rm db back" - // sh "docker-compose -p testing-${env.STACK_NAME} -f docker-compose.test.yml up db" } } stage('Test') { diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 9560ed267..776072645 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -2,7 +2,7 @@ version: "3.7" services: # node_modules: # image: node:20-bullseye-slim - # command: npm install --ci + # command: sh -c "npm i gulp-cli && npm install --ci && npx gulp i" # user: "${UID}:${GID}" # working_dir: /salix # volumes: @@ -32,7 +32,6 @@ services: - ./front:/salix/front - ./loopback:/salix/loopback - ./node_modules:/salix/node_modules - back: image: back command: ["npx", "gulp", "backWatch"] diff --git a/docker-compose.test.yml b/docker-compose.test.yml index e15d9d8df..cf4f6556d 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,17 +1,5 @@ version: "3.7" services: - # node_modules: - # image: node:20-bullseye-slim - # command: npm install --ci - # working_dir: /salix - # volumes: - # - .:/salix - # print: - # image: node:20-bullseye-slim - # # command: cd print && npm install --ci - # working_dir: /salix/print - # volumes: - # - ./print:/salix/print db: image: db:test restart: always @@ -39,18 +27,13 @@ services: - NODE_ENV depends_on: - db - # e2e: - # image: e2e - # restart: always - # build: - # context: . - # dockerfile: e2e/Dockerfile - # environment: - # - NODE_ENV - # depends_on: - # - front - -# networks: -# stack-network: -# driver: host - + e2e: + image: e2e + restart: always + build: + context: . + dockerfile: e2e/Dockerfile + environment: + - NODE_ENV + depends_on: + - front diff --git a/e2e/helpers/config.js b/e2e/helpers/config.js index 8e5bda96c..1cb13cbf7 100644 --- a/e2e/helpers/config.js +++ b/e2e/helpers/config.js @@ -1,3 +1,3 @@ module.exports = { - url: 'http://localhost:5000' + url: 'http://front:5000' }; diff --git a/init.sh b/init.sh index f481c716f..0770c08b5 100644 --- a/init.sh +++ b/init.sh @@ -1,2 +1,7 @@ -# docker run --rm -v $(pwd):/app -w /app node:20-bullseye-slim npm install -docker network create --driver=host salix-stack-network +sudo docker run --rm -it \ + -w /salix \ + -v $PWD/../salix:/salix \ + node:20-bullseye \ + npm i -g gulp-cli \ + npm i \ + gulp i diff --git a/runTestE2E.sh b/runTestE2E.sh index df1ff889c..743f51884 100644 --- a/runTestE2E.sh +++ b/runTestE2E.sh @@ -2,6 +2,8 @@ docker-compose -p salix-test -f docker-compose.test.yml build --force-rm db docker-compose -p salix-test -f docker-compose.test.yml build --force-rm back docker-compose -p salix-test -f docker-compose.test.yml build --force-rm front docker-compose -p salix-test -f docker-compose.test.yml build --force-rm e2e +docker-compose -p salix-test -f docker-compose.test.yml up db back --no-recreate +docker-compose -p salix-test -f docker-compose.test.yml up front docker-compose -p salix-test -f docker-compose.test.yml run e2e #--rm docker-compose -p salix-test -f docker-compose.test.yml rm -s -v -f # docker-compose -p salix-test -f docker-compose.test.yml down