Skip to content

Commit

Permalink
Rename service
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinludu committed Aug 21, 2024
1 parent 67dae3e commit e8003eb
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .cdk/bin/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const deployProps: cdk.StackProps = {

const app = new cdk.App();

// Command example: cdk deploy --context name=stg-connect
// Command example: cdk deploy --context name=stg-scoutgame
const stackNameParam: string = app.node.getContext('name');

// Sunny awawrds production
Expand All @@ -28,7 +28,7 @@ else if (stackNameParam.startsWith('prd')) {
});
}
// Connect staging
else if (stackNameParam.startsWith('stg-connect')) {
else if (stackNameParam.startsWith('stg-scoutgame')) {
new StagingStack(app, stackNameParam, deployProps);
}
// Sunny awards staging
Expand Down
8 changes: 4 additions & 4 deletions .ebextensions/scoutgame/00_env_vars.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Do not put any env var or secrets used by the app here. Put in .ebstalk.app.env/ceramic.env
# Do not put any env var or secrets used by the app here. Put in .ebstalk.apps.env/scoutgame.env
# This file should only have
# - env variables referenced in docker-compose file
# - variables needed for the .platform/hooks/predeploy/01_pull_secrets.sh script to run

option_settings:
aws:elasticbeanstalk:application:environment:
COMPOSE_PROJECT_NAME: "prd"
COMPOSE_PROFILES: "prd-connect"
COMPOSE_PROFILES: "prd-scoutgame"
EBSTALK_ENV_FILE: "scoutgame.env"
SERVICE_ENV: "prd" # this sets the value of datadog env tag
SERVICE_NAME: "connect-app"
IMGNAME: "charmverse-connect"
SERVICE_NAME: "scoutgame"
IMGNAME: "scoutgame"
IMGTAG: ""
2 changes: 1 addition & 1 deletion .ebstalk.apps.env/scoutgame.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Format of this file is <env_var>=<value> key/value pair
DATABASE_URL="{{pull:secretsmanager:/io.cv.app/prd/db:SecretString:database_url}}"
AUTH_COOKIE="connect-session"
AUTH_COOKIE="scoutgame-session"
AUTH_SECRET="{{pull:secretsmanager:/io.cv.app/prd/auth_secret:SecretString:auth_secret}}"
ALCHEMY_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/alchemy:SecretString:alchemy_api_key}}"
NEYNAR_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/neynar:SecretString:neynar_api_key}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on:
required: true

concurrency:
group: ci-connect-${{ github.event_name }}-${{ github.ref }}
group: ci-scoutgame-${{ github.event_name }}-${{ github.ref }}

jobs:
build-app:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
id: get_head_commit_message
run: echo "commit_message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

test-connect:
test-scoutgame:
name: Test apps
runs-on: ubuntu-latest
needs: build-app
Expand Down Expand Up @@ -115,13 +115,13 @@ jobs:
with:
app_name: scoutgame

- name: Validate Webapp
- name: Validate Scoutgame app
run: |
npm run lint -w apps/scoutgame
npm run typecheck -w apps/scoutgame
test-connect-e2e:
name: Test Connect e2e
test-scoutgame-e2e:
name: Test Scoutgame e2e
runs-on: ubuntu-latest
needs: build-app
if: ${{ github.event.action != 'labeled' && !contains(needs.build-app.outputs.head-commit-message, 'skip-tests') }}
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
sleep 1
done
- name: Run Connect E2E tests
- name: Run Scoutgame E2E tests
env:
REACT_APP_APP_ENV: 'test'
# we have to run docker command ourselves to set network=host so that playwright can access the server
Expand All @@ -191,8 +191,8 @@ jobs:
# run whether previous jobs were successful or skipped
if: |
github.ref == 'refs/heads/main' ||
(github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy-connect') ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy-connect')))
(github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy-scoutgame') ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgame')))
needs: build-app
steps:
- uses: actions/checkout@v4
Expand All @@ -219,7 +219,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
with:
ecr_registry: charmverse-connect
ecr_registry: scoutgame

