Skip to content

Commit

Permalink
Configure le tunnel SSH pour les migrations Metabase (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca authored Dec 17, 2024
1 parent 5c55af9 commit cafbb7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/metabase_migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,23 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-
- name: Install Scalingo CLI
run: curl -O https://cli-dl.scalingo.com/install && bash install

- name: Install SSH key
# Credit: https://stackoverflow.com/a/69234389
run: |
mkdir -p ~/.ssh
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.GH_SCALINGO_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
- name: Add Scalingo as a known host
run: |
ssh-keyscan -H ssh.osc-fr1.scalingo.com >> ~/.ssh/known_hosts
- name: Init environment variables
run: |
echo "METABASE_DATABASE_URL=${{ secrets.METABASE_MIGRATIONS_METABASE_DATABASE_URL }}" >> .env
echo "METABASE_DATABASE_URL=${{ secrets.METABASE_MIGRATIONS_METABASE_DATABASE_URL }}" >> .env.local
- name: CI
run: make ci_metabase_migrate BIN_COMPOSER="composer" BIN_CONSOLE="php bin/console"
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ ci_bdtopo_migrate: ## Run CI steps for BD TOPO Migrate workflow

ci_metabase_migrate: ## Run CI steps for Metabase Migrate workflow
make composer CMD="install -n --prefer-dist"
scalingo login --ssh --ssh-identity ~/.ssh/id_rsa
./tools/scalingodbtunnel dialog-metabase --host-url --port 10001 & ./tools/wait-for-it.sh 127.0.0.1:10001
make metabase_migrate

ci_metabase_export: ## Export data to Metabase
Expand Down

0 comments on commit cafbb7f

Please sign in to comment.