Skip to content

Commit

Permalink
Add kubeconform
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-devops committed Nov 14, 2023
1 parent 0e04243 commit 6f66f22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ARG KUSTOMIZE_VERSION=v3.8.1
ARG KUBESEAL_VERSION=0.18.1
ARG KREW_VERSION=v0.4.4
ARG VALS_VERSION=0.28.1
ARG KUBECONFORM_VERSION=0.6.3

# Install helm (latest release)
# ENV BASE_URL="https://storage.googleapis.com/kubernetes-helm"
Expand Down Expand Up @@ -101,4 +102,9 @@ RUN . /envfile && echo $ARCH && \
echo 'export PATH=/root/.krew/bin:$PATH' >> ~/.bashrc && \
rm krew-linux_${ARCH}.tar.gz

# Install kubeconform
RUN . /envfile && echo $ARCH && \
curl -L https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-${ARCH}.tar.gz -o - | tar xz -C /usr/bin/ && \
chmod +x /usr/bin/kubeconform

WORKDIR /apps
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,19 @@ build() {
| sort -rV | head -n 1 |sed 's/v//')
echo "vals version is $vals_version"

# kubeconform latest
kubeconform_version=$(curl -s https://api.github.com/repos/yannh/kubeconform/releases | jq -r '.[].tag_name | select(startswith("v"))' \
| sort -rV | head -n 1 |sed 's/v//')
echo "kubeconform version is $kubeconform_version"

docker build --no-cache \
--build-arg KUBECTL_VERSION=${tag} \
--build-arg HELM_VERSION=${helm} \
--build-arg KUSTOMIZE_VERSION=${kustomize_version} \
--build-arg KUBESEAL_VERSION=${kubeseal_version} \
--build-arg KREW_VERSION=${krew_version} \
--build-arg VALS_VERSION=${vals_version} \
--build-arg KUBECONFORM_VERSION=${kubeconform_version} \
-t ${image}:${tag} .

# run test
Expand All @@ -78,6 +84,7 @@ build() {
--build-arg KUBESEAL_VERSION=${kubeseal_version} \
--build-arg KREW_VERSION=${krew_version} \
--build-arg VALS_VERSION=${vals_version} \
--build-arg KUBECONFORM_VERSION=${kubeconform_version} \
-t ${image}:${tag} .
fi
}
Expand Down

0 comments on commit 6f66f22

Please sign in to comment.