-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aeec8e
commit 8648de7
Showing
7 changed files
with
108 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
name: Deploy 1.3.x | ||
|
||
on: | ||
schedule: | ||
- cron: '30 1 * * 1-5' | ||
workflow_dispatch: | ||
inputs: | ||
skip_tests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Deploy integration | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "Version of Gally's packages (ex: master or 1.0.x)" | ||
required: true | ||
type: string | ||
last_published_version: | ||
description: "Last release of the current version" | ||
required: false | ||
default: "dev-master" | ||
type: string | ||
back_version_is_tag: | ||
description: "Back version to deploy is a tag ?" | ||
required: false | ||
default: false | ||
type: boolean | ||
front_version_is_tag: | ||
description: "Front version to deploy is a tag ?" | ||
required: false | ||
default: false | ||
type: boolean | ||
secrets: | ||
AWS_DEPLOY_KEY: | ||
required: true | ||
AWS_HOSTNAME: | ||
required: true | ||
AWS_USER: | ||
required: true | ||
APP_SECRET: | ||
required: true | ||
POSTGRES_PASSWORD: | ||
required: true | ||
COMPOSER_AUTH: | ||
required: true | ||
PACKAGIST_URL: | ||
required: true | ||
MEDIA_URL: | ||
required: false | ||
|
||
jobs: | ||
deploy: | ||
name: Integration | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Deploy in EC2 | ||
env: | ||
back_branch: ${{ inputs.back_version_is_tag == true && format('tags/{0}', inputs.version) || format('origin/{0}', inputs.version) }} | ||
front_branch: ${{ inputs.version == 'master' && 'origin/main' || inputs.front_version_is_tag == true && format('tags/v{0}', inputs.version) || format('origin/{0}', inputs.version) }} | ||
composer_version: ${{ inputs.version == 'master' && 'dev-master' || (contains(inputs.version, 'x') && format('{0}-dev', inputs.version) || inputs.version) }} | ||
PRIVATE_KEY: ${{ secrets.AWS_DEPLOY_KEY }} | ||
HOSTNAME : ${{ secrets.AWS_HOSTNAME }} | ||
USER_NAME : ${{ secrets.AWS_USER }} | ||
APP_SECRET: ${{ secrets.APP_SECRET }} | ||
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} | ||
PACKAGIST_URL: ${{ secrets.PACKAGIST_URL }} | ||
MEDIA_URL: ${{ secrets.MEDIA_URL }} | ||
run: | | ||
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | ||
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -i private_key ${USER_NAME}@${HOSTNAME} " | ||
cd /home/ubuntu/ && | ||
[ -d gally ] || git clone https://github.com/Elastic-Suite/gally.git gally && | ||
cd /home/ubuntu/gally && | ||
docker system prune -af && | ||
([[ $(docker volume ls -q | awk '!/_/' | wc -l) -eq 0 ]] || docker volume rm $(docker volume ls -q | awk '!/_/' | tr '\n' ' ')) && | ||
make .env && | ||
<<<<<<< HEAD | ||
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml -f compose.int.yml up -d database && | ||
docker compose -f compose.yml -f compose.int.yml down && | ||
======= | ||
POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker compose -f compose.yml -f compose.int.yml up -d database && | ||
docker-compose down && | ||
>>>>>>> origin/1.3.x | ||
git fetch --all && git reset --hard && git checkout ${{ env.back_branch }} && | ||
[ -d front/gally-admin ] || git clone https://github.com/Elastic-Suite/gally-admin.git front/gally-admin && | ||
cd front/gally-admin && git fetch --all && git reset --hard && git checkout ${{ env.front_branch }} && | ||
cd /home/ubuntu/gally && | ||
SERVER_NAME=$HOSTNAME docker compose -f compose.init_certs.yml build && | ||
SERVER_NAME=$HOSTNAME docker compose -f compose.init_certs.yml up proxy_init_certs -d && | ||
SERVER_NAME=$HOSTNAME docker compose -f compose.init_certs.yml up certbot_init_certs && | ||
docker compose -f compose.init_certs.yml down && | ||
docker compose run --rm php rm -rf vendor/gally/gally-premium && | ||
docker compose run --rm php composer config repositories.gally-premium composer $PACKAGIST_URL && | ||
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-standard:${{ env.composer_version }} as ${{ inputs.last_published_version }}\" && | ||
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-premium:${{ env.composer_version }}\" && | ||
docker compose run --rm -e COMPOSER_AUTH='$COMPOSER_AUTH' php composer require \"gally/gally-sample-data:${{ env.composer_version }}\" && | ||
docker compose run --rm php sed -i \"s/DoctrineFixturesBundle::class => \['dev' => true, 'test' => true]/DoctrineFixturesBundle::class => ['all' => true]/g\" config/bundles.php && | ||
GALLY_CATALOG_MEDIA_URL=${MEDIA_URL} SERVER_NAME=$HOSTNAME API_ROUTE_PREFIX=api APP_SECRET=$APP_SECRET POSTGRES_PASSWORD=$POSTGRES_PASSWORD COMPOSER_AUTH='$COMPOSER_AUTH' docker compose -f compose.yml -f compose.int.yml up -d --build | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.