-
Notifications
You must be signed in to change notification settings - Fork 0
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 #5 from decentraland/feat/first-endpoints
feat: introduce the logic to list/promote/stop squids
- Loading branch information
Showing
31 changed files
with
16,872 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CORS_ORIGIN=^http:\/\/localhost:[0-9]{1,10}$ | ||
CORS_METHODS=* | ||
|
||
HTTP_SERVER_PORT=5001 | ||
HTTP_SERVER_HOST=0.0.0.0 | ||
AWS_CLUSTER_NAME= | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
DAPPS_PG_COMPONENT_PSQL_CONNECTION_STRING= |
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,34 @@ | ||
{ | ||
"extends": ["@dcl/eslint-config/dapps"], | ||
"parserOptions": { | ||
"project": ["tsconfig.json", "test/tsconfig.json"] | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-non-null-assertion": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"rules": { | ||
"import/no-unresolved": [ | ||
"error", | ||
{ | ||
"ignore": ["^@covalenthq/client-sdk"] | ||
} | ||
], | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ "selector": "enumMember", "format": ["UPPER_CASE"] }, | ||
{ | ||
"selector": "objectLiteralProperty", | ||
"format": ["snake_case", "camelCase", "UPPER_CASE"], | ||
"filter": { | ||
"regex": "^.+-.+$", | ||
"match": false | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
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,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
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,35 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
deployment-environment: | ||
required: true | ||
type: choice | ||
options: | ||
- dev | ||
- stg | ||
- prd | ||
default: prd | ||
description: Environment | ||
tag: | ||
required: true | ||
default: "latest" | ||
type: string | ||
description: "Docker tag (quay.io)" | ||
|
||
jobs: | ||
deployment: | ||
if: ${{ inputs.deployment-environment }} | ||
name: "Deploy to: ${{ inputs.deployment-environment }}" | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.deployment-environment }} | ||
steps: | ||
- name: Trigger deployment | ||
id: deploy | ||
uses: decentraland/dcl-deploy-action@main | ||
with: | ||
dockerImage: "quay.io/decentraland/squid-management-server:${{ inputs.tag }}" | ||
serviceName: "squid-management-server" | ||
env: ${{ inputs.deployment-environment }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,16 @@ | ||
name: CI/CD on main branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
cd: | ||
uses: decentraland/actions/.github/workflows/build-quay-main.yml@main | ||
with: | ||
service-name: squid-management-server | ||
deployment-environment: dev stg | ||
secrets: | ||
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} | ||
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} |
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,27 @@ | ||
name: node | ||
|
||
on: push | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: npm | ||
- name: install | ||
run: npm install | ||
- name: build | ||
run: npm run build | ||
- name: linter | ||
run: npm run lint | ||
if: ${{ always() }} | ||
- name: test | ||
run: npm run test | ||
- name: Report coverage | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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,15 @@ | ||
name: Build and publish | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
build: | ||
name: "Build & publish: ${{github.ref_name}}" | ||
uses: decentraland/actions/.github/workflows/build-quay-main.yml@main | ||
with: | ||
service-name: squid-management-server | ||
docker-tag: "${{ github.ref_name }}" | ||
secrets: | ||
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} | ||
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} |
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,3 @@ | ||
.env | ||
node_modules | ||
coverage |
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,8 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 140, | ||
"tabWidth": 2, | ||
"trailingComma": "none", | ||
"arrowParens": "avoid" | ||
} |
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,15 @@ | ||
module.exports = { | ||
globals: { | ||
"ts-jest": { | ||
tsconfig: "test/tsconfig.json", | ||
}, | ||
}, | ||
moduleFileExtensions: ["ts", "js"], | ||
transform: { | ||
"^.+\\.(ts|tsx)$": "ts-jest", | ||
}, | ||
coverageDirectory: "coverage", | ||
collectCoverageFrom: ["src/**/*.ts", "src/**/*.js"], | ||
testMatch: ["**/*.spec.(ts)"], | ||
testEnvironment: "node", | ||
} |
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,12 @@ | ||
{ | ||
"moduleFileExtensions": ["ts", "js"], | ||
"transform": { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
}, | ||
"coverageDirectory": "coverage", | ||
"collectCoverageFrom": ["src/**/*.ts", "src/**/*.js"], | ||
"coveragePathIgnorePatterns": ["/node_modules/", "index.ts", "src/migrations"], | ||
"testMatch": ["**/test/unit/*.spec.(ts)"], | ||
"testEnvironment": "node", | ||
"resetMocks": 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import nock from 'nock' | ||
|
||
nock.disableNetConnect() | ||
|
||
// Allow localhost connections so we can test local routes and mock servers. | ||
nock.enableNetConnect('0.0.0.0|127.0.0.1|localhost') |
Oops, something went wrong.