Skip to content

Commit

Permalink
Merge branch 'main' of github.com:AudiusProject/audius-protocol into …
Browse files Browse the repository at this point in the history
…jd/harmony-text-input
  • Loading branch information
DejayJD committed Oct 16, 2023
2 parents 344d4f9 + 4f15758 commit 2d00892
Show file tree
Hide file tree
Showing 335 changed files with 4,405 additions and 4,849 deletions.
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- ./packages/harmony/node_modules
- ./packages/common/node_modules
- ./packages/libs/node_modules
- ./packages/identity-service/node_modules

- save_cache:
key: cache-{{ .Revision }}
Expand All @@ -87,6 +88,7 @@ jobs:
- ./packages/harmony/dist
- ./packages/common/dist
- ./packages/libs/dist
- ./packages/spl/dist

generate-release:
working_directory: ~/audius-protocol
Expand Down Expand Up @@ -427,11 +429,15 @@ workflows:
packages/identity-service/.* run-identity-workflow true
packages/identity-service/.* run-integration-workflow true
eth-contracts/.* run-eth-contracts-workflow true
monitoring/healthz/.* run-healthz-workflow true
protocol-dashboard/.* run-protocol-dashboard-workflow true
contracts/.* run-contracts-workflow true
.circleci/.* run-discovery-workflow true
.circleci/.* run-creator-workflow true
.circleci/.* run-identity-workflow true
.circleci/.* run-eth-contracts-workflow true
.circleci/.* run-protocol-dashboard-workflow true
.circleci/.* run-healthz-workflow true
.circleci/.* run-contracts-workflow true
.circleci/.* run-sdk-workflow true
.circleci/.* run-web-workflow true
Expand All @@ -458,6 +464,7 @@ workflows:
packages/eslint-config-audius/.* run-harmony-workflow true
packages/libs/.* run-creator-workflow true
packages/libs/.* run-identity-workflow true
packages/libs/.* run-protocol-dashboard-workflow true
packages/libs/.* run-sdk-workflow true
packages/libs/.* run-web-workflow true
packages/libs/.* run-mobile-workflow true
Expand Down Expand Up @@ -498,6 +505,8 @@ workflows:
packages/harmony/.* run-mobile-workflow true
packages/mobile/.* run-mobile-workflow true
packages/web/.* run-web-workflow true
protocol-dashboard/.* run-protocol-dashboard-workflow true
monitoring/healthz/.* run-healthz-workflow true
requires:
- generate-config
- init
Expand Down
6 changes: 6 additions & 0 deletions .circleci/src/@continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ parameters:
run-harmony-workflow:
type: boolean
default: false
run-protocol-dashboard-workflow:
type: boolean
default: false
run-healthz-workflow:
type: boolean
default: false
# Can enable recurring probers against stage at some point
# workflows:
# version: 2.1
Expand Down
28 changes: 28 additions & 0 deletions .circleci/src/jobs/@identity-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
identity-init:
working_directory: ~/audius-protocol
docker:
- image: cimg/node:18.17
steps:
- checkout

- create_concatenated_patch_file:
filename: combined-patch-file.txt

- restore_cache:
keys:
- cache-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}

- restore_cache:
keys:
- cache-{{ .Revision }}

- run:
name: verify
command: npx turbo run verify --filter=identity-service

- persist_to_workspace:
root: ./
paths:
- node_modules
- packages/libs/node_modules
- packages/libs/dist
196 changes: 196 additions & 0 deletions .circleci/src/jobs/@protocol-dashboard-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
protocol-dashboard-init:
working_directory: ~/audius-protocol
docker:
- image: cimg/ruby:2.6-node

steps:
- checkout

- run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > protocol-dashboard/.npmrc

# Download and cache dependencies
- restore_cache:
keys:
- dependency-cache-{{ checksum "protocol-dashboard/package.json" }}
# fallback to using the latest cache if no exact match is found
- dependency-cache-

- run:
name: npm ci
command: |
cd protocol-dashboard
npm ci
- save_cache:
key: dependency-cache-{{ checksum "protocol-dashboard/package.json" }}
paths:
- protocol-dashboard/node_modules

# Lint
- run:
name: lint
command: |
cd protocol-dashboard
npm run lint
# Persist node modules
- persist_to_workspace:
root: ./
paths:
- protocol-dashboard/node_modules

