Skip to content
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
2 changes: 1 addition & 1 deletion container/Dockerfile.azterraform
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN export CGO_ENABLED=1 && \
rm -rf .git

#FROM mcr.microsoft.com/azurelinux/base/python:3.12 as runner
FROM mcr.microsoft.com/azure-cli:cbl-mariner2.0 AS runner
FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS runner
ARG GOLANG_IMAGE_TAG=1.19
ARG CONFTEST_VERSION=0.60.0
ARG TERRAFORM_VERSION=1.3.3
Expand Down
7 changes: 7 additions & 0 deletions container/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG MAPOTF_VERSION=1a50a9033189df84e72f32c94fe88ab4ff70a0a9
ARG PORCH_VERSION=0.0.10
ARG TERRAFORM_DOCS_VERSION=v0.20.0
ARG TFENV=v3.0.0
ARG GO_GETTER_VERSION=v2.2.3
ARG GOBUILDARGS='-trimpath'
# The below is set by Buildx for cross-platform builds
ARG TARGETARCH
Expand Down Expand Up @@ -87,4 +88,10 @@ RUN mkdir /src && \
git clone https://github.com/lonegunmanb/terrafmt.git && \
cd terrafmt && \
go build ${GOBUILDARGS} -o /go/bin/terrafmt . && \
cd /src && \
echo "Build go-getter" && \
git clone https://github.com/hashicorp/go-getter.git && \
cd go-getter/cmd/go-getter && \
git checkout ${GO_GETTER_VERSION} && \
go build ${GOBUILDARGS} -o /go/bin/go-getter . && \
chmod a+x /go/bin/*
15 changes: 8 additions & 7 deletions container/version.env
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
AVMFIX_VERSION=919dfccd49712635e7a4b1e0ca6b2a88194016fa
CONFTEST_VERSION=0.62.0
GOLANG_IMAGE_TAG=1.25.0
GREPT_VERSION=63656a6b5f69d4b8c0ad8495ada3dd6469d92091
CONFTEST_VERSION=0.63.0
GOLANG_IMAGE_TAG=1.25.1
GO_GETTER_VERSION=v2.2.3
GREPT_VERSION=fba8970e10cd0a871e97ec391460bb9f7113f0ae
HCLEDIT_VERSION=0.2.17
HCLMERGE_VERSION=2dff14bd831a6f696d6572f03a5a61a11e4e3d66
MAPOTF_VERSION=d0f91fd924efb6e67f14de9f4177ae6a365cceb5
MAPOTF_VERSION=90b343858028d1381555b6726aa71f0acb30b008
PACKER_VERSION=1.11.1
PORCH_VERSION=0.2.1
PORCH_VERSION=0.2.2
PREVIOUS_TAG_VERSION=ebb715659f6b2eea736e47fcc0eb87e9f71866d4
TERRAFORM_DOCS_VERSION=v0.20.0
TERRAFORM_VERSION=1.12.2
TERRAFORM_VERSION=1.13.3
TENV_VERSION=v4.7.21
TFENV=v3.0.0
TFLINT_VERSION=v0.58.0
TFLINT_VERSION=v0.58.0
40 changes: 38 additions & 2 deletions porch-configs/pr-check.porch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,28 @@ commands:
if [ -d "exceptions" ]; then
export LOCALEXCEPTION="-p exceptions"
fi

if [ -z "$AVM_CONFTEST_APRL_URL" ]; then
AVM_CONFTEST_APRL_URL="git::https://github.com/Azure/policy-library-avm.git//policy/Azure-Proactive-Resiliency-Library-v2"
fi
conftest test --all-namespaces --quiet --update "$AVM_CONFTEST_APRL_URL" -p policy/aprl -p policy/default_exceptions $LOCALEXCEPTION tfplan.json 1>&2

# Create a temporary directory for the policy
TEMP_POLICY_DIR=$(mktemp -d)

# Set up cleanup trap
trap "rm -rf $TEMP_POLICY_DIR" EXIT

# Use go-getter to download the policy with symlink support
# The -symlink flag enables symlink copying
go-getter \
$AVM_CONFTEST_APRL_URL \
"$TEMP_POLICY_DIR/policy/aprl"

conftest test --all-namespaces --quiet \
-p "$TEMP_POLICY_DIR/policy/aprl" \
-p policy/default_exceptions \
$LOCALEXCEPTION \
tfplan.json 1>&2

# conftest
- type: shell
Expand All @@ -347,7 +365,25 @@ commands:
if [ -z "$AVM_CONFTEST_AVMSEC_URL" ]; then
AVM_CONFTEST_AVMSEC_URL="git::https://github.com/Azure/policy-library-avm.git//policy/avmsec"
fi
conftest test --all-namespaces --quiet --update "$AVM_CONFTEST_AVMSEC_URL" -p policy/avmsec -p policy/default_exceptions $LOCALEXCEPTION tfplan.json 1>&2

# Create a temporary directory for the policy
TEMP_POLICY_DIR=$(mktemp -d)

# Set up cleanup trap
trap "rm -rf $TEMP_POLICY_DIR" EXIT

# Use go-getter to download the policy with symlink support
# The -symlink flag enables symlink copying
go-getter \
$AVM_CONFTEST_AVMSEC_URL \
"$TEMP_POLICY_DIR/policy/avmsec"


conftest test --all-namespaces --quiet \
-p "$TEMP_POLICY_DIR/policy/avmsec" \
-p policy/default_exceptions \
$LOCALEXCEPTION \
tfplan.json 1>&2

- type: shell
name: run post.sh if exists
Expand Down