Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisassad committed Sep 17, 2024
1 parent 86224a8 commit 802b4a5
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 117 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
deploy:
needs: [build]
runs-on: ubuntu-latest
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
steps:
- name: Set Heroku app name based on branch
id: set-heroku-app-name
Expand All @@ -82,22 +80,10 @@ jobs:
esac
echo "HEROKU_APP_NAME=$APP_NAME" >> $GITHUB_ENV
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- uses: actions/checkout@v2
with:
ref: ${{ steps.extract_branch.outputs.branch }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3

- uses: akhileshns/[email protected]
with:
dontuseforce: 1
heroku_api_key: ${{secrets.HEROKU_API_TOKEN}}
heroku_app_name: ${{ env.HEROKU_APP_NAME }}
heroku_email: ${{secrets.HEROKU_EMAIL}}
branch: ${{ steps.extract_branch.outputs.branch }}
heroku_email: ${{secrets.HEROKU_EMAIL}}
11 changes: 11 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build:
docker:
web: Dockerfile

run:
web: NODE_ENV=production node --import=extensionless/register --enable-source-maps ./build/server.js

release:
image: web
command:
- node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/scripts/releasePhaseEnvCheck.js && npx sequelize-cli db:migrate --config server/sequelize.json && node --import=extensionless/register build/server/scripts/purgeCloudflareCache.js
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"prettier-plugin-organize-imports": "^4.0.0",
"process": "^0.11.10",
"readline-sync": "^1.4.10",
"sequelize-cli": "^6.2.0",
"sharp": "^0.31.2",
"sinon": "^15.0.4",
"source-map-support": "^0.5.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/commonwealth/Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ consumer: cd packages/commonwealth && node --import=extensionless/register --max
evm-ce: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/evmChainEvents/startEvmPolling.js
knock: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/knock/knockWorker.js
message-relayer: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/messageRelayer/messageRelayer.js
release: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/scripts/releasePhaseEnvCheck.js && npx sequelize-cli db:migrate --config server/sequelize.json && node --import=extensionless/register build/server/scripts/purgeCloudflareCache.js
release: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/scripts/releasePhaseEnvCheck.js && npx sequelize-cli db:migrate --config server/sequelize.json && node --import=extensionless/register build/server/scripts/purgeCloudflareCache.js
12 changes: 12 additions & 0 deletions packages/commonwealth/scripts/heroku-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

echo "Logging in to AWS ECR..."
aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com

IMAGE_URI="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${REPOSITORY_NAME}:${COMMIT_HASH}"

echo "Pulling Docker image $IMAGE_URI..."
docker pull $IMAGE_URI

docker run -d -p 8080:8080 $IMAGE_URI
CONTAINER_ID=$(docker run -d -p 8080:8080 $IMAGE_URI)
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ if (import.meta.url.endsWith(process.argv[1])) {
// TODO: Add checks for unused env var
// TODO: Add warning for manually set client FLAGs when APP_ENV !== 'local'/'CI'
log.info('Environment variables are properly configured');
// eslint-disable-next-line @typescript-eslint/no-floating-promises
dispose()('EXIT', true);
})
.catch((err) => {
log.fatal('Environment variables not properly configured!', err);
// eslint-disable-next-line @typescript-eslint/no-floating-promises
dispose()('ERROR', true);
});
}
286 changes: 188 additions & 98 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Empty file added temp.txt
Empty file.

0 comments on commit 802b4a5

Please sign in to comment.