change pipeline generation + add tf dockerfile

This commit is contained in:
Work 2026-01-26 16:15:57 +03:00
parent df6809b2e3
commit 19204b4ae1

View File

@ -96,8 +96,19 @@ validate-${job_prefix}:
- export S3_SECRET_KEY="\${S3_SECRET_KEY}"
- cd \${TG_ROOT}
- ls -la
- rm -rf .terragrunt-cache
- export TF_PLUGIN_CACHE_DIR=/root/.terraform.d/plugin-cache
- |
if [ -n "$needs_deps" ]; then
for dep in $needs_deps; do
dep_component=$(echo "$dep" | sed "s/validate-${env}-//")
dep_cache_path="${component_dir}/../${dep_component}/.terragrunt-cache"
if [ -d "${dep_cache_path}" ]; then
echo "Restoring .terragrunt-cache from ${dep_component}"
mkdir -p .terragrunt-cache
cp -r "${dep_cache_path}"/* .terragrunt-cache/ 2>/dev/null || true
fi
done
fi
script:
- env | grep -E "(S3_|AWS_)" || echo "No S3/AWS vars found"
- terragrunt init -upgrade -reconfigure
@ -108,11 +119,22 @@ validate-${job_prefix}:
- if: '\$CI_COMMIT_BRANCH =~ /^feature\/.*/'
- if: '\$CI_PIPELINE_SOURCE == "pipeline"'
interruptible: true
artifacts:
paths:
- "\${TG_ROOT}/.terragrunt-cache/**/*"
expire_in: 1 hour
when: always
EOF
if [ -n "$needs_deps" ]; then
cat >> "$OUTPUT_FILE" << EOF
needs:
EOF
for dep in $needs_deps; do
echo " - ${dep}" >> "$OUTPUT_FILE"
done
cat >> "$OUTPUT_FILE" << EOF
dependencies:
EOF
for dep in $needs_deps; do
echo " - ${dep}" >> "$OUTPUT_FILE"
@ -141,7 +163,6 @@ plan-${job_prefix}:
- export AWS_SECRET_ACCESS_KEY="\${AWS_SECRET_ACCESS_KEY}"
- cd \${TG_ROOT}
- ls -la
- rm -rf .terragrunt-cache
script:
- terragrunt init -upgrade -reconfigure
- terragrunt plan -out=tfplan
@ -187,7 +208,6 @@ apply-${job_prefix}:
- export AWS_SECRET_ACCESS_KEY="\${AWS_SECRET_ACCESS_KEY}"
- cd \${TG_ROOT}
- ls -la
- rm -rf .terragrunt-cache
script:
- terragrunt init -upgrade -reconfigure
- terragrunt apply tfplan