-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refines the shared environment template
TL;DR ----- Improves the shared environment template based on recent lab work Details ------- Updates the shared environment template based on recurring lifecycle script needs. * Assures all challenges have the minimal lifecycle scripts for each stage and host * Uses `/usr/bin/env bash` as the shebang for all lifecycle scripts * Sets `KUBECONFIG` or `HOME_DIR` variables at the start of each lifecycle script * Sets the most used agent variables in the track setup scripts * Adds `get_app_slug` to the header and refines it to use the application name instead of assuming the first app is the right one
- Loading branch information
Showing
27 changed files
with
211 additions
and
45 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/01-getting-to-know-the-template/check-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/01-getting-to-know-the-template/cleanup-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/01-getting-to-know-the-template/setup-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/01-getting-to-know-the-template/solve-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/02-using-the-template/check-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/02-using-the-template/cleanup-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
16 changes: 8 additions & 8 deletions
16
instruqt/shared-env-template/02-using-the-template/cleanup-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#!/bin/sh | ||
# | ||
# This script runs when the platform cleanup the challenge. | ||
# | ||
# The platform determines if the script was successful using the exit code of this | ||
# script. If the exit code is not 0, the script fails. | ||
# | ||
#!/usr/bin/env bash | ||
|
||
echo "This is the cleanup script" | ||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
HOME_DIR=/home/replicant | ||
# | ||
# clear the tmux pane and scrollback to look like a fresh shell | ||
tmux clear-history -t shell | ||
tmux send-keys -t shell clear ENTER | ||
|
||
exit 0 |
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/02-using-the-template/setup-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
19 changes: 19 additions & 0 deletions
19
instruqt/shared-env-template/02-using-the-template/setup-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
HOME_DIR=/home/replicant | ||
source /etc/profile/header.sh | ||
|
||
### Assure the tmux session exists | ||
# | ||
# In a test scenario Instuqt does not run the user shell for the | ||
# challenge, which means the tmux session is never established. We | ||
# need to session for the solve scripts for other challenges to | ||
# succeed, so let's create it here. | ||
# | ||
if ! tmux has-session -t shell ; then | ||
tmux new-session -d -s shell su - replicant | ||
fi | ||
|
||
exit 0 |
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/02-using-the-template/solve-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/03-tips-and-tricks/check-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
HOME_DIR=/home/replicant | ||
source /etc/profile/header.sh | ||
|
||
exit 0 |
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/03-tips-and-tricks/cleanup-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
9 changes: 9 additions & 0 deletions
9
instruqt/shared-env-template/03-tips-and-tricks/cleanup-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
HOME_DIR=/home/replicant | ||
source /etc/profile/header.sh | ||
|
||
exit 0 | ||
|
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/03-tips-and-tricks/setup-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
19 changes: 19 additions & 0 deletions
19
instruqt/shared-env-template/03-tips-and-tricks/setup-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
HOME_DIR=/home/replicant | ||
source /etc/profile/header.sh | ||
|
||
### Assure the tmux session exists | ||
# | ||
# In a test scenario Instuqt does not run the user shell for the | ||
# challenge, which means the tmux session is never established. We | ||
# need to session for the solve scripts for other challenges to | ||
# succeed, so let's create it here. | ||
# | ||
if ! tmux has-session -t shell ; then | ||
tmux new-session -d -s shell su - replicant | ||
fi | ||
|
||
exit 0 |
8 changes: 8 additions & 0 deletions
8
instruqt/shared-env-template/03-tips-and-tricks/solve-cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
source /etc/profile/header.sh | ||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This set line ensures that all failures will cause the script to error and exit | ||
set -euxo pipefail | ||
HOME_DIR=/home/replicant | ||
source /etc/profile/header.sh | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters