diff --git a/.github/workflows/release-service-apps-proxy.yml b/.github/workflows/release-service-apps-proxy.yml index d7405bf69f..501bad811a 100644 --- a/.github/workflows/release-service-apps-proxy.yml +++ b/.github/workflows/release-service-apps-proxy.yml @@ -3,7 +3,8 @@ name: 'Release: Apps Proxy' on: push: tags: - - 'apps-proxy-v**' + - 'production-apps-proxy-v**' + - 'dev-apps-proxy-v**' env: # DockerHub login @@ -86,3 +87,10 @@ jobs: acrRegistry: ${{ env.ACR_REGISTRY }} acrUsername: ${{ env.ACR_USERNAME }} acrPassword: ${{ secrets.APPS_PROXY_ACR_PASSWORD }} + + - name: Trigger image tag update + uses: keboola/kbc-stacks/.github/actions/trigger-image-tag-update@main + with: + helm-chart: "apps-proxy" + image-tag: ${{ env.IMAGE_TAG }} + github-app-private-key: ${{ secrets.GITOPS_KBC_STACKS_TRIGGER_APP_PVK }} diff --git a/provisioning/apps-proxy/gcp.sh b/provisioning/apps-proxy/gcp.sh deleted file mode 100644 index 8eef2cf772..0000000000 --- a/provisioning/apps-proxy/gcp.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -terraform_output () { - terraform -chdir=./gcp output -raw $1 -} - -SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "${SCRIPT_PATH}" - - -if [ -n "${TF_INIT_ONLY:-}" ]; then - terraform init -no-color -backend=false - exit 0 -fi - -echo "" -echo "Terraform backend configuration:" -echo "bucket=${TERRAFORM_REMOTE_STATE_BUCKET}" -echo "" - -terraform -chdir=./gcp init -input=false -no-color \ - -backend-config="bucket=${TERRAFORM_REMOTE_STATE_BUCKET}" \ - -backend-config="prefix=keboola-as-code/apps-proxy" - -echo "=> Validating configuration" -terraform validate -no-color - -echo "=> Planning changes" -terraform -chdir=./gcp plan -input=false -no-color -out=terraform.tfplan \ - -var "terraform_remote_state_bucket=${TERRAFORM_REMOTE_STATE_BUCKET}" - -echo "=> Applying changes" -terraform -chdir=./gcp apply -no-color terraform.tfplan - -# Authorize to GKE -GKE_CLUSTER_NAME=$(terraform_output main_gke_cluster_name) -GKE_CLUSTER_LOCATION=$(terraform_output main_gke_cluster_location) - -echo $GKE_CLUSTER_NAME -echo $GKE_CLUSTER_LOCATION - -gcloud auth login --cred-file=$GOOGLE_APPLICATION_CREDENTIALS - -# https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke -echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list -curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - -sudo apt update -sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin - -gcloud container clusters get-credentials $GKE_CLUSTER_NAME --region $GKE_CLUSTER_LOCATION --project $GCP_PROJECT - -# Common part of the deploy -. ./common.sh - -# GCP specific part of the deploy -kubectl apply -f ./kubernetes/deploy/cloud/gcp/service.yaml -kubectl apply -f ./kubernetes/deploy/cloud/gcp/ingress.yaml - -# Wait for the rollout -. ./wait.sh diff --git a/provisioning/apps-proxy/gcp/.gitignore b/provisioning/apps-proxy/gcp/.gitignore deleted file mode 100644 index 810ec2b952..0000000000 --- a/provisioning/apps-proxy/gcp/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# Local .terraform directories -**/.terraform/* - -# .tfstate files -*.tfstate -*.tfstate.* - -# Crash log files -crash.log - -# Exclude all .tfvars files, which are likely to contain sentitive data, such as -# password, private keys, and other secrets. These should not be part of version -# control as they are data points which are potentially sensitive and subject -# to change depending on the environment. -# -*.tfvars - -# Ignore override files as they are usually used to override resources locally and so -# are not checked in -override.tf -override.tf.json -*_override.tf -*_override.tf.json - -# Include override files you do wish to add to version control using negated pattern -# -# !example_override.tf - -# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan -# example: *tfplan* - -# Ignore CLI configuration files -.terraformrc -terraform.rc - -terraform.tfplan - -.env \ No newline at end of file diff --git a/provisioning/apps-proxy/gcp/main.tf b/provisioning/apps-proxy/gcp/main.tf deleted file mode 100644 index c625395e72..0000000000 --- a/provisioning/apps-proxy/gcp/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -terraform { - required_version = "~> 1.1" - backend "gcs" {} -} - -# Read shared infrastructure outputs -data "terraform_remote_state" "infrastructure" { - backend = "gcs" - - config = { - bucket = var.terraform_remote_state_bucket - prefix = "infrastructure/output" - } -} - -output "main_gke_cluster_name" { - value = data.terraform_remote_state.infrastructure.outputs.main_gke_cluster_name -} - -output "main_gke_cluster_location" { - value = data.terraform_remote_state.infrastructure.outputs.main_gke_cluster_location -} \ No newline at end of file diff --git a/provisioning/apps-proxy/gcp/variables.tf b/provisioning/apps-proxy/gcp/variables.tf deleted file mode 100644 index 0b824daac3..0000000000 --- a/provisioning/apps-proxy/gcp/variables.tf +++ /dev/null @@ -1,3 +0,0 @@ -variable "terraform_remote_state_bucket" { - type = string -}