Skip to content

Commit

Permalink
Add environment variables
Browse files Browse the repository at this point in the history
Instead of repeating the path to the env file and hard coding the
environment name, add env.ENV_FILE and env.ENV_NAME.

Also try to use working-directory and always run from the test directory
for consistency.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed May 1, 2024
1 parent ba98e62 commit c608012
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on: # yamllint disable-line rule:truthy
env:
# Limit number of drenv workers.
MAX_WORKERS: 4
ENV_NAME: rdr
ENV_FILE: envs/regional-dr.yaml

jobs:
e2e-rdr:
Expand All @@ -31,46 +33,48 @@ jobs:
working-directory: test
run: |
source ../venv
drenv delete envs/regional-dr.yaml
drenv delete ${{ env.ENV_FILE }}
- name: Setup libvirt
run: test/scripts/setup-libvirt

- name: Start clusters
uses: nick-fields/retry@v3
working-directory: test
with:
timeout_minutes: 20
max_attempts: 3
command: |
cd test
source ../venv
drenv start --max-workers ${{ env.MAX_WORKERS }} envs/regional-dr.yaml
drenv start --max-workers ${{ env.MAX_WORKERS }} ${{ env.ENV_FILE }}
- name: Build ramen-operator container
run: make docker-build

- name: Deploy ramen
working-directory: test
run: |
source venv
ramenctl deploy test/envs/regional-dr.yaml
source ../venv
ramenctl deploy --source-dir .. ${{ env.ENV_FILE }}
- name: Configure ramen
uses: nick-fields/retry@v3
working-directory: test
with:
timeout_seconds: 60
max_attempts: 3
command: |
source venv
ramenctl config test/envs/regional-dr.yaml
source ../venv
ramenctl config ${{ env.ENV_FILE }}
- name: Run e2e tests
run: |
cp ~/.config/drenv/rdr/config.yaml e2e/config.yaml
cp ~/.config/drenv/${{ env.ENV_NAME }}/config.yaml e2e/config.yaml
make e2e-rdr
- name: Delete clusters
if: ${{ always() }}
working-directory: test
run: |
source ../venv
drenv delete envs/regional-dr.yaml
drenv delete ${{ env.ENV_FILE }}

0 comments on commit c608012

Please sign in to comment.