Skip to content

Commit

Permalink
rename privateKeyPath to gitRepoPrivateKeyPath
Browse files Browse the repository at this point in the history
export common env vars
  • Loading branch information
maciaszczykm committed Nov 25, 2024
1 parent dbc20e0 commit a233552
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ permissions:
env:
GOPATH: /home/runner/go/
GOBIN: /home/runner/go/bin
E2E_TESTOUT_PATH: /home/runner/testout
E2E_PRIVATE_KEY_PATH: /home/runner/private.key
PLURAL_LOGIN_AFFIRM_CURRENT_USER: true
PLURAL_UP_AFFIRM_DEPLOY: true
TESTOUT_PATH: /home/runner/testout
VENOM_VAR_directory: /home/runner/testout/azure
VENOM_VAR_gitRepo: [email protected]:pluralsh/plural-cli-e2e.git
VENOM_VAR_gitRepoPrivateKey: ${{ secrets.E2E_REPO_PRIVATE_KEY }}
VENOM_VAR_gitRepoPrivateKeyPath: /home/runner/private.key
jobs:
plural-up-gcp:
name: plural up / GCP
Expand All @@ -30,8 +33,8 @@ jobs:
run: echo "TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
- name: Retrieve the test repository private key and decode it to a file
run: |
(base64 -d <<< ${{ secrets.E2E_REPO_PRIVATE_KEY }}) >> ${{ env.E2E_PRIVATE_KEY_PATH }}
chmod 0600 ${{ env.E2E_PRIVATE_KEY_PATH }}
(base64 -d <<< ${{ secrets.E2E_REPO_PRIVATE_KEY }}) >> ${{ env.VENOM_VAR_gitRepoPrivateKeyPath }}
chmod 0600 ${{ env.VENOM_VAR_gitRepoPrivateKeyPath }}
- name: Setup Go
uses: actions/[email protected]
with:
Expand All @@ -54,13 +57,14 @@ jobs:
- name: Run tests
env:
VENOM_VAR_provider: gcp
# TODO
run: venom run -vv --html-report --format=json --output-dir ${{ env.E2E_TESTOUT_PATH }} --stop-on-failure test/plural
VENOM_VAR_region: us-central1
VENOM_VAR_project: e2e-${{ env.TIMESTAMP }}
run: venom run -vv --html-report --format=json --output-dir ${{ env.TESTOUT_PATH }} --stop-on-failure test/plural
- name: Upload test log
if: always()
uses: actions/upload-artifact@v4
with:
path: ${{ env.E2E_TESTOUT_PATH }}/venom.log
path: ${{ env.TESTOUT_PATH }}/venom.log
plural-up-azure:
name: plural up / Azure
runs-on: ubuntu-latest
Expand All @@ -73,8 +77,8 @@ jobs:
run: echo "TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
- name: Retrieve the test repository private key and decode it to a file
run: |
(base64 -d <<< ${{ secrets.E2E_REPO_PRIVATE_KEY }}) >> ${{ env.E2E_PRIVATE_KEY_PATH }}
chmod 0600 ${{ env.E2E_PRIVATE_KEY_PATH }}
(base64 -d <<< ${{ secrets.E2E_REPO_PRIVATE_KEY }}) >> ${{ env.VENOM_VAR_gitRepoPrivateKeyPath }}
chmod 0600 ${{ env.VENOM_VAR_gitRepoPrivateKeyPath }}
- name: Setup Go
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -108,18 +112,14 @@ jobs:
VENOM_VAR_azureSubscriptionId: ${{ secrets.E2E_AZURE_SUBSCRIPTION_ID }}
VENOM_VAR_azureStorageAccount: e2e${{ env.TIMESTAMP }}
VENOM_VAR_project: e2e-${{ env.TIMESTAMP }}
VENOM_VAR_directory: ${{ env.E2E_TESTOUT_PATH }}/azure
VENOM_VAR_gitRepo: [email protected]:pluralsh/plural-cli-e2e.git
VENOM_VAR_gitRepoPrivateKey: ${{ secrets.E2E_REPO_PRIVATE_KEY }}
VENOM_VAR_privateKeyPath: ${{ env.E2E_PRIVATE_KEY_PATH }}
VENOM_VAR_branch: e2e-azure-${{ env.TIMESTAMP }}
VENOM_VAR_username: ${{ secrets.E2E_AZURE_SA_USERNAME }}
VENOM_VAR_email: ${{ secrets.E2E_AZURE_SA_EMAIL }}
VENOM_VAR_token: ${{ secrets.E2E_AZURE_SA_TOKEN }}
VENOM_VAR_pluralHome: ${{ env.HOME }}/.plural
run: venom run -vv --html-report --format=json --output-dir ${{ env.E2E_TESTOUT_PATH }} --stop-on-failure test/plural
run: venom run -vv --html-report --format=json --output-dir ${{ env.TESTOUT_PATH }} --stop-on-failure test/plural
- name: Upload test log
if: always()
uses: actions/upload-artifact@v4
with:
path: ${{ env.E2E_TESTOUT_PATH }}/venom.log
path: ${{ env.TESTOUT_PATH }}/venom.log
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ e2e: --ensure-venom
VENOM_VAR_email=${PLRL_CLI_E2E_SA_EMAIL} \
VENOM_VAR_gitRepo=${PLRL_CLI_E2E_GIT_REPO} \
VENOM_VAR_gitRepoPrivateKey=${PLRL_CLI_E2E_PRIVATE_KEY} \
VENOM_VAR_privateKeyPath=${PLRL_CLI_E2E_PRIVATE_KEY_PATH} \
VENOM_VAR_gitRepoPrivateKeyPath=${PLRL_CLI_E2E_PRIVATE_KEY_PATH} \
VENOM_VAR_username=${PLRL_CLI_E2E_SA_USERNAME} \
VENOM_VAR_token=${PLRL_CLI_E2E_SA_TOKEN} \
VENOM_VAR_pluralHome=${HOME}/.plural \
Expand Down
6 changes: 3 additions & 3 deletions test/plural/lib/check-required.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ input:
directory: ''
email: ''
gitRepo: ''
privateKeyPath: ''
gitRepoPrivateKeyPath: ''
gitRepoPrivateKey: ''
username: ''
token: ''
pluralHome: ''
gitRepoPrivateKey: ''
project: ''
provider: ''
region: ''
Expand All @@ -35,7 +35,7 @@ steps:
- result.systemout ShouldMatchRegex '^Git Repo .+$'

