This app install the @sigrennesmetropole/cooperation_jn_common_ui package. Although this package is public, you still need a Private Access Token (PAT) from github to download it.
In order to do that you need to follow this instructions. And create a token with package:read permission.
Then, in your personnal ~/.npmrc you need to add this line:
//npm.pkg.github.com/:_authToken=<YOUR PAT>
And then install dependencies with:
npm i --userconfig
Or, you could also change ./npmrc project file, and replace NPM_TOKEN by your PAT.
Careful! If you change the project npmrc file, you must be careful and not commit the change. The docker image in the CI is build by replacing the ${NPM_TOKEN} by the GITHUB_TOKEN of the repository. The CI will fail. Moreover if you commit your own PAT, it will be invalidated by Github.
If you want to work by changing the project .npmrc, the easiest way is probably to ignore it in your git index before changing it:
git update-index --skip-worktree .npmrc
The @sigrennesmetropole/cooperation_jn_common_ui package is frequently patch. Try to keep it up-to-date.
npm i
npm start
npm run story
docker build -t cooperation_jn_trambus:latest --build-arg NPM_TOKEN=<YOUR_GITHUB_NPM_TOKEN> .
Create .env.docker
from .env.docker.example
to put the environment variables.
docker run -p 8080:80 cooperation_jn_trambus:latest
or the following command if you want to use port 5173, with cj_trambus
as the container name, and delete the container directly after stopped.
docker run -p 5173:80 --env-file ./.env.docker --name cj_trambus --rm cooperation_jn_trambus:latest
Through Github pipeline, an image is created on every push on 'main' branch, and on each pull request. The repository for this image can be found here: https://github.com/sigrennesmetropole/cooperation_jn_trambus/pkgs/container/cooperation_jn_trambus/versions
- An image is created, it is tag with 'pr-#' where # is the id of the pull request.
- An image is created, it is tag with the short hash of the last commit on main branch.
The repository which contains configuration of the argocd of the app is here: https://github.com/camptocamp/argocd-gs-rennes3d-apps
It is accessible through https://argocd.apps.green.gs-fr-prod.camptocamp.com/ with RedHat c2c account.
The argocd argocd and this project must be set up, a private/public key must be generated (ie with openssl).
- This project must have the right to push on the argocd one. The private key must be store in the secret ARGOCD_PRIVATE_KEY for the pipeline to work.
- argocd Must register the public key as "deployment key" in the github configuration.
To deploy a new or a different image on the server, you must change the tag of the target image in the configuration of this argocd project. There are currently three ways of doing it:
- Manually: change the value in 'apps/dev/vcmap-demo/values.yaml' in the repo, and commit/push the change ;
- On demand: With this pipeline. Choose the env (currently only dev) and the tag of the image, and let the pipeline change the argocd project ;
- Automatically: On each merge on main, the pipeline is triggered with the last generated image.
On: https://argocd.apps.green.gs-fr-prod.camptocamp.com/applications/rennes3d-dev-vcmap-demo
The app must be "OutOfSync" because a new image has been set on the values.yaml file but not deploy yet. Click on sync and wait for the app to be avalaible.
npm run build
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Cypress
npm run build
npm run test:e2e # or `npm run test:e2e:ci` for headless testing
Lint with ESLint
npm run lint:js
npm run format
npm run story