Skip to content

Commit

Permalink
Merge pull request #510 from eoscostarica/feature/create-specific-ima…
Browse files Browse the repository at this point in the history
…ge-version

Compile different frontend for every different nework
  • Loading branch information
xavier506 authored May 20, 2021
2 parents 5bd69e6 + f39c138 commit ffeecba
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/push-dev-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
NAMESPACE: jungle-dashboard
INGRESS_HOST: testnet.eosio.cr
INGRESS_GRAPHQL_HOST: graphql-testnet.eosio.cr
# webapp
REACT_APP_EOS_API_NETWORK_NAME: jungle
# postgres
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/push-lacchain-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# General
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
# Webapp
# webapp
PORT: '80'
REACT_APP_TITLE: 'LACChain Network Dashboard'
REACT_APP_DEFAULT_PRODUCER_LOGO: 'https://latamlink.io/images/latamlink_logo-header.svg'
Expand Down Expand Up @@ -71,6 +71,8 @@ jobs:
NAMESPACE: lacchain-dashboard
INGRESS_HOST: dashboard.latamlink.io
INGRESS_GRAPHQL_HOST: dashboard-graphql.latamlink.io
# webapp
REACT_APP_EOS_API_NETWORK_NAME: 'lacchain'
# postgres
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/push-mainnet-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
# Webapp
# webapp

PORT: '80'
REACT_APP_TITLE: 'EOS Mainnet Network Dashboard'
Expand All @@ -50,6 +50,7 @@ jobs:
REACT_APP_EOS_BP_JSON_ON_CHAIN_CONTRACT: ${{ secrets.REACT_APP_EOS_BP_JSON_ON_CHAIN_CONTRACT }}
REACT_APP_EOS_BP_JSON_ON_CHAIN_TABLE: ${{ secrets.REACT_APP_EOS_BP_JSON_ON_CHAIN_TABLE }}
REACT_APP_EOS_BP_JSON_ON_CHAIN_SCOPE: ${{ secrets.REACT_APP_EOS_BP_JSON_ON_CHAIN_SCOPE }}
REACT_APP_EOS_API_NETWORK_NAME: 'mainnet'
REACT_APP_EOS_API_NETWORK_LABEL: 'Mainnet'
REACT_APP_EOS_API_NETWORK_LOGO: 'https://bloks.io/img/eosio.png'
REACT_APP_TOKEN_SYMBOL: ${{ secrets.REACT_APP_TOKEN_SYMBOL }}
Expand All @@ -67,6 +68,8 @@ jobs:
NAMESPACE: mainnet-dashboard
INGRESS_HOST: mainnet.eosio.cr
INGRESS_GRAPHQL_HOST: graphql-mainnet.eosio.cr
# webapp
REACT_APP_EOS_API_NETWORK_NAME: 'mainnet'
# postgres
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/push-telos-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
NAMESPACE: telos-testnet-dashboard
INGRESS_HOST: telos.testnet.dashboard.eosio.cr
INGRESS_GRAPHQL_HOST: graphql-telos.dashboard.eosio.cr
# webapp
REACT_APP_EOS_API_NETWORK_NAME: telos
# postgres
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/webapp-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
imagePullSecrets:
- name: regcred
containers:
- image: ${DOCKER_REGISTRY}/${IMAGE_NAME_WEBAPP}:${VERSION}
- image: ${DOCKER_REGISTRY}/${IMAGE_NAME_WEBAPP}:${VERSION}-${REACT_APP_EOS_API_NETWORK_NAME}
imagePullPolicy: "Always"
name: dashboard-webapp
envFrom:
Expand Down
1 change: 0 additions & 1 deletion utils/meta.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-include .env

VERSION ?= $(shell git rev-parse --short HEAD)
CURRENT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)

IMAGE_NAME_WEBAPP=dashboard-webapp
IMAGE_NAME_HAPI=dashboard-hapi
Expand Down
6 changes: 3 additions & 3 deletions webapp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build-docker: ./Dockerfile
echo "Building containers..."
@docker pull $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) || true
@docker build \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION) --target run-stage \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION)-$(REACT_APP_EOS_API_NETWORK_NAME) --target run-stage \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) --target run-stage \
--build-arg port="$(PORT)" \
--build-arg react_app_title="$(REACT_APP_TITLE)" \
Expand Down Expand Up @@ -64,10 +64,10 @@ build-docker-cached: ./Dockerfile
@docker build \
--target prod-stage \
--cache-from $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION)-$(REACT_APP_EOS_API_NETWORK_NAME) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) \
.

push-image: ##@devops Push the freshly built image and tag with release or latest tag
push-image:
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION)
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION)-$(REACT_APP_EOS_API_NETWORK_NAME)

0 comments on commit ffeecba

Please sign in to comment.