-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into add-tests
- Loading branch information
Showing
40 changed files
with
1,052 additions
and
317 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
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,28 @@ | ||
name: auto-deploy-develop | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Production Auto-Deploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cd $HOME/DeVouch-BE | ||
git checkout develop | ||
git checkout -- . | ||
git pull | ||
docker compose stop devouch squid-db | ||
docker compose rm -v -f devouch squid-db | ||
docker rmi -f $(docker images | grep 'devouch' | awk '{print $3}') | ||
docker volume rm $(docker volume ls | grep 'db-data' | awk '{print $2}') | ||
docker compose up -d --build |
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,21 @@ | ||
name: start-devouch | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
start: | ||
name: Start Devouch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Start Devouch | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cd $HOME/DeVouch-BE | ||
docker compose up -d --build |
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,24 @@ | ||
name: stop-devouch | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
stop: | ||
name: Stop Devouch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Stop Devouch | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.STAGING_HOST }} | ||
username: ${{ secrets.STAGING_USERNAME }} | ||
key: ${{ secrets.STAGING_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cd $HOME/DeVouch-BE | ||
docker compose stop devouch squid-db | ||
docker compose rm -f -v devouch squid-db | ||
docker rmi -f $(docker images | grep 'devouch' | awk '{print $3}') | ||
docker volume rm $(docker volume ls | grep 'db-data' | awk '{print $2}') |
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
# IDE files | ||
/.idea | ||
/.vscode | ||
.env | ||
/.env |
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,29 @@ | ||
# Global Options | ||
{ | ||
log global { | ||
output file /usr/src/app/global.log | ||
format json | ||
level error | ||
} | ||
servers { | ||
metrics | ||
} | ||
admin 0.0.0.0:2020 | ||
} | ||
|
||
# ADMIN ROUTE #### | ||
:2019 { | ||
route { | ||
@allowed { | ||
path /* | ||
remote_ip {$IP_WHITELIST} | ||
} | ||
reverse_proxy @allowed 127.0.0.1:2020 | ||
respond 403 | ||
} | ||
} | ||
|
||
# HTTP site block | ||
{$GQL_URL} { | ||
reverse_proxy devouch:4350 | ||
} |
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,29 @@ | ||
# Use the official Node.js 20 image as a parent image | ||
FROM node:20-alpine | ||
|
||
# Set the working directory in the Docker container | ||
WORKDIR /usr/src/app | ||
|
||
# Install Python and build-essential (for C++ bindings) | ||
RUN apk add --no-cache python3 py3-pip make g++ | ||
|
||
# Copy the package.json and package-lock.json for npm install | ||
COPY package*.json ./ | ||
|
||
# Install any global dependencies | ||
RUN npm install -g @subsquid/cli | ||
|
||
# Install project dependencies | ||
RUN npm ci | ||
|
||
# Copy the rest of the application | ||
COPY . . | ||
|
||
# Build the project using the Squid CLI | ||
RUN sqd build | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 4350 | ||
|
||
# Command to run the application | ||
CMD ["sqd", "run", "."] |
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
This file was deleted.
Oops, something went wrong.
26 changes: 20 additions & 6 deletions
26
db/migrations/1714572602760-Data.js → db/migrations/1715693415593-Data.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 @@ | ||
module.exports = class AddTrace1725254645149 { | ||
name = "AddTrace1725254645149"; | ||
|
||
async up(db) { | ||
// add organisation with name "Trace" and schema id "0x2e22df9a11e06c306ed8f64ca45ceae02efcf8a443371395a78371bc4fb6f722" | ||
await db.query( | ||
`INSERT INTO "organisation" ("id", "name", "issuer", "color") | ||
VALUES ( | ||
'0x2e22df9a11e06c306ed8f64ca45ceae02efcf8a443371395a78371bc4fb6f722', | ||
'Trace', | ||
'0xf23ea0b5f14afcbe532a1df273f7b233ebe41c78', | ||
'#ff0000' | ||
)` | ||
); | ||
} | ||
|
||
async down(db) { | ||
// remove organisation with name "Trace" and schema id "0x2e22df9a11e06c306ed8f64ca45ceae02efcf8a443371395a78371bc4fb6f722" | ||
await db.query( | ||
`DELETE FROM "organisation" WHERE "id" = '0x2e22df9a11e06c306ed8f64ca45ceae02efcf8a443371395a78371bc4fb6f722'` | ||
); | ||
} | ||
}; |
23 changes: 23 additions & 0 deletions
23
db/migrations/1725344741698-AddGiveth Verification Team.js
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,23 @@ | ||
module.exports = class AddGivethVerificationTeam1725344741698 { | ||
name = "AddGivethVerificationTeam1725344741698"; | ||
|
||
async up(db) { | ||
// add organisation with name "Giveth Verification Team" and schema id "0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404" | ||
await db.query( | ||
`INSERT INTO "organisation" ("id", "name", "issuer", "color") | ||
VALUES ( | ||
'0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404', | ||
'Giveth Verification Team', | ||
'0x826976d7c600d45fb8287ca1d7c76fc8eb732030', | ||
'#7f64cb' | ||
)` | ||
); | ||
} | ||
|
||
async down(db) { | ||
// remove organisation with name "Giveth Verification Team" and schema id "0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404" | ||
await db.query( | ||
`DELETE FROM "organisation" WHERE "id" = '0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404'` | ||
); | ||
} | ||
}; |
File renamed without changes.
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 @@ | ||
version: "3" | ||
|
||
services: | ||
db: | ||
image: postgres:15 | ||
environment: | ||
POSTGRES_DB: squid | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- "${DB_PORT}:5432" | ||
# command: ["postgres", "-c", "log_statement=all"] | ||
shm_size: 1gb |
Oops, something went wrong.