feat: run.sh build neccessary images
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2025-03-13 13:07:24 +01:00
parent 142c39c8f4
commit 5ff5926c23
1 changed files with 21 additions and 6 deletions

View File

@ -1,24 +1,39 @@
#!/bin/bash #!/bin/bash
salix_dir="${1:-$HOME/Projects/salix}"
salix_dir=$(eval echo "$salix_dir")
echo "$salix_dir"
current_dir=$(pwd)
cleanup() { cleanup() {
if [[ -z "$ended" ]]; then
ended=true
docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml down -v docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml down -v
fi
} }
trap cleanup SIGINT trap cleanup SIGINT
#CLEAN # CLEAN
rm -rf test/cypress/screenshots rm -rf test/cypress/screenshots
rm -f test/cypress/results/* rm -f test/cypress/results/*
rm -f test/cypress/reports/* rm -f test/cypress/reports/*
rm -f junit/e2e-*.xml rm -f junit/e2e-*.xml
#RUN # RUN
export CI=true export CI=true
export TZ=Europe/Madrid export TZ=Europe/Madrid
# IMAGES
docker build -t registry.verdnatura.es/salix-back:dev -f "$salix_dir/back/Dockerfile" "$salix_dir"
cd "$salix_dir" && npx myt run -t
docker exec vn-database sh -c "rm -rf /mysql-template"
docker exec vn-database sh -c "cp -a /var/lib/mysql /mysql-template"
docker commit vn-database registry.verdnatura.es/salix-db:dev
docker rm -f vn-database
cd "$current_dir"
docker build -f ./docs/Dockerfile.dev -t lilium-dev .
# END IMAGES
docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml up -d docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml up -d
docker run -it --rm \ docker run -it --rm \