Skip to content

Commit

Permalink
Merge pull request #471 from pacificclimate/deprecate-process-env
Browse files Browse the repository at this point in the history
Deprecate use of process.env for runtime config
  • Loading branch information
Nospamas authored Jan 14, 2025
2 parents 0079586 + 05a7c39 commit cd6380c
Show file tree
Hide file tree
Showing 31 changed files with 212 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"ghcr.io/devcontainers/features/node:1": {
"version": "22"
},
"ghcr.io/devcontainers/features/docker-in-docker:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2.12.0": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.8.10"
}
Expand Down
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git
build
node_modules
.idea

**/*.env*
8 changes: 1 addition & 7 deletions .env
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
REACT_APP_TILECACHE_URL=https://services.pacificclimate.org/mapproxy/service
REACT_APP_NCWMS_URL=https://beehive.pacificclimate.org/ncwms
REACT_APP_CE_ENSEMBLE_NAME=ce_files
REACT_APP_MAP_LAYER_ID_TYPE=dynamic
REACT_APP_MAP_LAYER_ID_PREFIX=x
REACT_APP_VARIABLE_OPTIONS=variable-options.yaml
REACT_APP_EXTERNAL_TEXT=external-text/default.yaml
PUBLIC_URL=%REPLACE_PUBLIC_URL%
3 changes: 1 addition & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
REACT_APP_CE_BACKEND_URL=https://beehive.pacificclimate.org/pcex/api
REACT_APP_CE_BASE_PATH=
PUBLIC_URL=http://localhost:3001
3 changes: 1 addition & 2 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
REACT_APP_CE_BACKEND_URL=https://services.pacificclimate.org/pcex/api
REACT_APP_CE_BASE_PATH=/pcex/app
PUBLIC_URL=%REPLACE_PUBLIC_URL%
11 changes: 8 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Export REACT_APP_CE_CURRENT_VERSION env var
- name: Export REACT_APP_APP_VERSION env var
run: |
git fetch --prune --unshallow
echo "REACT_APP_CE_CURRENT_VERSION=$(git describe --tags --abbrev=0) ($(git rev-parse --abbrev-ref HEAD):$(git log -1 --format=%h))" >> $GITHUB_ENV
echo "REACT_APP_APP_VERSION=$(git describe --tags --abbrev=0) ($(git rev-parse --abbrev-ref HEAD):$(git log -1 --format=%h))" >> $GITHUB_ENV
- name: Build npm package
run: |
npm ci
npm run build
- name: Publish to Registry
uses: docker/build-push-action@v1
with:
username: ${{ secrets.pcicdevops_at_dockerhub_username }}
password: ${{ secrets.pcicdevops_at_dockerhub_password }}
dockerfile: docker/Dockerfile
repository: pcic/climate-explorer-frontend
tag_with_ref: true
build_args: REACT_APP_CE_CURRENT_VERSION=${{ env.REACT_APP_CE_CURRENT_VERSION }}
build_args: REACT_APP_APP_VERSION=${{ env.REACT_APP_APP_VERSION }}
31 changes: 0 additions & 31 deletions Dockerfile

This file was deleted.

16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# These variables are set to make it convenient to run the docker image locally.
tag = $(shell git rev-parse --abbrev-ref HEAD)
port = 30504
public_url = http://localhost:${port}

image:
@npm run build
@PCEX_TAG=$(tag) PCEX_PORT=$(port) docker compose -f docker/docker-compose.yaml build

up:
@PCEX_TAG=$(tag) PCEX_PORT=$(port) docker compose -f docker/docker-compose.yaml up --force-recreate
@echo "Station Data Portal running on $(port)"
@docker logs -f station-data-portal-frontend

down:
@PCEX_TAG=$(tag) PCEX_PORT=$(port) docker compose -f docker/docker-compose.yaml down
Loading

0 comments on commit cd6380c

Please sign in to comment.