Skip to content

Commit

Permalink
Task/upgrade yarn (#3791)
Browse files Browse the repository at this point in the history
Co-authored-by: dgboss <[email protected]>
  • Loading branch information
jmetev1 and dgboss authored Jul 22, 2024
1 parent 5a1775d commit eef2619
Show file tree
Hide file tree
Showing 9 changed files with 17,786 additions and 12,622 deletions.
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
10 changes: 7 additions & 3 deletions .github/workflows/post_merge_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,15 @@ jobs:
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup .nmprc 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 }}
- name: Install node dependencies (web)
working-directory: ./web
- 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: 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 }}
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Lint (web)
Expand Down
24 changes: 15 additions & 9 deletions Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@
# 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
# see https://catalog.redhat.com/software/containers/ubi9/nodejs-20/64770ac7a835530172eee6a9 for
# details
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
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",
"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

0 comments on commit eef2619

Please sign in to comment.