upload-static-assets:
name: Upload assets in production
Expand Down Expand Up @@ -271,12 +271,12 @@ jobs:
name: Deploy to production
# run whether previous jobs were successful or skipped
if: github.ref == 'refs/heads/main' && !(failure() || cancelled())
needs: [test-connect, test-connect-e2e, upload-docker, upload-static-assets]
needs: [test-scoutgame, test-scoutgame-e2e, upload-docker, upload-static-assets]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- stack: prd-connect
- stack: prd-scoutgame
ebextensions: scoutgame
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -316,8 +316,8 @@ jobs:
deploy-staging:
name: Deploy to staging
if: |
(github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy-connect') ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy-connect')))
(github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy-scoutgame') ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgame')))
runs-on: ubuntu-latest
# prevent workflows running in parallel
Expand All @@ -333,7 +333,7 @@ jobs:

- name: Calculate Stage env var
run: |
full_stage_name="stg-connect-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}"
full_stage_name="stg-scoutgame-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}"
# sanitize and trim string so that it can be used as a valid subdomain. Includes removing hyphens at the start and end of the name
stage_name=`echo "$full_stage_name" | sed -E -e 's/[^a-zA-Z0-9-]+//g' -e 's/(.{40}).*/\1/' -e 's/^-/0/' -e 's/-$/0/'`
Expand Down Expand Up @@ -417,7 +417,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && failure()
# pass in all steps so we can check if any failed
needs: [test-connect, test-connect-e2e, upload-docker, upload-static-assets, upload-docker, deploy-production]
needs: [test-scoutgame, test-scoutgame-e2e, upload-docker, upload-static-assets, upload-docker, deploy-production]
steps:
- name: If any of prev jobs failed notify discord
if: contains(needs.*.result, 'failure')
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/destroy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
clean-up:
if: |
(github.event.action == 'unlabeled' && startsWith(github.event.label.name, ':rocket: deploy')) ||
(github.event.action == 'closed' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-ceramic') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-connect') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-sunnyawards') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-farcaster')))
(github.event.action == 'closed' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-ceramic') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgame') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-sunnyawards') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-farcaster')))
runs-on: ubuntu-latest
# wait until all deploys are complete to destroy the env
concurrency: deploy-pr-app-${{ github.head_ref }}
Expand Down Expand Up @@ -48,12 +48,12 @@ jobs:
# we need to create a dummy zip file or else cdk throws an error it cannot find the asset
run: |
touch stg-webapp-${{ env.STAGE_SUFFIX }}.zip
touch stg-connect-${{ env.STAGE_SUFFIX }}.zip
touch stg-scoutgame-${{ env.STAGE_SUFFIX }}.zip
touch stg-sunnyawards-${{ env.STAGE_SUFFIX }}.zip
touch stg-farcaster-${{ env.STAGE_SUFFIX }}.zip
npm install aws-cdk-lib --no-audit --no-fund
npx cdk destroy -c name=stg-webapp-${{ env.STAGE_SUFFIX }} --force
npx cdk destroy -c name=stg-connect-${{ env.STAGE_SUFFIX }} --force
npx cdk destroy -c name=stg-scoutgame-${{ env.STAGE_SUFFIX }} --force
npx cdk destroy -c name=stg-sunnyawards-${{ env.STAGE_SUFFIX }} --force
npx cdk destroy -c name=stg-farcaster-${{ env.STAGE_SUFFIX }} --force
Expand All @@ -63,11 +63,11 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
environment: stg-webapp-${{ env.STAGE_SUFFIX }}

- name: delete the connect github deployment
- name: delete the scoutgame github deployment
uses: strumwolf/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: stg-connect-${{ env.STAGE_SUFFIX }}
environment: stg-scoutgame-${{ env.STAGE_SUFFIX }}

- name: delete the sunnyawards github deployment
uses: strumwolf/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ services:
profiles:
- stg-ceramic

prd-connect:
prd-scoutgame:
extends:
service: defaults
ports:
Expand All @@ -88,9 +88,9 @@ services:
'npx react-env --path .env --dest ./apps/scoutgame/public -- node --max-old-space-size=8192 --require dd-trace/init node_modules/.bin/next start apps/scoutgame --keepAliveTimeout 70000'
]
profiles:
- prd-connect
- prd-scoutgame

stg-connect:
stg-scoutgame:
extends:
service: defaults
ports:
Expand All @@ -104,7 +104,7 @@ services:
environment:
- REACT_APP_APP_ENV=staging
profiles:
- stg-connect
- stg-scoutgame

prd-sunnyawards:
extends:
Expand Down Expand Up @@ -260,5 +260,5 @@ services:
- prd-webapp
- prd-sunnyawards
- prd-sockets
- prd-connect
- prd-scoutgame
- ddtst

0 comments on commit e8003eb

Please sign in to comment.