Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONAR-21408 run static test in PR #410

Merged
merged 2 commits into from
Jan 17, 2024
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
22 changes: 22 additions & 0 deletions .cirrus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ env:
NIGHTLY_CRON: 'nightly-cron'
DOCKER_USERNAME: VAULT[development/kv/data/docker/sonardockerrw data.username]
DOCKER_PASSWORD: VAULT[development/kv/data/docker/sonardockerrw data.access_token_rwd]
KUBE_VERSION: 1.28.0

except_nightly_cron: &EXCEPT_ON_NIGHTLY_CRON
only_if: $CIRRUS_CRON != $NIGHTLY_CRON
Expand Down Expand Up @@ -43,6 +44,25 @@ clone_script_template: &CLONE_SCRIPT_TEMPLATE
git reset --hard $CIRRUS_CHANGE_IN_REPO
fi

chart_static_compatibility_test_task:
<<: *ONLY_ON_NON_RELEASE_DRAFT_TEMPLATE
timeout_in: 30m
eks_container:
<<: *CONTAINER_TEMPLATE
cpu: 1
memory: 1Gb
<<: *CLONE_SCRIPT_TEMPLATE
script:
- helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm repo add bitnami-pre2022 https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami
- cd ${CIRRUS_WORKING_DIR}/charts/sonarqube
- helm dependency build
- ../../.cirrus/unit_helm_compatibility_test.sh
- cd ${CIRRUS_WORKING_DIR}/charts/sonarqube-dce
- helm dependency build
- ../../.cirrus/unit_helm_compatibility_test.sh

chart_testing_task:
<<: *ONLY_ON_NON_RELEASE_DRAFT_TEMPLATE
timeout_in: 30m
Expand Down Expand Up @@ -74,6 +94,8 @@ chart_testing_task:
- ct install --config test.yaml --all
artifacthub_lint_script:
- ah lint
depends_on:
- chart_static_compatibility_test

chart_packaging_task:
<<: *ONLY_ON_NON_RELEASE_DRAFT_TEMPLATE
Expand Down
12 changes: 11 additions & 1 deletion .cirrus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ARG AH_VERSION=1.16.0
ARG AH_CHECKSUM="d5955b409361922f609c261bf4b124c4d8ecd294cf85e5fee11c2ba774d45366"
ARG YQ_VERSION=4.35.2
ARG YQ_CHECKSUM="8afd786b3b8ba8053409c5e7d154403e2d4ed4cf3e93c237462dc9ef75f38c8d"
ARG KUBECONFORM_VERSION=0.6.4
ARG KUBECONFORM_CHECKSUM="2b4ebeaa4d5ac4843cf8f7b7e66a8874252b6b71bc7cbfc4ef1cbf85acec7c07"

ENV HELM_BASE_URL="https://get.helm.sh"
ENV HELM_TAR_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz"
Expand Down Expand Up @@ -92,6 +94,14 @@ RUN set -eux; \
chmod +x ./yq_linux_amd64 ; \
mv ./yq_linux_amd64 /usr/bin/yq

RUN set -eux; \
curl -LO https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz ; \
echo "${KUBECONFORM_CHECKSUM} kubeconform-linux-amd64.tar.gz" | sha256sum -c ; \
tar -xf kubeconform-linux-amd64.tar.gz ; \
chmod +x ./kubeconform ; \
mv ./kubeconform /usr/bin/kubeconform ; \
rm kubeconform-linux-amd64.tar.gz

COPY --from=tools /usr/local/bin/cirrus-env /usr/local/bin/cirrus-env
COPY --from=tools /usr/bin/gh /usr/local/bin/gh
COPY --from=tools /usr/local/bin/gh /usr/local/bin/gh
COPY --from=tools /home/sonarsource/.m2/settings-public.xml /root/.m2/settings-public.xml
5 changes: 4 additions & 1 deletion .cirrus/wait_for_kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ timeout=1500
# Set the interval in seconds to wait for the cluster to be up
interval=200

# Set the default Kubernetes version to use
KUBE_VERSION="${KUBE_VERSION:-1.25.0}"

echo "Waiting for Kind cluster"

# Loop until the timeout is reached or the cluster is available
for ((i=0; i<$timeout; i+=$interval)); do
# Check if the Kind cluster is available, by checking the return code.
if kind create cluster --wait "${interval}"s -v 8; then
if kind create cluster --image "kindest/node:v${KUBE_VERSION}" --wait "${interval}"s -v 8; then
echo "Kind cluster is available!"
exit 0
else
Expand Down
Loading