From f3b6cf9c3c9f5d52dac0c7d7c873a937c9805f97 Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 30 Apr 2024 13:16:46 +0800 Subject: [PATCH 1/3] Update Dockerfile Signed-off-by: shenlan --- oci/base/alpine-ansible-lint/Dockerfile | 29 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/oci/base/alpine-ansible-lint/Dockerfile b/oci/base/alpine-ansible-lint/Dockerfile index 51f4e23..a9a1e14 100644 --- a/oci/base/alpine-ansible-lint/Dockerfile +++ b/oci/base/alpine-ansible-lint/Dockerfile @@ -1,12 +1,21 @@ -FROM alpine:latest +FROM python:latest -# Install system dependencies -RUN apk add --no-cache bash git python3 py3-pip jq && \ - pip3 install --upgrade pip && \ - pip3 install hvac jinja2 ansible ansible-lint && \ - ansible-galaxy collection install community.hashi_vault +ENV TIME_ZONE=Asia/Shanghai \ + BIN_PERM=0755 \ + BIN_DIR=/usr/local/bin \ + HELM_FILE_URL=https://github.com/roboll/helmfile/releases/download \ + HELM_FILE_VERSION=v0.139.9 \ -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] -CMD ["/bin/bash"] +RUN unlink /etc/localtime && ln -s /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \ + && apt-get update -y && apt-get upgrade -y \ + && apt-get --reinstall -y install tar curl sshpass jq git vim uuid-runtime \ + && wget ${HELM_FILE_URL}/${HELM_FILE_VERSION}/helmfile_linux_amd64 -O ${BIN_DIR}/helmfile \ + && chmod ${BIN_PERM} ${BIN_DIR}/helmfile \ + && helm plugin install https://github.com/databus23/helm-diff \ + && rm -rf /var/lib/apt/lists/* + +RUN pip install ansible==2.10 ansible-lint jmespath hvac jinja2 && ansible-galaxy collection install community.hashi_vault + +WORKDIR /home/${USER} + +CMD $@ From 329e7efd9374f3164f2fe2f1239260ed60bc4ceb Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 30 Apr 2024 13:17:34 +0800 Subject: [PATCH 2/3] Create build-ci-image-ansible-runer.yml Signed-off-by: shenlan --- .github/workflows/build-ci-image-ansible-runer.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/workflows/build-ci-image-ansible-runer.yml diff --git a/.github/workflows/build-ci-image-ansible-runer.yml b/.github/workflows/build-ci-image-ansible-runer.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.github/workflows/build-ci-image-ansible-runer.yml @@ -0,0 +1 @@ + From 8768adabd31a8eeae146bfeb0d9aaf180f8abef7 Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 30 Apr 2024 13:19:38 +0800 Subject: [PATCH 3/3] Update build-ci-image-ansible-runer.yml Signed-off-by: shenlan --- .../build-ci-image-ansible-runer.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/build-ci-image-ansible-runer.yml b/.github/workflows/build-ci-image-ansible-runer.yml index 8b13789..7368e20 100644 --- a/.github/workflows/build-ci-image-ansible-runer.yml +++ b/.github/workflows/build-ci-image-ansible-runer.yml @@ -1 +1,28 @@ +name: build images ansible-runner +on: + pull_request: + branches: + - main + paths: + - 'oci/base/alpine-ansible-lint/Dockerfile' + - '.github/workflows/build-ci-image-ansible-runer.yml' + workflow_dispatch: + branches: + - main +env: + IMAGE_REPO: "artifact.onwalk.net" + +jobs: + eslint: + name: Build Docker in Docker image + uses: svc-design/actions/.github/workflows/build-images.yaml@main + with: + method: 'docker/node' + registry_addr: "harbor.onwalk.net" + dockerfile_path: 'oci/base/alpine-ansible-lint' + image_name: 'public/base/alpine-ansible-runer' + image_tag: 'latest' + secrets: + artifactory_sa: ${{ secrets.REPO_USER }} + artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}