Skip to content

Commit b13bc9a

Browse files
authored
use license from github secret (#375)
1 parent efdd883 commit b13bc9a

File tree

6 files changed

+16
-26
lines changed

6 files changed

+16
-26
lines changed

.github/actions/e2e/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ inputs:
44
test-name:
55
description: 'individual test to run'
66
required: true
7+
license-id:
8+
description: 'license id to use for e2e tests'
9+
required: true
10+
license:
11+
description: 'license (b64) to use for e2e tests'
12+
required: true
713

814
runs:
915
using: composite
@@ -44,4 +50,6 @@ runs:
4450
shell: bash
4551
run: |
4652
export SHORT_SHA=$(git rev-parse --short=7 HEAD)
53+
export LICENSE_ID=${{ inputs.license-id }}
54+
echo "${{ inputs.license }}" | base64 --decode > e2e/license.yaml
4755
make e2e-test TEST_NAME=${{ inputs.test-name }}

.github/workflows/pull-request.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,5 @@ jobs:
136136
if: github.actor != 'dependabot[bot]'
137137
with:
138138
test-name: '${{ matrix.tests }}'
139+
license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE_ID }}
140+
license: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE }}

.github/workflows/release-dev.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,5 @@ jobs:
116116
- uses: ./.github/actions/e2e
117117
with:
118118
test-name: '${{ matrix.tests }}'
119+
license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE_ID }}
120+
license: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE }}

e2e/install_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func TestInstallFromReplicatedApp(t *testing.T) {
365365
})
366366
defer tc.Destroy()
367367
t.Logf("%s: downloading embedded-cluster on node 0", time.Now().Format(time.RFC3339))
368-
line := []string{"vandoor-prepare.sh", os.Getenv("SHORT_SHA")}
368+
line := []string{"vandoor-prepare.sh", os.Getenv("SHORT_SHA"), os.Getenv("LICENSE_ID")}
369369
if stdout, stderr, err := RunCommandOnNode(t, tc, 0, line); err != nil {
370370
t.Log("stdout:", stdout)
371371
t.Log("stderr:", stderr)

e2e/license.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

e2e/scripts/vandoor-prepare.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ set -euo pipefail
55
main() {
66
local sha=
77
sha="$1"
8+
local license_id=
9+
license_id="$2"
810

911
apt-get update
1012
apt-get install curl ca-certificates -y
1113

12-
curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/${sha}" -H 'Authorization: 2cHePFvlGDksGOKfTicouqJKGtZ' -o ec-release.tgz
14+
curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/${sha}" -H "Authorization: ${license_id}" -o ec-release.tgz
1315
tar xzf ec-release.tgz
1416

1517
mv embedded-cluster-smoke-test-staging-app /usr/local/bin/embedded-cluster

0 commit comments

Comments
 (0)