Skip to content

Commit

Permalink
Merge pull request #2220 from weather-gov/jt/gitlab-ci-build-images
Browse files Browse the repository at this point in the history
gitlab ci: set up api and playwright images
  • Loading branch information
jamestranovich-noaa authored Jan 15, 2025
2 parents 6e867b2 + 21e450b commit 4a28d9f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,36 @@ build-drupal-image:
DERIVED_IMAGE_NAME: 18f-zscaler-drupal
IMAGE_NAME: drupal

build-api-proxy-image:
extends: .build-image
variables:
DERIVED_IMAGE_NAME: api-proxy
IMAGE_NAME: api-proxy

build-api-interop-image:
extends: .build-image
variables:
DERIVED_IMAGE_NAME: api-interop-layer
IMAGE_NAME: api-interop-layer

build-playwright-image:
extends: .build-image
variables:
DERIVED_IMAGE_NAME: playwright
IMAGE_NAME: playwright

# docker compose does not actually "build" the database image because there is
# nothing to compose. so, instead, we pull the dependent mysql image and push
# that as a weather.gov image instead
build-database-image:
extends: .build-image
script:
- docker pull mysql:8.0
- IMAGE_ID=$(docker images | grep mysql | awk '{print $3}')
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker image tag $IMAGE_ID $CI_REGISTRY_IMAGE/weathergov-database:latest
- docker push $CI_REGISTRY_IMAGE/weathergov-database:latest

# NB: GitLab clones into CI_BUILDS_DIR which defaults to
# /builds/gitlab-licensed/NWS/Systems/DIS/Weather.gov-2.0/ whereas in our Docker
# images our WORKDIR is /app. so we symlink the various /app/node_modules to
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile.playwright
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20

RUN mkdir /app
WORKDIR /app

ADD ./package.json .
ADD ./package-lock.json .
RUN npm ci
RUN npx playwright install chrome --with-deps --only-shell
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ services:
- /app/node_modules
profiles: ["utility"]

playwright:
build:
context: .
dockerfile: Dockerfile.playwright
networks:
- weather.gov
volumes:
- ./:/app
- /app/node_modules
profiles: ["utility"]

uswds:
build:
context: ./
Expand Down

0 comments on commit 4a28d9f

Please sign in to comment.