- name: Private Key Path
script: "echo Private Key Path {{ .input.privateKeyPath }}"
script: "echo Private Key Path {{ .input.gitRepoPrivateKeyPath }}"
assertions:
- result.systemout ShouldMatchRegex '^Private Key Path .+$'

Expand Down
6 changes: 3 additions & 3 deletions test/plural/lib/git-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ input:
directory: ''
email: ''
gitRepo: ''
privateKeyPath: ''
gitRepoPrivateKeyPath: ''
username: ''
steps:
- script: |
git -c core.sshCommand="ssh -i {{ .input.privateKeyPath }}" clone {{ .input.gitRepo }} "{{ .input.directory }}" ;\
git -c core.sshCommand="ssh -i {{ .input.gitRepoPrivateKeyPath }}" clone {{ .input.gitRepo }} "{{ .input.directory }}" ;\
cd {{ .input.directory }} ;\
git config --local user.email {{ .input.email }} ;\
git config --local user.name {{ .input.username }} ;\
git checkout -b {{ .input.branch }} ;\
GIT_SSH_COMMAND='ssh -i {{ .input.privateKeyPath }} -o IdentitiesOnly=yes -F /dev/null' git push -u origin {{ .input.branch }}
GIT_SSH_COMMAND='ssh -i {{ .input.gitRepoPrivateKeyPath }} -o IdentitiesOnly=yes -F /dev/null' git push -u origin {{ .input.branch }}
info:
- 'Git Repository: {{ .input.gitRepo }}'
2 changes: 1 addition & 1 deletion test/plural/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vars:
# Git repository address used to run 'plural up' and store generated files
gitRepo: ''
# SSH key path used to access git repository
privateKeyPath: ''
gitRepoPrivateKeyPath: ''
# Plural user name
username: ''
# Plural user acess token
Expand Down

0 comments on commit a233552

Please sign in to comment.