Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Atlantis. Make usage of OpenTofu more verbose #1506

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pr:
resources:
containers:
- container: prime
image: dfdsdk/prime-pipeline:1.0.0
image: dfdsdk/prime-pipeline:2.0.0
env:
AWS_DEFAULT_REGION: eu-west-1
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
Expand All @@ -35,6 +35,8 @@ resources:
TF_VAR_grafana_agent_loki_username: $(TF_VAR_grafana_agent_loki_username)
TF_VAR_grafana_agent_tempo_url: $(TF_VAR_grafana_agent_tempo_url)
TF_VAR_grafana_agent_tempo_username: $(TF_VAR_grafana_agent_tempo_username)
TF_IN_AUTOMATION: "true"
TERRAGRUNT_TFPATH: /usr/local/bin/tofu
- container: aws-nuke
image: dfdsdk/aws-nuke:0.0.20
env:
Expand Down
96 changes: 49 additions & 47 deletions src/qa-test-eks.sh
Original file line number Diff line number Diff line change
@@ -1,80 +1,82 @@
#!/bin/bash
set -eux #-o pipefail

if [[ -z ${TERRAGRUNT_TFPATH+x} ]]; then
echo "TERRAGRUNT_TFPATH is unset"
else
echo "TERRAGRUNT_TFPATH is set to ${TERRAGRUNT_TFPATH}"
fi

BASEPATH=./test/integration
ACTION=$1


if [ "$ACTION" = "apply-shared" ]; then
SUBPATH=$2
WORKDIR="${BASEPATH}/${SUBPATH}"
SUBPATH=$2
WORKDIR="${BASEPATH}/${SUBPATH}"

# Apply the configuration
terragrunt run-all apply --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
# Apply the configuration
terragrunt run-all apply --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
fi

if [ "$ACTION" = "apply-cluster" ]; then
REGION=$2
CLUSTERNAME=$3
WORKDIR="${BASEPATH}/${REGION}/k8s-${CLUSTERNAME}"
REGION=$2
CLUSTERNAME=$3
WORKDIR="${BASEPATH}/${REGION}/k8s-${CLUSTERNAME}"

# Apply the configuration
terragrunt run-all apply --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
# Apply the configuration
terragrunt run-all apply --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
fi

if [ "$ACTION" = "test-build" ]; then
TEST_BINARY_PATH=$4
TEST_BINARY_PATH=$4

# Debugging
go version
(cd "${BASEPATH}/suite" && exec go env || true)
# Debugging
go version
(cd "${BASEPATH}/suite" && exec go env || true)

# Build test suite
(cd "${BASEPATH}/suite" && exec go test -c -v -vet=off -o $TEST_BINARY_PATH)
# Build test suite
(cd "${BASEPATH}/suite" && exec go test -c -v -vet=off -o $TEST_BINARY_PATH)
fi


if [ "$ACTION" = "test-run" ]; then
# Get kubeconfig path
REGION=$2
CLUSTERNAME=$3
WORKDIR="${BASEPATH}/${REGION}/k8s-${CLUSTERNAME}/cluster"
export KUBECONFIG=$(terragrunt output --raw kubeconfig_path --terragrunt-working-dir "$WORKDIR")
TEST_BINARY_PATH=$4

# Make executable
chmod a+x $TEST_BINARY_PATH

# Run test suite
exec $TEST_BINARY_PATH -test.v -test.parallel 30
# Get kubeconfig path
REGION=$2
CLUSTERNAME=$3
WORKDIR="${BASEPATH}/${REGION}/k8s-${CLUSTERNAME}/cluster"
export KUBECONFIG=$(terragrunt output --raw kubeconfig_path --terragrunt-working-dir "$WORKDIR")
TEST_BINARY_PATH=$4

# Make executable
chmod a+x $TEST_BINARY_PATH

# Run test suite
exec $TEST_BINARY_PATH -test.v -test.parallel 30
fi


if [ "$ACTION" = "destroy-cluster" ]; then
REGION=$2
CLUSTERNAME=$3
WORKDIR="${BASEPATH}/${REGION}/k8s-${CLUSTERNAME}"
REGION=$2
CLUSTERNAME=$3
WORKDIR="${BASEPATH}/${REGION}/k8s-${CLUSTERNAME}"

# Destroy resources
terragrunt destroy-all --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
# Destroy resources
terragrunt destroy-all --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
fi


if [ "$ACTION" = "destroy-public-bucket" ]; then
REGION=$2
SUBPATH=$3
WORKDIR="${BASEPATH}/${SUBPATH}"
REGION=$2
SUBPATH=$3
WORKDIR="${BASEPATH}/${SUBPATH}"

# Destroy resources
terragrunt run-all destroy --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
# Destroy resources
terragrunt run-all destroy --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
fi

if [ "$ACTION" = "destroy-velero-bucket" ]; then
RETURN=0
REGION=$2
SUBPATH=$3
WORKDIR="${BASEPATH}/${SUBPATH}"
RETURN=0
REGION=$2
SUBPATH=$3
WORKDIR="${BASEPATH}/${SUBPATH}"

# Destroy resources
terragrunt run-all destroy --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
# Destroy resources
terragrunt run-all destroy --terragrunt-working-dir "$WORKDIR" --terragrunt-source-update --terragrunt-non-interactive -input=false -auto-approve
fi
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ inputs = {
atlantis_webhook_events = ["issue_comment", "pull_request", "pull_request_review", "push"]
atlantis_chart_version = "4.25.0"
atlantis_environment = "qa"
atlantis_image_tag = "0.0.55"
atlantis_image_tag = "2.0.0"
atlantis_add_secret_volumes = true

# --------------------------------------------------
Expand Down