-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Giveth/staging
Release: Gitcoin Support
- Loading branch information
Showing
31 changed files
with
8,498 additions
and
15,559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
module.exports ={ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2021 | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2021, | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"no-prototype-builtins":"warn", | ||
"no-unused-vars": "warn", | ||
"@typescript-eslint/no-unused-vars":"warn", | ||
"@typescript-eslint/consistent-type-definitions":"off", | ||
"@typescript-eslint/no-var-requires":"warn" | ||
} | ||
} | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
rules: { | ||
'no-prototype-builtins': 'warn', | ||
'no-unused-vars': 'warn', | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/no-var-requires': 'warn', | ||
'prettier/prettier': ['error', { singleQuote: true }], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ jobs: | |
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
- 5444:5432 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js | ||
|
@@ -45,8 +45,9 @@ jobs: | |
run: npm run db:migrate:run:test | ||
- name: Run tests | ||
run: npm run test | ||
|
||
|
||
env: | ||
GITCOIN_API_KEY: ${{ secrets.GITCOIN_API_KEY }} | ||
GITCOIN_COMMUNITY_ID: ${{ secrets.GITCOIN_COMMUNITY_ID }} | ||
|
||
publish: | ||
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging' | ||
|
@@ -74,15 +75,23 @@ jobs: | |
needs: publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Develop deploy | ||
if: github.ref == 'refs/heads/develop' | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
command: cd SiweAuthMicroservice && git checkout develop && git pull && docker-compose -f docker-compose-develop.yml pull && docker-compose -f docker-compose-develop.yml down && docker-compose -f docker-compose-develop.yml up -d && docker image prune -a --force; | ||
host: ${{ secrets.DEVELOP_HOST }} | ||
username: ${{ secrets.DEVELOP_USERNAME }} | ||
privateKey: ${{ secrets.DEVELOP_PRIVATE_KEY}} | ||
|
||
- name: Staging deploy | ||
if: github.ref == 'refs/heads/staging' | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
command: cd SiweAuthMicroservice && git checkout staging && git pull && docker-compose -f docker-compose-staging.yml pull && docker-compose -f docker-compose-staging.yml down && docker-compose -f docker-compose-staging.yml up -d && docker image prune -a --force; | ||
command: cd SiweAuthMicroservice && git checkout staging && git fetch && git reset --hard origin/staging && docker-compose -f docker-compose-staging.yml pull && docker-compose -f docker-compose-staging.yml down && docker-compose -f docker-compose-staging.yml up -d && docker image prune -a --force; | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
privateKey: ${{ secrets.STAGING_PRIVATE_KEY}} | ||
|
||
- name: Production deploy | ||
if: github.ref == 'refs/heads/main' | ||
uses: garygrossgarten/[email protected] | ||
|
@@ -91,4 +100,3 @@ jobs: | |
host: ${{ secrets.PRODUCTION_HOST }} | ||
username: ${{ secrets.PRODUCTION_USERNAME }} | ||
privateKey: ${{ secrets.PRODUCTION_PRIVATE_KEY}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extension": ["ts"], | ||
"timeout": 30000, | ||
"exit": true, | ||
"require": ["ts-node/register", "tsconfig-paths/register"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
PORT=3000 | ||
|
||
TYPEORM_DATABASE_NAME=siwe_microservice | ||
TYPEORM_DATABASE_NAME=microservices | ||
TYPEORM_DATABASE_USER=postgres | ||
TYPEORM_DATABASE_PASSWORD=postgres | ||
TYPEORM_DATABASE_HOST=127.0.0.1 | ||
TYPEORM_DATABASE_PORT=5443 | ||
|
||
JWT_SECRET=fdksjalkfhjio472389roiewfhskjahfjka | ||
ACCESS_TOKEN_LIFETIME_HOURS=2 | ||
ACCESS_TOKEN_LIFETIME_HOURS=2000 | ||
|
||
BCRYPT_SALT=$2b$10$MSIRw14eVDzxdztX3AZYlu | ||
PRIVATE_ETHERS_TEST_KEY=8ab0e165c2ea461b01cdd49aec882d179dccdbdb5c85c3f9c94c448aa65c5ace | ||
PUBLIC_ETHERS_TEST_KEY=0x53bFf74b9Af2E3853f758A8D2Bd61CD115d27782 | ||
|
||
HOSTNAME_WHITELIST=localhost, loca.lt | ||
|
||
NONCE_LIFE_MINUTES=5 | ||
|
||
# The following are used for the sending logs to elasticsearch | ||
ENABLE_ELASTICSEARCH_LOG= | ||
ELASTICSEARCH_HOST= | ||
ELATICSEARCH_AUTH= | ||
|
||
# Following are for GitCoin Passport | ||
GITCOIN_API_KEY=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | ||
GITCOIN_COMMUNITY_ID=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: '3.3' | ||
|
||
services: | ||
siwe-microservice: | ||
#see https://github.com/docker/build-push-action/tree/releases/v1#tag_with_ref | ||
|
||
# is sometime you want to rollback you can change the tag manually in server( not commit to git) | ||
# from master to your desired commit hash and the run command: | ||
# 1. docker-compose -f docker-compose-develop.yml pull | ||
# 2. docker-compose -f docker-compose-develop.yml down | ||
# 3. docker-compose -f docker-compose-develop.yml up -d | ||
image: ghcr.io/giveth/siweauthmicroservice:develop | ||
restart: always | ||
command: npm run start:server:develop | ||
environment: | ||
- NODE_ENV=develop | ||
volumes: | ||
# You should have a develop.env file in the config folder | ||
- type: bind | ||
source: ./config | ||
target: /usr/src/app/dist/config | ||
- type: bind | ||
source: ./config | ||
target: /usr/src/app/config | ||
- type: bind | ||
source: ./logs | ||
target: /usr/src/app/dist/logs | ||
ports: | ||
- "3000:3000" | ||
|
||
|
||
|
||
redis-siwe-microservice: | ||
# it's better to not using latest tag, maybe latest tag have some breaking changes | ||
image: bitnami/redis:5.0.9-debian-10-r142 | ||
container_name: redis-siwe-microservice | ||
environment: | ||
- ALLOW_EMPTY_PASSWORD=yes | ||
restart: always | ||
volumes: | ||
- redis-siwe-microservice-data:/bitnami/redis/data | ||
|
||
volumes: | ||
redis-siwe-microservice-data: |
Oops, something went wrong.