ci: extract postgres_password from .env in remote machine
This commit is contained in:
parent
cc3334438e
commit
7c6d94fc5f
2 changed files with 11 additions and 1 deletions
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -9,6 +9,7 @@ env:
|
|||
APPS_REPO_ID: repo-id
|
||||
INTERNAL_IP: localhost
|
||||
REDIS_HOST: redis
|
||||
REDIS_PASSWORD: redis
|
||||
APPS_REPO_URL: https://repo.github.com/
|
||||
DOMAIN: localhost
|
||||
LOCAL_DOMAIN: tipi.lan
|
||||
|
|
11
.github/workflows/e2e.yml
vendored
11
.github/workflows/e2e.yml
vendored
|
@ -21,6 +21,7 @@ jobs:
|
|||
outputs:
|
||||
droplet_id: ${{ steps.create-droplet.outputs.droplet_id }}
|
||||
droplet_ip: ${{ steps.get-droplet-ip.outputs.droplet_ip }}
|
||||
postgres_password: ${{ steps.get-postgres-password.outputs.postgres_password }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -94,6 +95,12 @@ jobs:
|
|||
user: root # TODO: use non-root user
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
|
||||
- name: Get POSTGRES_PASSWORD from .env file
|
||||
id: get-postgres-password
|
||||
run: |
|
||||
postgres_password=$(ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ steps.get-droplet-ip.outputs.droplet_ip }} "cat ./runtipi/.env | grep POSTGRES_PASSWORD | cut -d '=' -f2")
|
||||
echo "postgres_password=$postgres_password" >> $GITHUB_OUTPUT
|
||||
|
||||
e2e:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -126,7 +133,9 @@ jobs:
|
|||
node-version: 18
|
||||
|
||||
- name: Create .env.e2e file with Droplet IP
|
||||
run: echo "SERVER_IP=${{ needs.deploy.outputs.droplet_ip }}" > .env.e2e
|
||||
run: |
|
||||
echo "SERVER_IP=${{ needs.deploy.outputs.droplet_ip }}" > .env.e2e
|
||||
echo "POSTGRES_PASSWORD=${{ needs.deploy.outputs.postgres_password }}" >> .env.e2e
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
|
Loading…
Add table
Reference in a new issue