- Install Docker
- Clone the repo: https://github.com/greenriver/aqueduct-water-risk
- Copy .env.sample to .env
- Get values for the env variables from another developer
- Run
docker-compose up
to build your image and fire up the container. Visit localhost:3030. Ctrl-C to stop.
- Clean out old builds with
rm -f dist/*
- Run
docker-compose run web yarn build
to compile. - Copy the contents of the
build
directory to thewriorg
repo.- Make sure you are on the
aqueductgr2
branch of thewriorg
repo. - Copy the build to the
wriorg/applications/aqueduct/water-risk-atlas
directory.
- Make sure you are on the
- From the
wriorg
repo, commit and push changes to theaqueductgr2
branch. Enter your Pantheon password when/if prompted.- In your commit message, include the app name and the hash for the commit from that app's repo that you are deploying, for example:
Update aqueduct-water-risk to commit 8df15603a5d939995b03ade0429f90434a19e6ca
- The app is deployed on push to https://aqueductgr2-wriorg.pantheonsite.io/applications/aqueduct/water-risk-atlas/
- In your commit message, include the app name and the hash for the commit from that app's repo that you are deploying, for example:
- Create all new branches by branching off
develop
. - Open pull requests against
develop
as well. - Merge branches into
develop
when they are ready to be deployed for testing. - When a change is ready to be deployed to the production website, merge
develop
intomain
.
This repository makes use of a number of components from the aqueduct-components NPM package, which may also need to be modified at times to fulfill requested changes in this repo. Therefore it's sometimes necessary to develop in both aqueduct-components and this repo at the same time.
This section will detail one method to do this using yalc. Yalc is the preferred solution here due to the use of Docker in development, and this repo includes the setup required to use yalc. Other methods such as yarn link
are possible alternatives, but may require a different setup than what is provided.
- Install yalc as described in its repo. You only need to install it locally. It will be automatically installed in the Docker container.
- Clone the aqueduct-components repository to your development environment.
- Determine which branch you should use in aqueduct-components. If your app uses
aqueduct-components^1.0.0
, then you want to branch frommain
. If it uses0.3.*
, you want to branch fromlegacy
. You can verify the current main/legacy versions by checking the "## Versions" tab in the NPM package - You'll need to add a folder to share the yalc registry with the docker container. This app uses
~/docker/volumes/yalc
, so domkdir -p ~/docker/volumes/yalc
. - Once you're on the right branch for aqueduct-components and have your yalc folder ready,
cd
into the aqueduct-components folder and doyalc publish --store-folder ~/docker/volumes/yalc
. This will publish your local aqueduct-components code to yalc's local registry. cd
to this app's repository and rundocker-compose run shell
to get a shell within the development Docker container. Once you're there, runyalc link --store-folder /yalc aqueduct-components
, which will linknode_modules/aqueduct-components
to the version in yalc's registry.exit
out of the shell and rundocker-compose up web
to build and run the app and ensure that this works as normal.
You will have to re-publish aqueduct-components with yalc every time that you make changes to it. Follow these steps to re-publish and update the version in the development container:
cd
to the aqueduct-components directory (if not there already) and runyalc publish --store-folder ~/docker/volumes/yalc
to publish the updated version to the yalc registrycd
to the app directory and rundocker-compose run shell
to get a shell inside the container- Run
yalc update --store-folder /yalc
to update to the version to the one in the yalc registry
Once you've finished making whatever changes you need to aqueduct-components, make a PR at aqueduct-components. You will also need to make a PR in the app repository if any changes were required for the application code. Follow the recommended contribution process for the app, but make sure to indicate that the changes rely on changes in aqueduct-components as well.
- Aqueduct Water Risk Atlas - https://github.com/greenriver/aqueduct-water-risk
- Aqueduct Country Rankings - https://github.com/greenriver/aqueduct-countries-ranking
- Aqueduct Food - https://github.com/greenriver/aqueduct-food
- Aqueduct Floods - https://github.com/greenriver/aqueduct-flood
- Aqueduct Components - https://github.com/greenriver/aqueduct-components
cp -a dist/. ../wriflagship/web/applications/aqueduct/water-risk-atlas/