-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: [M3-8769] - Add Docker Compose service to reverse proxy Cloud i…
…n CI (#11177) * Expose Cloud Manager-specific Node.js Image * Remove `expect` and `openssh-client` installation step, consolidate `e2e-install` and `e2e-build` stages * Add `e2e-reverse-proxy` image which includes caddy * Add `cypress_containerized` Docker Compose service, improve docs * Add changesets * Make pnpm and bun available in Cypress containers
- Loading branch information
1 parent
308dc90
commit d871268
Showing
4 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-11177-tech-stories-1730214757061.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Tech Stories | ||
--- | ||
|
||
Add `cypress_containerized` Docker Compose service ([#11177](https://github.com/linode/manager/pull/11177)) |
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-11177-tech-stories-1730214793474.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Tech Stories | ||
--- | ||
|
||
Add `nodejs-cloud-manager` Dockerfile target ([#11177](https://github.com/linode/manager/pull/11177)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,67 @@ | ||
# Node.js base image for Cloud Manager CI tasks. | ||
# | ||
# Extends from the Node.js base image that corresponds with our latest supported | ||
# version of Node, and includes other tools that we rely on like pnpm and bun. | ||
FROM node:20.17-bullseye-slim as nodejs-cloud-manager | ||
RUN npm install -g pnpm bun | ||
|
||
# `manager` | ||
# | ||
# Serves Cloud Manager. | ||
FROM node:20.17-bullseye-slim as manager | ||
# Assumes Cloud Manager dependencies are installed at `/home/node/app/node_modules`, | ||
# and Cloud Manager is built. | ||
FROM nodejs-cloud-manager as manager | ||
ENV NODE_ENV=development | ||
WORKDIR /home/node/app | ||
VOLUME /home/node/app | ||
EXPOSE 3000/tcp | ||
|
||
# Curl is needed for health check. | ||
RUN apt-get update \ | ||
&& apt-get install -y curl \ | ||
&& rm -rf /var/cache/apt/* \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get clean | ||
|
||
CMD yarn start:manager:ci | ||
|
||
# e2e-build | ||
# | ||
# Builds an image containing Cypress and miscellaneous system utilities required | ||
# by the tests. | ||
FROM cypress/included:13.11.0 as e2e-build | ||
RUN apt-get update \ | ||
&& apt-get install -y expect openssh-client \ | ||
&& rm -rf /var/cache/apt/* \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get clean | ||
|
||
# e2e-install | ||
# | ||
# Installs Cypress and sets up cache directories. | ||
FROM e2e-build as e2e-install | ||
RUN npm install -g pnpm bun | ||
USER node | ||
WORKDIR /home/node/app | ||
VOLUME /home/node/app | ||
ENV CYPRESS_CACHE_FOLDER=/home/node/.cache/Cypress | ||
RUN mkdir -p /home/node/.cache/Cypress && cypress install | ||
|
||
# `e2e` | ||
# e2e | ||
# | ||
# Runs Cloud Manager Cypress tests. | ||
FROM e2e-install as e2e | ||
FROM e2e-build as e2e | ||
WORKDIR /home/node/app | ||
VOLUME /home/node/app | ||
USER node | ||
ENV CI=1 | ||
ENV NO_COLOR=1 | ||
ENV HOME=/home/node/ | ||
ENV CYPRESS_CACHE_FOLDER=/home/node/.cache/Cypress | ||
|
||
# e2e-reverse-proxy | ||
# | ||
# Runs Cloud Manager Cypress tests, with Caddy installed. | ||
# Extends from `e2e`, and includes Caddy to support reverse proxying Cloud Manager. | ||
FROM e2e as e2e-reverse-proxy | ||
USER root | ||
# Install Caddy. | ||
# Instructions adapted from Caddy documentation at caddyserver.com: | ||
# https://caddyserver.com/docs/install#debian-ubuntu-raspbian | ||
RUN apt-get update \ | ||
&& apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl \ | ||
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg \ | ||
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list \ | ||
&& apt-get update \ | ||
&& apt-get install caddy | ||
VOLUME /home/node/app | ||
USER node |