Skip to content

Commit

Permalink
Merge branch 'main' into leap-dynamic-duration
Browse files Browse the repository at this point in the history
  • Loading branch information
AminArria committed May 7, 2024
2 parents 7864206 + 9fd7343 commit ca09cde
Show file tree
Hide file tree
Showing 207 changed files with 16,794 additions and 1,997 deletions.
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Motivation

*Explain why not how.*
Closes #issue_number

## Summary of changes

*List your changes here.*

## How to test it?

*You can explain how you tested it or suggest a way to do so.*

## Checklist
- [ ] Tested the changes locally.
- [ ] Reviewed the changes on GitHub, line by line.
- [ ] This change requires new documentation.
- [ ] Documentation has been added/updated.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Brazil testing
name: Deploy to Brazil Arena testing
on:
workflow_dispatch:

Expand All @@ -7,8 +7,8 @@ jobs:
name: Build and deploy to Brazil testing
runs-on: ubuntu-latest
environment:
name: testing
url: https://brazil-testing.curseofmirra.com/board
name: testing-brazil
url: https://arena-brazil-testing.curseofmirra.com/

steps:
- uses: actions/checkout@v4
Expand All @@ -23,43 +23,51 @@ jobs:
- name: Create ssh private key file from env var
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
TS_HOST: ${{ vars.TS_BRAZIL_HOST }}
SSH_HOST: ${{ vars.TS_ARENA_HOST }}
run: |
set -ex
mkdir -p ~/.ssh/
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
retries=5; until ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
- name: Copy deploy script
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_BRAZIL_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_ARENA_HOST }}
run: |
set -ex
rsync -avz --mkpath apps/arena/devops/deploy_arena.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
set -ex
rsync -avz --mkpath devops/deploy.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
- name: Execute deploy script
env:
SSH_HOST: ${{ vars.TS_BRAZIL_HOST }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_ARENA_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
MIX_ENV: ${{ vars.MIX_ENV }}
RELEASE: arena
PHX_SERVER: ${{ vars.PHX_SERVER }}
PHX_HOST: ${{ vars.BRAZIL_HOST }}
PHX_HOST: ${{ vars.HOST }}
PORT: ${{ vars.ARENA_PORT }}
BOT_MANAGER_PORT: ${{ vars.BOT_MANAGER_PORT }}
BOT_MANAGER_HOST: ${{ vars.LOADTEST_CLIENT_HOST }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME_BRAZIL }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
set -ex
ssh ${SSH_USERNAME}@${SSH_HOST} \
BRANCH_NAME=${BRANCH_NAME} \
MIX_ENV=${MIX_ENV} \
RELEASE=${RELEASE} \
PHX_SERVER=${PHX_SERVER} \
PHX_HOST=${PHX_HOST} \
BOT_MANAGER_HOST=${BOT_MANAGER_HOST} \
PORT=${PORT} \
BOT_MANAGER_PORT=${BOT_MANAGER_PORT} \
DATABASE_URL=${DATABASE_URL} \
SECRET_KEY_BASE=${SECRET_KEY_BASE} \
NEWRELIC_APP_NAME=${NEWRELIC_APP_NAME} \
NEWRELIC_KEY=${NEWRELIC_KEY} \
/home/${SSH_USERNAME}/deploy-script/deploy_arena.sh
/home/${SSH_USERNAME}/deploy-script/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Europe testing
name: Deploy to Europe Arena testing
on:
workflow_dispatch:

Expand All @@ -7,8 +7,8 @@ jobs:
name: Build and deploy to Europe testing
runs-on: ubuntu-latest
environment:
name: testing
url: https://europe-testing.curseofmirra.com/
name: testing-europe
url: https://arena-europe-testing.curseofmirra.com/

steps:
- uses: actions/checkout@v4
Expand All @@ -23,43 +23,51 @@ jobs:
- name: Create ssh private key file from env var
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
TS_HOST: ${{ vars.TS_EUROPE_HOST }}
SSH_HOST: ${{ vars.TS_ARENA_HOST }}
run: |
set -ex
mkdir -p ~/.ssh/
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
retries=5; until ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
- name: Copy deploy script
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_EUROPE_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_ARENA_HOST }}
run: |
set -ex
rsync -avz --mkpath apps/arena/devops/deploy_arena.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
rsync -avz --mkpath devops/deploy.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
- name: Execute deploy script
env:
SSH_HOST: ${{ vars.TS_EUROPE_HOST }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_ARENA_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
MIX_ENV: ${{ vars.MIX_ENV }}
RELEASE: arena
PHX_SERVER: ${{ vars.PHX_SERVER }}
PHX_HOST: ${{ vars.EUROPE_HOST }}
PHX_HOST: ${{ vars.HOST }}
PORT: ${{ vars.ARENA_PORT }}
BOT_MANAGER_PORT: ${{ vars.BOT_MANAGER_PORT }}
BOT_MANAGER_HOST: ${{ vars.LOADTEST_CLIENT_HOST }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME_EUROPE }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
set -ex
ssh ${SSH_USERNAME}@${SSH_HOST} \
BRANCH_NAME=${BRANCH_NAME} \
MIX_ENV=${MIX_ENV} \
RELEASE=${RELEASE} \
PHX_SERVER=${PHX_SERVER} \
PHX_HOST=${PHX_HOST} \
PORT=${PORT} \
BOT_MANAGER_PORT=${BOT_MANAGER_PORT} \
BOT_MANAGER_HOST=${BOT_MANAGER_HOST} \
DATABASE_URL=${DATABASE_URL} \
SECRET_KEY_BASE=${SECRET_KEY_BASE} \
NEWRELIC_APP_NAME=${NEWRELIC_APP_NAME} \
NEWRELIC_KEY=${NEWRELIC_KEY} \
/home/${SSH_USERNAME}/deploy-script/deploy_arena.sh
/home/${SSH_USERNAME}/deploy-script/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Deploy to Brazil Loadtest
name: Deploy to Brazil Central testing
on:
workflow_dispatch:

jobs:
build-deploy:
name: Build and deploy to Brazil loadtest
name: Build and deploy to Brazil testing
runs-on: ubuntu-latest
environment:
name: testing
url: https://loadtest.curseofmirra.com/
name: testing-brazil
url: https://central-europe-testing.curseofmirra.com/

steps:
- uses: actions/checkout@v4
Expand All @@ -23,43 +23,51 @@ jobs:
- name: Create ssh private key file from env var
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
TS_HOST: ${{ vars.TS_LOADTEST_HOST }}
SSH_HOST: ${{ vars.TS_CENTRAL_HOST }}
run: |
set -ex
mkdir -p ~/.ssh/
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
retries=5; until ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
- name: Copy deploy script
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_LOADTEST_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_CENTRAL_HOST }}
run: |
set -ex
rsync -avz --mkpath apps/arena/devops/deploy_arena.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
set -ex
rsync -avz --mkpath devops/deploy.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
- name: Execute deploy script
env:
SSH_HOST: ${{ vars.TS_LOADTEST_HOST }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_CENTRAL_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
MIX_ENV: ${{ vars.MIX_ENV }}
RELEASE: central_backend
PHX_SERVER: ${{ vars.PHX_SERVER }}
PHX_HOST: ${{ vars.LOADTEST_HOST }}
PHX_HOST: ${{ vars.HOST }}
PORT: ${{ vars.ARENA_PORT }}
BOT_MANAGER_PORT: ${{ vars.BOT_MANAGER_PORT }}
BOT_MANAGER_HOST: ${{ vars.LOADTEST_CLIENT_HOST }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME_LOADTEST }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
set -ex
ssh ${SSH_USERNAME}@${SSH_HOST} \
BRANCH_NAME=${BRANCH_NAME} \
MIX_ENV=${MIX_ENV} \
RELEASE=${RELEASE} \
PHX_SERVER=${PHX_SERVER} \
PHX_HOST=${PHX_HOST} \
PORT=${PORT} \
BOT_MANAGER_PORT=${BOT_MANAGER_PORT} \
BOT_MANAGER_HOST=${BOT_MANAGER_HOST} \
DATABASE_URL=${DATABASE_URL} \
SECRET_KEY_BASE=${SECRET_KEY_BASE} \
NEWRELIC_APP_NAME=${NEWRELIC_APP_NAME} \
NEWRELIC_KEY=${NEWRELIC_KEY} \
/home/${SSH_USERNAME}/deploy-script/deploy_arena.sh
/home/${SSH_USERNAME}/deploy-script/deploy.sh
73 changes: 73 additions & 0 deletions .github/workflows/central-europe-testing-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy to Europe Central testing
on:
workflow_dispatch:

jobs:
build-deploy:
name: Build and deploy to Europe testing
runs-on: ubuntu-latest
environment:
name: testing-europe
url: https://central-europe-testing.curseofmirra.com/

steps:
- uses: actions/checkout@v4

- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci

- name: Create ssh private key file from env var
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_HOST: ${{ vars.TS_CENTRAL_HOST }}
run: |
set -ex
mkdir -p ~/.ssh/
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
retries=5; until ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
- name: Copy deploy script
env:
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
SSH_HOST: ${{ vars.TS_CENTRAL_HOST }}
run: |
set -ex
rsync -avz --mkpath devops/deploy.sh ${SSH_USERNAME}@${SSH_HOST}:/home/${SSH_USERNAME}/deploy-script/
- name: Execute deploy script
env:
SSH_HOST: ${{ vars.TS_CENTRAL_HOST }}
SSH_USERNAME: ${{ vars.SSH_USERNAME }}
MIX_ENV: ${{ vars.MIX_ENV }}
RELEASE: central_backend
PHX_SERVER: ${{ vars.PHX_SERVER }}
PHX_HOST: ${{ vars.HOST }}
PORT: ${{ vars.ARENA_PORT }}
BOT_MANAGER_PORT: ${{ vars.BOT_MANAGER_PORT }}
BOT_MANAGER_HOST: ${{ vars.LOADTEST_CLIENT_HOST }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
set -ex
ssh ${SSH_USERNAME}@${SSH_HOST} \
BRANCH_NAME=${BRANCH_NAME} \
MIX_ENV=${MIX_ENV} \
RELEASE=${RELEASE} \
PHX_SERVER=${PHX_SERVER} \
PHX_HOST=${PHX_HOST} \
PORT=${PORT} \
BOT_MANAGER_PORT=${BOT_MANAGER_PORT} \
BOT_MANAGER_HOST=${BOT_MANAGER_HOST} \
DATABASE_URL=${DATABASE_URL} \
SECRET_KEY_BASE=${SECRET_KEY_BASE} \
NEWRELIC_APP_NAME=${NEWRELIC_APP_NAME} \
NEWRELIC_KEY=${NEWRELIC_KEY} \
/home/${SSH_USERNAME}/deploy-script/deploy.sh
Loading

0 comments on commit ca09cde

Please sign in to comment.