Skip to content

Commit

Permalink
Merge pull request #128 from Cerebellum-Network/release/0.26.0
Browse files Browse the repository at this point in the history
Release/0.26.0
  • Loading branch information
Andrei Navoichyk authored Mar 23, 2023
2 parents e03c7b5 + 9353c56 commit 42a4185
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 46 deletions.
44 changes: 11 additions & 33 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,31 @@ on:
- dev-cere
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
build_backend_cerestats_api:
uses: Cerebellum-Network/reusable-workflows/.github/workflows/build-and-push-docker.yaml@1.0.0
uses: Cerebellum-Network/reusable-workflows/.github/workflows/deploy-to-ecr.yaml@1.3.0
with:
runs-on: '["self-hosted", "cere-network-large-workers"]'
org: cerebellumnetwork
environment: dev
image: crb-cerestats-api
repository: crb-cerestats-api
aws_account_id: ${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}
repository: stats-api
file: ./api/Dockerfile
secrets: inherit

build_backend_cerestats_crawler:
uses: Cerebellum-Network/reusable-workflows/.github/workflows/build-and-push-docker.yaml@1.0.0
uses: Cerebellum-Network/reusable-workflows/.github/workflows/deploy-to-ecr.yaml@1.3.0
with:
runs-on: '["self-hosted", "cere-network-large-workers"]'
org: cerebellumnetwork
environment: dev
image: crb-cerestats-crawler
repository: crb-cerestats-crawler
aws_account_id: ${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}
repository: stats-crawler
file: ./backend/docker/crawler/Dockerfile
secrets: inherit

deploy_backend_cerestats_api:
uses: Cerebellum-Network/reusable-workflows/.github/workflows/deploy-with-helm.yaml@1.0.0
needs: build_backend_cerestats_api
with:
runs-on: '["self-hosted", "cere-network-dev-deployer"]'
helm-repo-path: cerestats/cerestats-api
helm-release: cerestats-api
namespace: cerestats
tag: ${{ needs.build_backend_cerestats_api.outputs.version }}
environment: dev
secrets: inherit

deploy_backend_cerestats_crawler:
uses: Cerebellum-Network/reusable-workflows/.github/workflows/deploy-with-helm.yaml@1.0.0
needs: build_backend_cerestats_crawler
with:
runs-on: '["self-hosted", "cere-network-dev-deployer"]'
helm-repo-path: cerestats/cerestats-crawler
helm-release: cerestats-crawler
namespace: cerestats
tag: ${{ needs.build_backend_cerestats_crawler.outputs.version }}
environment: dev
secrets: inherit

build_and_deploy_frontend:
uses: Cerebellum-Network/reusable-workflows/.github/workflows/build-and-upload-static.yaml@1.0.0
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## vNext
- ...

## v0.26.0
- [BE] Add ss58 prefix migration for first priority data
- [BE] Add package.json and yarn.lock to Dockerfile
- [BE] Handle addresses in address20 format in Transfer Page

## v0.25.0
- [BE] Fix crawlers status restore after fail

Expand Down
2 changes: 2 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM node:fermium

WORKDIR /usr/app/api

COPY ./package.json /usr/app
COPY ./yarn.lock /usr/app
COPY ./api /usr/app/api
COPY ./db /usr/app/db

Expand Down
3 changes: 2 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api",
"version": "0.25.0",
"version": "0.26.0",
"description": "PolkaStats API",
"author": "Mario Pino Uceda",
"license": "Apache-2.0",
Expand All @@ -11,6 +11,7 @@
},
"dependencies": {
"@polkadot/api": "8.2.1",
"@polkadot/keyring": "^10.4.2",
"apicache": "^1.6.3",
"axios": "^0.21.1",
"body-parser": "^1.19.0",
Expand Down
2 changes: 2 additions & 0 deletions backend/docker/crawler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM node:fermium

WORKDIR /usr/app/crawler

COPY ./package.json /usr/app
COPY ./yarn.lock /usr/app
COPY ./backend /usr/app/crawler
COPY ./db /usr/app/db

Expand Down
9 changes: 0 additions & 9 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
const express = require('express');
const DBMigrate = require('db-migrate');
const pino = require('pino');
const { spawn } = require('child_process');
const { StatusCodes } = require('http-status-codes');
Expand Down Expand Up @@ -48,14 +47,6 @@ const runCrawler = async ({ crawler, name }) => {
};

const runCrawlers = async () => {
logger.info('Running migrations');
await DBMigrate.getInstance(true, {
env: process.env.NODE_ENV || 'local',
config: '../db/database.json',
cmdOptions: {
'migrations-dir': '../db/migrations',
},
}).up();
logger.info('Migrations completed');

logger.info('Starting backend, waiting 10s...');
Expand Down
4 changes: 3 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "0.25.0",
"version": "0.26.0",
"description": "PolkaStats NG Backend",
"author": "Mario Pino Uceda",
"license": "Apache-2.0",
Expand All @@ -27,6 +27,8 @@
"@cere-ddc-sdk/smart-contract": "0.5.0",
"@polkadot/api": "8.2.1",
"@polkadot/api-contract": "8.2.1",
"@polkadot/keyring": "^10.4.2",
"@polkadot/util-crypto": "^10.4.2",
"axios": "^0.21.1",
"bignumber.js": "^9.0.1",
"db-migrate": "^0.11.13",
Expand Down
Loading

0 comments on commit 42a4185

Please sign in to comment.