Skip to content

🚀release-dev-cloud-dogu- #6

🚀release-dev-cloud-dogu-

🚀release-dev-cloud-dogu- #6

name: 🚀release-dev-cloud-dogu
run-name: 🚀release-dev-cloud-dogu-${{ github.event.inputs.version }}
on:
workflow_dispatch:
inputs:
rc_check:
type: boolean
description: RC
version:
type: string
description: 'dogu image version'
default: ''
jobs:
input_validation:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.input_validation.outputs.tag }}
steps:
- id: input_validation
name: input validation
run: |
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
echo "rc_check is ${{ github.event.inputs.rc_check }}"
echo "version is ${{ github.event.inputs.version }}"
rc_check=${{ github.event.inputs.rc_check }}
version=${{ github.event.inputs.version }}
if [ "$rc_check" = "true" ] && [ -n "$version" ]; then
echo -e "${RED}Skipping because rc_check is true and version is not empty${NC}"
exit 1
elif [ "$rc_check" = "false" ] && [ -z "$version" ]; then
echo -e "${RED}Skipping because rc_check is false and version is empty${NC}"
exit 1
else
if [ "$rc_check" = "true" ]; then
image_path="dogutechio/dogu-rc:rc"
echo "tag=${image_path}" >> "$GITHUB_OUTPUT"
echo -e "${GREEN} dogu image tag is ${image_path}${NC}"
else
image_path="dogutechio/dogu:$version"
echo "tag=${image_path}" >> "$GITHUB_OUTPUT"
echo -e "${GREEN} dogu image tag is ${image_path}${NC}"
fi
echo -e "${GREEN} input validation successful${NC}"
fi
start-rc-dogu:
needs: input_validation
runs-on: dev-dogu
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: dogu-team/dogu
token: ${{ secrets.DOGU_GITHUB_TOKEN }}
path: .
clean: true
sparse-checkout: |
docker-compose.yml
docker-compose.env
- name: docker init
run: docker system prune --volumes -a -f
- name: set .env
run: |
sed -i "s|dogutechio/.*$|${{needs.input_validation.outputs.tag}}|" ./docker-compose.yml
sed -i "s|DOGU_HOST=.*$|DOGU_HOST=${{ secrets.DEV_DOGU_HOST }}|" ./docker-compose.env
sed -i "s|DOGU_CONSOLE_URL=.*$|DOGU_CONSOLE_URL=https://console.${{ secrets.DEV_DOGU_CONSOLE_DOMAIN }}|" ./docker-compose.env
# postgres
sed -i "s|POSTGRES_USER=.*$|POSTGRES_USER=${{ secrets.DEV_DOGU_RDS_USERNAME }}|" ./docker-compose.env
sed -i "s|POSTGRES_PASSWORD=.*$|POSTGRES_PASSWORD=${{ secrets.DEV_DOGU_RDS_PASSWORD }}|" ./docker-compose.env
# influxdb
sed -i "s|INFLUX_DB_INIT_ADMIN_TOKEN=.*$|INFLUX_DB_INIT_ADMIN_TOKEN=${{ secrets.DEV_DOGU_INFLUX_DB_TOKEN }}|" ./docker-compose.env
sed -i "s|INFLUX_DB_USERNAME=.*$|INFLUX_DB_USERNAME=${{ secrets.DEV_DOGU_INFLUX_DB_USERNAME }}|" ./docker-compose.env
sed -i "s|INFLUX_DB_PASSWORD=.*$|INFLUX_DB_PASSWORD=${{ secrets.DEV_DOGU_INFLUX_DB_PASSWORD }}|" ./docker-compose.env
# redis
sed -i "s|REDIS_PASSWORD=.*$|REDIS_PASSWORD=${{ secrets.DEV_DOGU_REDIS_PASSWORD }}|" ./docker-compose.env
# console - front
sed -i "s|NEXT_PUBLIC_ENV=.*$|NEXT_PUBLIC_ENV=development|" ./docker-compose.yml
sed -i "s|NEXT_PUBLIC_DOGU_API_BASE_URL=.*$|NEXT_PUBLIC_DOGU_API_BASE_URL=${{ secrets.DEV_DOGU_API_BASE_URL }}|" ./docker-compose.yml
sed -i "s|NEXT_PUBLIC_DOGU_WS_BASE_URL=.*$|NEXT_PUBLIC_DOGU_WS_BASE_URL=${{ secrets.DEV_DOGU_WS_BASE_URL }}|" ./docker-compose.yml
sed -i "s|NEXT_PUBLIC_FILE_SERVER_HOST=.*$|NEXT_PUBLIC_FILE_SERVER_HOST=${{ secrets.DEV_FILE_SERVER_HOST }}|" ./docker-compose.yml
echo "NEXT_PUBLIC_LANDING_URL=${{ secrets.DEV_DOGU_LANDING_URL }}" >> ./docker-compose.env
echo "NEXT_PUBLIC_DOGU_GA_ID=${{ secrets.DEV_DOGU_GA_ID }}" >> ./docker-compose.env
echo "NEXT_PUBLIC_SENTRY_DSN=${{ secrets.DOGU_SENTRY_DSN }}" >> ./docker-compose.env
# console - back
echo "DOGU_RUN_TYPE=development" >> ./docker-compose.env
sed -i "s|DOGU_API_BASE_URL=.*$|DOGU_API_BASE_URL=${{ secrets.DEV_DOGU_API_BASE_URL }}|" ./docker-compose.yml
echo "DOGU_RDS_SSL_CONNECTION=TRUE" >> ./docker-compose.env
sed -i "s|DOGU_CONSOLE_JWT_SECRET_KEY=.*$|DOGU_CONSOLE_JWT_SECRET_KEY=${{ secrets.DEV_DOGU_JWT_SECRET_KEY }}|" ./docker-compose.env
sed -i "s|DOGU_CONSOLE_DOMAIN=.*$|DOGU_CONSOLE_DOMAIN=${{ secrets.DEV_DOGU_CONSOLE_DOMAIN }}|" ./docker-compose.yml
echo "DOGU_DOST_DOWNLOAD_BASE_URL=${{ secrets.DEV_DOGU_DOST_DOWNLOAD_BASE_URL }}" >> ./docker-compose.env
echo "DOGU_EMAIL_ID=${{ secrets.DOGU_EMAIL_ID }}" >> ./docker-compose.env
echo "DOGU_EMAIL_PW=${{ secrets.DOGU_EMAIL_PW }}" >> ./docker-compose.env
sed -i "s|DOGU_RDS_HOST=.*$|DOGU_RDS_HOST=${{ secrets.DEV_DOGU_RDS_HOST }}|" ./docker-compose.yml
echo "DOGU_AWS_ACCESS_KEY=${{ secrets.AWS_DEV_SECRET_ACCESS_KEY }}" >> ./docker-compose.env
echo "DOGU_AWS_KEY_ID=${{ secrets.AWS_DEV_ACCESS_KEY_ID }}" >> ./docker-compose.env
echo "DOGU_USER_BUCKET=${{ secrets.DEV_DOGU_USER_BUCKET }}" >> ./docker-compose.env
echo "DOGU_ORGANIZATION_BUCKET=${{ secrets.DEV_DOGU_ORGANIZATION_BUCKET }}" >> ./docker-compose.env
echo "DOGU_PUBLIC_BUCKET=${{ secrets.DEV_DOGU_PUBLIC_BUCKET }}" >> ./docker-compose.env
echo "DOGU_RECAPTCHA_KEY=${{ secrets.DOGU_RECAPTCHA_KEY }}" >> ./docker-compose.env
echo "DOGU_CONSOLE_GOOGLE_OAUTH_LOGIN_CLIENT_ID=${{ secrets.DOGU_CONSOLE_GOOGLE_OAUTH_LOGIN_CLIENT_ID }}" >> ./docker-compose.env
echo "DOGU_CONSOLE_GOOGLE_OAUTH_LOGIN_CLIENT_SECRET=${{ secrets.DOGU_CONSOLE_GOOGLE_OAUTH_LOGIN_CLIENT_SECRET }}" >> ./docker-compose.env
echo "DOGU_SLACK_CLIENT_ID=${{ secrets.DOGU_SLACK_CLIENT_ID }}" >> ./docker-compose.env
echo "DOGU_SLACK_CLIENT_SECRET=${{ secrets.DOGU_SLACK_CLIENT_SECRET }}" >> ./docker-compose.env
# file server
sed -i "s|FILE_SERVER_USERNAME=.*$|FILE_SERVER_USERNAME=${{ secrets.DEV_DOGU_FILE_SERVER_USERNAME }}|" ./docker-compose.env
sed -i "s|FILE_SERVER_PASSWORD=.*$|FILE_SERVER_PASSWORD=${{ secrets.DEV_DOGU_FILE_SERVER_PASSWORD }}|" ./docker-compose.env
# turn server
sed -i "s|NEXT_PUBLIC_TURN_SERVER_HOST=.*$|NEXT_PUBLIC_TURN_SERVER_HOST=${{ secrets.DEV_DOGU_TURN_SERVER_HOST }}|" ./docker-compose.yml
sed -i "s|TURN_SERVER_USERNAME=.*$|TURN_SERVER_USERNAME=${{ secrets.DEV_DOGU_TURN_SERVER_USERNAME }}|" ./docker-compose.env
sed -i "s|TURN_SERVER_PASSWORD=.*$|TURN_SERVER_PASSWORD=${{ secrets.DEV_DOGU_TURN_SERVER_PASSWORD }}|" ./docker-compose.env
# billing
sed -i "s|DOGU_BILLING_SERVER_URL=.*$|DOGU_BILLING_SERVER_URL=${{ secrets.DEV_DOGU_BILLING_SERVER_URL }}|" ./docker-compose.yml
sed -i '/^ console:/a\ env_file:\n - docker-compose.env' docker-compose.yml
- name: run
run: |
docker ps -qa | xargs -r docker rm -f
docker pull ${{needs.input_validation.outputs.tag}}
docker compose -f ./docker-compose.yml --env-file ./docker-compose.env --verbose up redis influxdb coturn console -d