diff --git a/docker-compose.yml b/docker-compose.yml index 939f1ce..a99c83f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,9 +11,10 @@ services: dockerfile: test.Dockerfile volumes: - ./:/opt/sealious/ + - ~/.npm_cacache:/opt/sealious/.npm_cacache user: ${UID:-1000}:${GID:-1000} mailcatcher: image: schickling/mailcatcher:latest ports: - "127.0.0.1:1080:1080" - - "127.0.0.1:1025:1025" \ No newline at end of file + - "127.0.0.1:1025:1025" diff --git a/jenkins.prepare.sh b/jenkins.prepare.sh index cd0e390..839e120 100755 --- a/jenkins.prepare.sh +++ b/jenkins.prepare.sh @@ -11,6 +11,13 @@ export SEALIOUS_PORT=$PORT SEALIOUS_BASE_URL=$(cat .base_url) export SEALIOUS_BASE_URL +# Create the npm cache directory if it isn't present yet. If it is not present, it will be created +# when the docker image is being built with root:root as the owner. +mkdir -p ~/.npm_cacache +# Create .npm directory in the container, since it is not yet present and we need it for next step. +docker-compose run --user="$UID" --rm --service-ports test mkdir -p /opt/sealious/.npm +# Link the host-bound npm cache directory into the container's npm cache directory. +docker-compose run --user="$UID" --rm --service-ports test ln -s /opt/sealious/.npm_cacache /opt/sealious/.npm/_cacache docker-compose up -d db ./npm.sh ci ./npm.sh run build:back; diff --git a/jenkins.start.sh b/jenkins.start.sh index 6a08254..e19de74 100755 --- a/jenkins.start.sh +++ b/jenkins.start.sh @@ -18,5 +18,5 @@ docker-compose run --user="$UID"\ && echo "App started on $SEALIOUS_PORT" -echo "Deployed to https://${PORT}.dep.sealco.de" -echo "Application logs should be available at https://jenkins.sealcode.org/job/Deploy%20to%20dep.sealco.de/ws/$PORT/log.html" +echo "Deployed to https://${PORT}.dep.sealco.de" +echo "Application logs should be available at https://jenkins.sealcode.org/job/Deploy%20to%20dep.sealco.de/ws v2/$PORT/log.html"