mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-08-05 18:31:00 +03:00
change pipeline generation + add tf dockerfile
This commit is contained in:
parent
c737d77f54
commit
06f4246c07
@ -3,7 +3,7 @@ stages:
|
||||
- trigger
|
||||
|
||||
variables:
|
||||
TERRAFORM_IMAGE_NAME: cr.yandex/crp3ccidau046kdj8g9q/terraform/terragrunt:v0.9.9
|
||||
TERRAFORM_IMAGE_NAME: cr.yandex/crp3ccidau046kdj8g9q/terraform/terragrunt:v9.9
|
||||
|
||||
generate-pipeline:
|
||||
stage: generate
|
||||
|
||||
@ -12,11 +12,8 @@ ARG TERRAGRUNT_VERSION=0.93.11
|
||||
RUN curl -fsSL https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 -o /usr/local/bin/terragrunt && \
|
||||
chmod +x /usr/local/bin/terragrunt
|
||||
|
||||
# Create plugin cache directory - Terraform will download providers here from Yandex mirror
|
||||
RUN mkdir -p /root/.terraform.d/plugin-cache
|
||||
|
||||
# Configure Terraform to use Yandex Terraform registry mirror
|
||||
RUN mkdir -p /root/.terraform.d && \
|
||||
RUN mkdir -p /root/.terraform.d/plugin-cache && \
|
||||
mkdir -p /root/.terraform.d && \
|
||||
echo 'provider_installation {' > /root/.terraformrc && \
|
||||
echo ' network_mirror {' >> /root/.terraformrc && \
|
||||
echo ' url = "https://terraform-mirror.yandexcloud.net/"' >> /root/.terraformrc && \
|
||||
|
||||
@ -91,11 +91,10 @@ validate-${job_prefix}:
|
||||
- cd \${TG_ROOT}
|
||||
- ls -la
|
||||
- rm -rf .terragrunt-cache
|
||||
- export TF_PLUGIN_CACHE_DIR=/root/.terraform.d/plugins
|
||||
- export TF_PLUGIN_CACHE_DIR=/root/.terraform.d/plugin-cache
|
||||
script:
|
||||
- env | grep -E "(S3_|AWS_)" || echo "No S3/AWS vars found"
|
||||
- terragrunt init -reconfigure
|
||||
- terragrunt validate-inputs
|
||||
- terragrunt validate
|
||||
rules:
|
||||
- if: '\$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
@ -129,12 +128,7 @@ plan-${job_prefix}:
|
||||
- ls -la
|
||||
- rm -rf .terragrunt-cache
|
||||
script:
|
||||
- terragrunt init -reconfigure || true
|
||||
- echo "=== Checking generated backend.tf ==="
|
||||
- find .terragrunt-cache -name "backend.tf" -exec echo "=== {} ===" \; -exec head -15 {} \; 2>/dev/null || echo "No backend.tf found"
|
||||
- echo "=== Environment variables ==="
|
||||
- env | grep -E "(S3_|AWS_)" || echo "No S3/AWS vars found"
|
||||
- exit 1
|
||||
- terragrunt init -reconfigure
|
||||
- terragrunt plan -out=tfplan
|
||||
rules:
|
||||
- if: '\$CI_COMMIT_BRANCH == "master" || \$CI_COMMIT_BRANCH == "main"'
|
||||
@ -181,11 +175,6 @@ apply-${job_prefix}:
|
||||
- rm -rf .terragrunt-cache
|
||||
script:
|
||||
- terragrunt init -reconfigure || true
|
||||
- echo "=== Checking generated backend.tf ==="
|
||||
- find .terragrunt-cache -name "backend.tf" -exec echo "=== {} ===" \; -exec head -15 {} \; 2>/dev/null || echo "No backend.tf found"
|
||||
- echo "=== Environment variables ==="
|
||||
- env | grep -E "(S3_|AWS_)" || echo "No S3/AWS vars found"
|
||||
- exit 1
|
||||
- terragrunt apply tfplan
|
||||
rules:
|
||||
- if: '\$CI_COMMIT_BRANCH == "master" || \$CI_COMMIT_BRANCH == "main"'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user