Skip to content

Commit

Permalink
Merge pull request #5 from decentraland/feat/first-endpoints
Browse files Browse the repository at this point in the history
feat: introduce the logic to list/promote/stop squids
  • Loading branch information
juanmahidalgo authored Nov 15, 2024
2 parents abfe854 + 9486adf commit dd5faee
Show file tree
Hide file tree
Showing 31 changed files with 16,872 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .env.default
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=
34 changes: 34 additions & 0 deletions .eslintrc.json
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
}
}
]
}
}
]
}
7 changes: 7 additions & 0 deletions .github/dependabot.yml
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
35 changes: 35 additions & 0 deletions .github/workflows/deployer.yml
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 }}
16 changes: 16 additions & 0 deletions .github/workflows/docker.yml
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 }}
27 changes: 27 additions & 0 deletions .github/workflows/node.yml
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 }}
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
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 }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
node_modules
coverage
8 changes: 8 additions & 0 deletions .prettierrc.json
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"
}
15 changes: 15 additions & 0 deletions jest.config.js
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",
}
12 changes: 12 additions & 0 deletions jest.config.json
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
}
6 changes: 6 additions & 0 deletions jest.setup.ts
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')
Loading

0 comments on commit dd5faee

Please sign in to comment.