Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/upgrade yarn #3791

Merged
merged 19 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
node_modules
web/build
web/coverage-cypress
web/coverage
web/.nyc_output
web/node_modules
web/cypress
web/.pnp.*
web/.yarn/*
!web/.yarn/patches
!web/.yarn/plugins
!web/.yarn/releases
!web/.yarn/sdks
!web/.yarn/versions
r
.dockerignore
**/Dockerfile*
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ jobs:
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup .nmprc for scoped artifactory packages
- name: enable corepack
run: corepack enable
- name: use new yarn
run: yarn set version berry
- name: Setup yarn for scoped artifactory packages
working-directory: ./web
run: npm config set @psu:registry https://artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/ && npm config set //artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/:_authToken ${{ secrets.ARTIFACTORY_SVCACCT_TOKEN }}
run: yarn config set npmScopes.psu.npmRegistryServer https://artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/ && yarn config set npmScopes.psu.npmAlwaysAuth true && yarn config set npmScopes.psu.npmAuthToken ${{ secrets.ARTIFACTORY_SVCACCT_TOKEN }}
- name: Install node dependencies (web)
working-directory: ./web
if: steps.yarn-cache.outputs.cache-hit != 'true'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/post_merge_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ jobs:
run: npm config set @psu:registry https://artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/ && npm config set //artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/:_authToken ${{ secrets.ARTIFACTORY_SVCACCT_TOKEN }}
- name: Install node dependencies (web)
working-directory: ./web
- name: enable corepack
run: corepack enable
- name: use new yarn
run: yarn set version berry
dgboss marked this conversation as resolved.
Show resolved Hide resolved
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Lint (web)
Expand Down
22 changes: 14 additions & 8 deletions Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# the cpu pool size to something realistic.
ARG NODE_OPTIONS="--v8-pool-size=4"

# PHASE 1 - build static html.
# PHASE 1 - build frontend.
# Pull from local registry - we can't pull from docker due to limits.
# see https://catalog.redhat.com/software/containers/ubi8/nodejs-14/5ed7887dd70cc50e69c2fabb for
jmetev1 marked this conversation as resolved.
Show resolved Hide resolved
# details
Expand All @@ -14,12 +14,18 @@ FROM registry.access.redhat.com/ubi9/nodejs-20 as static
# Switch to root user for package installs
USER 0

ADD web .
# NOTE: Can't use "--production=true", build will fail.
RUN npm install -g [email protected]
RUN npm config set @psu:registry https://artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/
RUN npm config set //artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/:_authToken ${ARTIFACTORY_SVCACCT_TOKEN}
RUN npm install -g yarn@latest && yarn install --frozen-lockfile
COPY web/package.json .
COPY web/yarn.lock .
COPY web/.yarnrc.yml .
# do install first so it will be cached
RUN npm install -g --ignore-scripts corepack
RUN corepack enable
RUN yarn set version berry
RUN yarn config set npmScopes.psu.npmRegistryServer https://artifacts.developer.gov.bc.ca/artifactory/api/npm/pe1e-psu-npm-local/
RUN yarn config set npmScopes.psu.npmAlwaysAuth true
RUN yarn config set npmScopes.psu.npmAuthToken ${ARTIFACTORY_SVCACCT_TOKEN}
RUN CYPRESS_INSTALL_BINARY=0 yarn install --immutable
dgboss marked this conversation as resolved.
Show resolved Hide resolved
COPY web .
RUN yarn run build:prod

# Remove sourcemaps after they've been uploaded to sentry
Expand All @@ -28,7 +34,7 @@ RUN rm build/static/js/**.map
# Switch back to default user
USER 1001

# # PHASE 2 - prepare hosting.
# PHASE 2 - prepare hosting.
# https://catalog.redhat.com/software/containers/ubi8/nginx-120/6156abfac739c0a4123a86fd
FROM registry.access.redhat.com/ubi8/nginx-120

Expand Down
7 changes: 7 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

# Sentry Config File
.sentryclirc
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 1 addition & 0 deletions web/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
1 change: 1 addition & 0 deletions web/craco.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
// create react app wants to run eslint itself. but since our ci is always running it anyway
eslint: {
enable: false
},
Expand Down
6 changes: 4 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"lodash": "^4.17.21",
"luxon": "^3.0.2",
"match-sorter": "^6.3.1",
"nyc": "^17.0.0",
dgboss marked this conversation as resolved.
Show resolved Hide resolved
"ol": "9.2.4",
"ol-pmtiles": "^0.5.0",
"prettier": "^3.3.3",
Expand Down Expand Up @@ -125,5 +126,6 @@
"src/serviceWorker.ts",
"src/app/store.ts"
]
}
}
},
"packageManager": "[email protected]"
}
Loading
Loading