Skip to content

Commit efdd883

Browse files
authored
download the build from staging.replicated.app and install upon merge (#373)
* download the build from staging.replicated.app and install upon merge * install curl * fix paths * remove hardcoded version that allowed testing this from a branch
1 parent 506e076 commit efdd883

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

.github/workflows/release-dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
- TestMultiNodeReset
105105
- TestCommandsRequireSudo
106106
- TestInstallWithoutEmbed
107+
- TestInstallFromReplicatedApp
107108
steps:
108109
- name: Checkout
109110
uses: actions/checkout@v4

e2e/install_test.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,51 @@ func TestInstallWithoutEmbed(t *testing.T) {
356356
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))
357357
}
358358

359+
func TestInstallFromReplicatedApp(t *testing.T) {
360+
t.Parallel()
361+
tc := cluster.NewTestCluster(&cluster.Input{
362+
T: t,
363+
Nodes: 1,
364+
Image: "ubuntu/jammy",
365+
})
366+
defer tc.Destroy()
367+
t.Logf("%s: downloading embedded-cluster on node 0", time.Now().Format(time.RFC3339))
368+
line := []string{"vandoor-prepare.sh", os.Getenv("SHORT_SHA")}
369+
if stdout, stderr, err := RunCommandOnNode(t, tc, 0, line); err != nil {
370+
t.Log("stdout:", stdout)
371+
t.Log("stderr:", stderr)
372+
t.Fatalf("fail to download embedded-cluster on node 0 %s: %v", tc.Nodes[0], err)
373+
}
374+
375+
t.Logf("%s: installing embedded-cluster on node 0", time.Now().Format(time.RFC3339))
376+
line = []string{"single-node-install.sh"}
377+
if stdout, stderr, err := RunCommandOnNode(t, tc, 0, line); err != nil {
378+
t.Log("install stdout:", stdout)
379+
t.Log("install stderr:", stderr)
380+
t.Fatalf("fail to install embedded-cluster on node %s: %v", tc.Nodes[0], err)
381+
}
382+
383+
t.Logf("%s: checking installation state", time.Now().Format(time.RFC3339))
384+
line = []string{"check-installation-state.sh"}
385+
stdout, stderr, err := RunCommandOnNode(t, tc, 0, line)
386+
if err != nil {
387+
t.Log("stdout:", stdout)
388+
t.Log("stderr:", stderr)
389+
t.Fatalf("fail to check installation state: %v", err)
390+
}
391+
392+
t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339))
393+
line = []string{"check-postupgrade-state.sh", os.Getenv("SHORT_SHA")}
394+
stdout, stderr, err = RunCommandOnNode(t, tc, 0, line)
395+
if err != nil {
396+
t.Log("stdout:", stdout)
397+
t.Log("stderr:", stderr)
398+
t.Fatalf("fail to check postupgrade state: %v", err)
399+
}
400+
401+
t.Logf("%s: test complete", time.Now().Format(time.RFC3339))
402+
}
403+
359404
func runPuppeteerAppStatusCheck(t *testing.T, node int, tc *cluster.Output) {
360405
t.Logf("%s: installing puppeteer on node %d", time.Now().Format(time.RFC3339), node)
361406
line := []string{"install-puppeteer.sh"}

e2e/scripts/vandoor-prepare.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
5+
main() {
6+
local sha=
7+
sha="$1"
8+
9+
apt-get update
10+
apt-get install curl ca-certificates -y
11+
12+
curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/${sha}" -H 'Authorization: 2cHePFvlGDksGOKfTicouqJKGtZ' -o ec-release.tgz
13+
tar xzf ec-release.tgz
14+
15+
mv embedded-cluster-smoke-test-staging-app /usr/local/bin/embedded-cluster
16+
mv license.yaml /tmp/license.yaml
17+
}
18+
main "$@"

0 commit comments

Comments
 (0)