protocol-dashboard-build-staging:
working_directory: ~/audius-protocol
resource_class: xlarge
docker:
- image: cimg/ruby:2.6-node
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: build
command: |
cd protocol-dashboard
npm run build:stage
- run:
name: armada bundle
command: |
cd protocol-dashboard
timestamp=$(date +%s)
filename="$(npx armada-cli bundle create dist${timestamp} dist)"
hash="$(npx armada-cli bundle checksum $filename)"
echo "export FILENAME='$filename'" >> tmp.env
echo "export HASH='$hash'" >> tmp.env
- persist_to_workspace:
root: ./
paths:
- protocol-dashboard/*

protocol-dashboard-pin-staging:
working_directory: ~/audius-protocol
docker:
- image: circleci/python:2.7-jessie
steps:
- run:
name: install-awscli
command: sudo pip install awscli
- attach_workspace:
at: ./
- run:
name: deploy to s3
command: |
cd protocol-dashboard
source tmp.env
aws s3 cp ${FILENAME} s3://dashboard.staging.audius.org/${FILENAME} --cache-control max-age=0
protocol-dashboard-deploy-staging:
working_directory: ~/audius-protocol
docker:
- image: cimg/ruby:2.6-node
steps:
- attach_workspace:
at: ./
- run:
name: install deps
command: sudo apt update && sudo apt install -y libsecret-1-0
- run:
name: armada publish
command: |
cd protocol-dashboard
source tmp.env
npx armada-cli project publish 0x3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1 https://s3.us-west-1.amazonaws.com/dashboard.staging.audius.org/${FILENAME} ${HASH} --key=${ARMADA_ADMIN_PRIVATE_KEY}
protocol-dashboard-build-prod:
working_directory: ~/audius-protocol
docker:
- image: cimg/ruby:2.6-node
resource_class: xlarge
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: build
command: |
cd protocol-dashboard
npm run build:prod
- run:
name: zip dist
command: |
cd protocol-dashboard
zip -r dist.zip ./dist
- persist_to_workspace:
root: ./
paths:
- protocol-dashboard/*

protocol-dashboard-deploy-prod:
working_directory: ~/audius-protocol
docker:
- image: circleci/python:2.7-jessie
steps:
- run:
name: install-awscli
command: sudo pip install awscli
- attach_workspace:
at: ./
- run:
name: Deploy to S3
command: |
cd protocol-dashboard
aws s3 sync dist s3://dashboard.audius.org --delete --cache-control max-age=604800
aws s3 cp s3://dashboard.audius.org/index.html s3://dashboard.audius.org/index.html --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --metadata-directive REPLACE --acl public-read
aws s3 cp dist.zip s3://dashboard.audius.org/dist.zip --cache-control max-age=0
protocol-dashboard-update-prod-ga-build:
working_directory: ~/audius-protocol
docker:
- image: cimg/ruby:2.6-node
steps:
- attach_workspace:
at: ./
- run:
name: update build in ga
command: |
cd protocol-dashboard
npm run update-build:prod
- persist_to_workspace:
root: ./
paths:
- protocol-dashboard/build_cid.txt

protocol-dashboard-publish-prod-build-cids:
working_directory: ~/audius-protocol
docker:
- image: circleci/python:2.7-jessie
steps:
- run:
name: install-awscli
command: sudo pip install awscli
- attach_workspace:
at: ./
- run:
name: Push to S3
command: |
cd protocol-dashboard
aws s3 cp build_cid.txt s3://dashboard.audius.org/build_cid.txt
protocol-dashboard-update-prod-records:
working_directory: ~/audius-protocol
docker:
- image: cimg/ruby:2.6-node
steps:
- attach_workspace:
at: ./
- run:
name: Update Cloudflare records
command: |
cd protocol-dashboard
DNS_NAME=_dnslink.dashboard.audius.org
CID=$(cat ./build_cid.txt)
curl -X PUT "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/dns_records/${CLOUDFLARE_PROD_DASHBOARD_DNS_ID}" \
-H "X-Auth-Email: ${CLOUDFLARE_AUTH_EMAIL}" \
-H "Authorization: Bearer ${CLOUDFLARE_AUTH_KEY}" \
-H "Content-Type: application/json" \
--data '{"type":"TXT","name":"'"$DNS_NAME"'","content":"\"dnslink=/ipfs/'"$CID"'\"","ttl":1,"proxied":false}'
1 change: 0 additions & 1 deletion .circleci/src/jobs/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ parameters:
resource_class: large
machine:
image: ubuntu-2204:current
docker_layer_caching: true
steps:
- checkout:
path: '~/audius-protocol'
Expand Down
1 change: 0 additions & 1 deletion .circleci/src/jobs/test-audius-cmd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
machine:
image: ubuntu-2204:current
docker_layer_caching: true
resource_class: large
steps:
- checkout:
Expand Down
1 change: 0 additions & 1 deletion .circleci/src/jobs/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ parameters:
type: string
machine:
image: ubuntu-2204:current
docker_layer_caching: true
resource_class: large
steps:
- checkout:
Expand Down
7 changes: 7 additions & 0 deletions .circleci/src/workflows/discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ jobs:
filters:
branches:
only: main
- push-docker-image:
name: push-protocol-dashboard
context: [Vercel, dockerhub]
service: dashboard
filters:
branches:
only: /^main$/

- lint-discovery-provider:
name: lint-discovery-provider
Expand Down
9 changes: 9 additions & 0 deletions .circleci/src/workflows/healthz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
when: << pipeline.parameters.run-healthz-workflow >>
jobs:
- push-docker-image:
name: push-healthz
context: [GCP, dockerhub]
service: healthz
filters:
branches:
only: main
7 changes: 7 additions & 0 deletions .circleci/src/workflows/identity.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
when: << pipeline.parameters.run-identity-workflow >>
jobs:
- identity-init:
context: Vercel

- push-docker-image:
name: push-identity-service
context: [GCP, dockerhub]
service: identity-service
requires:
- identity-init
filters:
branches:
only: main
Expand All @@ -12,6 +17,8 @@ jobs:
name: test-identity-service
context: GCP
service: identity-service
requires:
- identity-init

# Deploy audius-protocol `main` branch (stage)
- deploy-stage-nodes:
Expand Down
Loading

0 comments on commit 2d00892

Please sign in to comment.