Skip to content
Snippets Groups Projects
Commit 4af35afe authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

Add support for passing dl host to our web container from GL

- made our volume mounts dynamic with ENV variable
- changed our test deployment trigger with git tags as end-of-sprint-[0-9]+
parent 01d21ef4
No related branches found
No related tags found
1 merge request!169WS 159 nginx template for env variables
Pipeline #1132 passed with warnings
......@@ -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
......
......@@ -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
......@@ -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;
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment