diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b14c1699f180d35fa3ca09ae305a9e8d94135be9..d150308ef9feb3cb2720438a2251d69d955a1e80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,7 @@ variables: POSTGRES_DB: archive POSTGRES_USER: "archive" POSTGRES_PASSWORD: "docker" + DL_HOST: https://dl-nrao.aoc.nrao.edu # CI Postgres Service services: @@ -241,16 +242,18 @@ deploy: # Docker doesn't allow variable interpolation when declaring Docker Secret names # This sed command finds and replaces "dsoc_ENV_secrets:" with "dsoc_${DEPLOY_ENV}_secrets:" - sed -i "s/dsoc_ENV_secrets:/dsoc_${DEPLOY_ENV}_secrets:/g" docker-compose.dev.yml - - ENV=$DEPLOY_ENV TAG=$IMAGE_TAG docker stack deploy --compose-file docker-compose.dev.yml workspaces-${DEPLOY_ENV} + - ENV=$DEPLOY_ENV TAG=$IMAGE_TAG DL_HOST=$DL_HOST docker stack deploy --compose-file docker-compose.dev.yml workspaces-${DEPLOY_ENV} rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH variables: IMAGE_TAG: ${CI_DEFAULT_BRANCH} - - if: '$CI_COMMIT_TAG =~ /^end-of-sprint\/[0-9]+/' + - if: '$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/' variables: IMAGE_TAG: $CI_COMMIT_TAG # override DEPLOY_ENV DEPLOY_ENV: "test" + # override DL_HOST + DL_HOST: https://dl-dsoc-test.nrao.edu # - if: '$CI_COMMIT_TAG =~ /^test_[0-9]+\.[0-9]+.[0-9]+$/' # variables: # IMAGE_TAG: $CI_COMMIT_TAG diff --git a/apps/web/Dockerfile.dev b/apps/web/Dockerfile.dev index 1422df1de1c4e966c38180f84004e5edce78c9b5..c429182bbdbc98ca3e309eb5eb5b37d0a6ecb60e 100644 --- a/apps/web/Dockerfile.dev +++ b/apps/web/Dockerfile.dev @@ -23,7 +23,7 @@ RUN ./node_modules/.bin/ng build --configuration=dev --output-path=dist FROM nginx:1.19.7-alpine # Copy WS nginx config from base-build stage -COPY --from=base-build /app/ws-nginx.conf /etc/nginx/conf.d/ +COPY --from=base-build /app/ws-nginx.conf.template /etc/nginx/templates/ # Remove default nginx config RUN rm /etc/nginx/conf.d/default.conf @@ -33,6 +33,3 @@ COPY --from=base-build /app/dist /usr/share/nginx/html # Expose port EXPOSE 4444 - -# Run nginx with daemon off to run as foreground process -CMD nginx -g "daemon off;" \ No newline at end of file diff --git a/apps/web/ws-nginx.conf b/apps/web/ws-nginx.conf.template similarity index 91% rename from apps/web/ws-nginx.conf rename to apps/web/ws-nginx.conf.template index 0a494c19b6789d63c7d5281a57f2475e4832aa92..d7073974b22f63dc1e9cef51f92a11252c039e55 100644 --- a/apps/web/ws-nginx.conf +++ b/apps/web/ws-nginx.conf.template @@ -19,7 +19,7 @@ server { } location /dl { - rewrite ^/dl(/.*)$ https://dl-nrao.aoc.nrao.edu$1 last; + rewrite ^/dl(/.*)$ ${DL_HOST}$1 last; } error_page 500 502 503 504 /50x.html; diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 973d4ace6ff4bf645f6db3979fe675a59ffcb1a3..d818dc6645da5baeaba3672561bd120de426e0cf 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -31,7 +31,7 @@ services: parallelism: 0 order: stop-first volumes: - - /lustre/aoc/cluster/pipeline/dsoc-dev/downloads/nrao:/lustre/aoc/cluster/pipeline/dsoc-dev/downloads/nrao + - /lustre/aoc/cluster/pipeline/dsoc-${ENV}/downloads/nrao:/lustre/aoc/cluster/pipeline/dsoc-${ENV}/downloads/nrao capability: image: marconi.aoc.nrao.edu/workspaces/capability:${TAG} @@ -100,6 +100,8 @@ services: published: 4444 protocol: tcp mode: host + environment: + DL_HOST: ${DL_HOST} deploy: placement: constraints: