-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fe8ee8
commit a671153
Showing
6 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ dist | |
.env* | ||
!.env.example | ||
cosign* | ||
image-refs.txt | ||
image-refs.txt | ||
!/bin/*.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
export IMAGE_DIGESTS_FILE="$SCRIPT_DIR/../image-refs.txt" | ||
export KUBECONFIG="$SCRIPT_DIR/../.kube/config.internal" | ||
k3d kubeconfig get "$K3D_CLUSTER_NAME" > "$KUBECONFIG" | ||
|
||
k3d kubeconfig get "${K3D_CLUSTER_NAME}" > "${KUBECONFIG}" | ||
echo "" > "$IMAGE_DIGESTS_FILE" | ||
|
||
echo "$IMAGE_REGISTRY_PASSWORD" | ko login $IMAGE_REGISTRY -u "$IMAGE_REGISTRY_USERNAME" --password-stdin | ||
ko build --bare --tags="$IMAGE_TAG" --platform=linux/amd64 --platform=linux/arm64 --image-refs="$IMAGE_DIGESTS_FILE" | ||
|
||
while read -r img_ref; do cosign sign --key="$COSIGN_PRIVATE_KEY" "$img_ref" | jq .; done < "$IMAGE_DIGESTS_FILE" |
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 | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
drone exec --trusted --env-file="$SCRIPT_DIR/../.env" --pipeline=delete-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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
docker network create --opt "com.docker.network.driver.mtu=1450"\ | ||
"${K3D_CLUSTER_NAME}" || true | ||
|
||
drone exec --trusted --env-file="${SCRIPT_DIR}/../.env" --network="${K3D_CLUSTER_NAME}" --pipeline=setup | ||
|
||
KUBECONFIG="${SCRIPT_DIR}/../.kube/config" | ||
mkdir -p "$(dirname "$KUBECONFIG")" | ||
|
||
k3d kubeconfig get "${K3D_CLUSTER_NAME}" > "${KUBECONFIG}" | ||
sed -i 's|host.docker.internal|127.0.0.1|' "${KUBECONFIG}" |
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
export IMAGE_DIGESTS_FILE="$SCRIPT_DIR/../image-refs.txt" | ||
export KUBECONFIG="$SCRIPT_DIR/../.kube/config.internal" | ||
|
||
if [ ! -f "$KUBECONFIG" ]; | ||
then | ||
k3d kubeconfig get "$K3D_CLUSTER_NAME" > "$KUBECONFIG" | ||
fi | ||
|
||
echo "$IMAGE_REGISTRY_PASSWORD" | ko login "$IMAGE_REGISTRY" -u "$IMAGE_REGISTRY_USERNAME" --password-stdin | ||
|
||
while read -r img_ref; do cosign verify --key="$COSIGN_PUBLIC_KEY" "$img_ref" | jq .; done < "$IMAGE_DIGESTS_FILE" | ||
|