Skip to content

Commit

Permalink
Publish changes to prod (#566)
Browse files Browse the repository at this point in the history
* avoid statefulsets update errors on actions runs refs #535. (#536)

* deprecate demux service. refs #538 (#540)

* add handler url from env var & other minor bug fixes (#542)

* Add missing env var to config map (#543)

* add handler url from env var & other minor bug fixes

* add missing env var

* fix: update some env vars

* fix: update some env vars

* fix: replace .env values with the previous ones

* Feat/add tx link (#545)

* feat: add tx link

* feat: remove secrets

* setup env workflow (#546)

* wip

* wip: add env files & db_data to .gitignore

* fix: remove .env files

* fix: remove .env files

* fix: delete unnecessary code

* refactor: remove unnecessary code

* fix: minimal

* Fix/rate action buttons not showing (#547)

* wip

* wip: add env files & db_data to .gitignore

* fix: remove .env files

* fix: remove .env files

* fix: delete unnecessary code

* refactor: remove unnecessary code

* fix: minimal

* fix: rate buttons not showing in certains densities

* Fix/hasura console config (#556)

* Deploy to mainnet (#544)

* avoid statefulsets update errors on actions runs refs #535. (#536)

* deprecate demux service. refs #538 (#540)

* add handler url from env var & other minor bug fixes (#542)

* Add missing env var to config map (#543)

* add handler url from env var & other minor bug fixes

* add missing env var

* fix: update some env vars

* fix: update some env vars

* fix: replace .env values with the previous ones

Co-authored-by: Andres Gomez <[email protected]>
Co-authored-by: JustinCast <[email protected]>

* wip

* wip: add env files & db_data to .gitignore

* fix: remove .env files

* fix: remove .env files

* fix: delete unnecessary code

* refactor: remove unnecessary code

* fix: minimal

* feat: voting tool revamp

* fix: remove comments

* fix: add i18n entries

* fix: bug fixes

* fix: hasura console config

Co-authored-by: Xavier <[email protected]>
Co-authored-by: Andres Gomez <[email protected]>

* Fix/add missing i18n entries (#554)

* Deploy to mainnet (#544)

* avoid statefulsets update errors on actions runs refs #535. (#536)

* deprecate demux service. refs #538 (#540)

* add handler url from env var & other minor bug fixes (#542)

* Add missing env var to config map (#543)

* add handler url from env var & other minor bug fixes

* add missing env var

* fix: update some env vars

* fix: update some env vars

* fix: replace .env values with the previous ones

Co-authored-by: Andres Gomez <[email protected]>
Co-authored-by: JustinCast <[email protected]>

* wip

* wip: add env files & db_data to .gitignore

* fix: remove .env files

* fix: remove .env files

* fix: delete unnecessary code

* refactor: remove unnecessary code

* fix: minimal

* feat: voting tool revamp

* fix: remove comments

* fix: add i18n entries

* fix: bug fixes

Co-authored-by: Xavier <[email protected]>
Co-authored-by: Andres Gomez <[email protected]>

* docs: add env example (#565)

* fix: not able to sync proxies locally (#564)

* fix: update hasura version

* fix: hasura version && other minor bug fixes

* Fix/update hasura version (#567)

* fix: remove build:staging statement

* latest changes

Co-authored-by: Andres Gomez <[email protected]>
Co-authored-by: JustinCast <[email protected]>
  • Loading branch information
3 people authored May 13, 2021
1 parent 5033347 commit 062a6fd
Show file tree
Hide file tree
Showing 130 changed files with 662 additions and 1,386 deletions.
27 changes: 27 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# POSTGRES
DB_USER=userhere
DB_PASSWORD=passhere
DB_NAME=dbnamehere
DB_PORT=dbporthere
POSTGRES_DATA=./db_data

# HAPI
VIRTUAL_HOST=virtualhosthere
VIRTUAL_PORT=virtualporthere
EOS_API_ENDPOINT=https://jungle.eosio.cr
PROXY_INFO_CONTRACT_CODE=proxyaccount
PROXY_INFO_CONTRACT_SCOPE=proxyaccount

# HASURA
HASURA_GRAPHQL_DATABASE_URL=dburlhere
HASURA_GRAPHQL_ADMIN_SECRET=hasurasecrethere
HASURA_GRAPHQL_UNAUTHORIZED_ROLE=rolehere

# WEBAPP
REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8080/v1/graphql
REACT_APP_GRAPHQL_WS_URL=ws://localhost:8080/v1/graphql
REACT_APP_EOS_API_URL=https://jungle.eosio.cr
REACT_APP_EOS_API_HOST=jungle.eosio.cr
REACT_APP_EOS_API_PORT=443
REACT_APP_EOS_API_PROTOCOL=https
REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
2 changes: 1 addition & 1 deletion .github/workflows/push-master-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
DB_SCHEMA: ${{ secrets.DB_SCHEMA }}
EOS_API_ENDPOINT: https://bp.cryptolions.io
VIRTUAL_HOST: 0.0.0.0
VIRTUAL_PORT: "9090"
VIRTUAL_PORT: 9090
# hasura
HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }}
HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push-staging-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
DB_SCHEMA: ${{ secrets.DB_SCHEMA }}
EOS_API_ENDPOINT: https://jungle3.cryptolions.io
VIRTUAL_HOST: 0.0.0.0
VIRTUAL_PORT: "9090"
VIRTUAL_PORT: 9090
# hasura
HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }}
HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations
Expand All @@ -88,4 +88,4 @@ jobs:
NAMESPACE: jungle-eosrate
K8S_BUILD_DIR: build_k8s
with:
args: version && make deploy-kubernetes
args: version && make deploy-kubernetes
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Compiled codes
build/
dist/
*.wast

# IDE's
.vscode
.idea
*.iml
Expand All @@ -23,16 +18,20 @@ temp
.eslintcache

# database data
.dbdata/
db_data

# wallet keys
keys

# env files
.env*
!.env.example

# netlify cli
.netlify/


__docs

build_k8s/
ssl/
ssl/
29 changes: 15 additions & 14 deletions docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ services:
ports:
- "3005:9090"
environment:
VIRTUAL_HOST: 0.0.0.0
VIRTUAL_PORT: 9090
DB_USER: user
DB_PASSWORD: pass
DB_PORT: 5432
DB_NAME: eosrate
VIRTUAL_HOST: "${VIRTUAL_HOST}"
VIRTUAL_PORT: "${VIRTUAL_PORT}"
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
DB_PORT: "${DB_PORT}"
DB_NAME: "${DB_NAME}"
DB_HOST: postgres
DB_SCHEMA: public
EOS_API_ENDPOINT: "https://jungle.eosio.cr"
EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}"

depends_on:
- postgres
Expand All @@ -64,14 +64,14 @@ services:
- postgres
- hasura
environment:
DB_USER: user
DB_PASSWORD: pass
DB_PORT: 5432
DB_NAME: eosrate
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
DB_PORT: "${DB_PORT}"
DB_NAME: "${DB_NAME}"
DB_HOST: postgres
DB_SCHEMA: public
EOS_API_ENDPOINT: "https://jungle.eosio.cr"
WAIT_HOSTS: postgres:5432, hasura:8080
EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}"
WAIT_HOSTS: postgres:"${DB_PORT}" , hasura:8080
WAIT_HOSTS_TIMEOUT: 60
ports:
- "3030:3030"
Expand All @@ -80,7 +80,7 @@ services:

hasura:
container_name: eosrate_hasura
image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations
image: hasura/graphql-engine:v1.3.3.cli-migrations-v2
ports:
- "8088:8080"
depends_on:
Expand All @@ -94,6 +94,7 @@ services:
HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090
volumes:
- ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder
- ./services/hasura/migrations:/hasura-metadata
command:
- graphql-engine
- serve
Expand Down
58 changes: 30 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
container_name: eosrate_postgres
image: postgres:10.4
volumes:
- eosrate-postgres:/var/lib/postgresql/data
- ${POSTGRES_DATA}:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
Expand Down Expand Up @@ -36,17 +36,17 @@ services:
- ./services/hapi:/opt/application
- /opt/application/node_modules # prevents host/container conflicts
ports:
- "3005:9090"
- "9090:9090"
environment:
VIRTUAL_HOST: 0.0.0.0
VIRTUAL_PORT: 9090
DB_USER: user
DB_PASSWORD: pass
DB_PORT: 5432
DB_NAME: eosrate
VIRTUAL_HOST: "${VIRTUAL_HOST}"
VIRTUAL_PORT: "${VIRTUAL_PORT}"
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
DB_PORT: "${DB_PORT}"
DB_NAME: "${DB_NAME}"
DB_HOST: postgres
DB_SCHEMA: public
EOS_API_ENDPOINT: "https://jungle.eosio.cr"
EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}"

depends_on:
- postgres
Expand All @@ -64,14 +64,14 @@ services:
- postgres
- hasura
environment:
DB_USER: user
DB_PASSWORD: pass
DB_PORT: 5432
DB_NAME: eosrate
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
DB_PORT: "${DB_PORT}"
DB_NAME: "${DB_NAME}"
DB_HOST: postgres
DB_SCHEMA: public
EOS_API_ENDPOINT: "https://jungle.eosio.cr"
WAIT_HOSTS: postgres:5432, hasura:8080
EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}"
WAIT_HOSTS: postgres:"${DB_PORT}", hasura:8080
WAIT_HOSTS_TIMEOUT: 60
ports:
- "3030:3030"
Expand All @@ -83,23 +83,22 @@ services:
build:
context: ./services/hasura
dockerfile: ./Dockerfile
image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations
image: hasura/graphql-engine:v1.3.3.cli-migrations-v2
ports:
- "8088:8080"
- "8080:8080"
depends_on:
- postgres
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://user:pass@postgres:5432/eosrate?sslmode=disable
HASURA_GRAPHQL_DATABASE_URL: "${HASURA_GRAPHQL_DATABASE_URL}"
HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations
HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090
HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "${HASURA_GRAPHQL_UNAUTHORIZED_ROLE}"

volumes:
- ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder
command:
- graphql-engine
- serve
- --enable-console
- ./services/hasura/migrations:/hasura-metadata

frontend:
container_name: eosrate_frontend
Expand All @@ -113,11 +112,14 @@ services:
- hapi
ports:
- "80:80"
environment:
REACT_APP_GRAPHQL_HTTP_URL: "${REACT_APP_GRAPHQL_HTTP_URL}"
REACT_APP_GRAPHQL_WS_URL: "${REACT_APP_GRAPHQL_WS_URL}"
REACT_APP_EOS_API_URL: "${REACT_APP_EOS_API_URL}"
REACT_APP_EOS_API_HOST: "${REACT_APP_EOS_API_HOST}"
REACT_APP_EOS_API_PORT: "${REACT_APP_EOS_API_PORT}"
REACT_APP_EOS_API_PROTOCOL: "${REACT_APP_EOS_API_PROTOCOL}"
REACT_APP_EOS_CHAIN_ID: "${REACT_APP_EOS_CHAIN_ID}"
REACT_APP_BLOCK_EXPLORER: "${REACT_APP_BLOCK_EXPLORER}"
networks:
default:

volumes:
eosrate-postgres:

networks:
default:
67 changes: 55 additions & 12 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,68 @@
include utils/meta.mk

#COLORS
WHITE := $(shell tput -Txterm setaf 7)
BLUE := $(shell tput -Txterm setaf 6)
YELLOW := $(shell tput -Txterm setaf 3)
GREEN := $(shell tput -Txterm setaf 2)
RESET := $(shell tput -Txterm sgr0)

K8S_BUILD_DIR ?= ./build_k8s
K8S_FILES := $(shell find ./kubernetes -name '*.yaml' | sed 's:./kubernetes/::g')

dev: scripts/develop.sh
./scripts/develop.sh
stop:
@docker-compose stop

start: scripts/start.sh
./scripts/start.sh
## MAKE SURE YOU HAVE INITIALIZED THE PROJECT (make start) BEFORE RUN THIS
fresh: scripts/fresh.sh
./scripts/fresh.sh

stop: scripts/stop.sh
./scripts/stop.sh
start:
make -B start-postgres
make -B start-hapi
make -B start-hasura
make -B -j 3 start-hasura-cli start-logs start-frontend

flush: scripts/flush.sh
./scripts/flush.sh
start-postgres:
@docker-compose up -d --build postgres

fresh: scripts/fresh.sh
./scripts/fresh.sh
start-hapi:
@docker-compose up -d --build hapi

start-hasura:
$(eval -include .env)
@until \
docker-compose exec -T postgres pg_isready; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) waiting for postgres service"; \
sleep 5; done;
@until \
curl http://localhost:9090; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) waiting for hapi service"; \
sleep 5; done;
@echo "..."
@docker-compose stop hasura
@docker-compose up -d --build hasura

start-hasura-cli:
$(eval -include .env)
@until \
curl http://localhost:8080; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) ..."; \
sleep 5; done;
@echo "..."
@cd services/hasura && hasura console --endpoint http://localhost:8080 --skip-update-check;

start-frontend:
$(eval -include .env)
@until \
curl -s -o /dev/null -w 'hasura status %{http_code}\n' http://localhost:8080; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-frontend |$(RESET) waiting for hasura service"; \
sleep 5; done;
@cd services/frontend && yarn && yarn start | cat
@echo "done frontend start"

hasura: scripts/hasura.sh
./scripts/hasura.sh
start-logs:
@docker-compose logs -f hapi frontend

migrate: scripts/migrate.sh
./scripts/migrate.sh
Expand Down
13 changes: 0 additions & 13 deletions scripts/develop.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/flush.sh

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/fresh.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
echo "Seeding Database and Syncing with Blockchain Tables"
cd ../services/hapi/src/libs/
cd services/hapi/src/libs/
pwd
node sync-bps.js
node sync-proxies.js
node sync-ratings.js
Expand Down
4 changes: 0 additions & 4 deletions scripts/hasura.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/start.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/stop.sh

This file was deleted.

8 changes: 0 additions & 8 deletions services/frontend/.env.production

This file was deleted.

Loading

0 comments on commit 062a6fd

Please sign in to comment.