diff --git a/.github/workflows/build-ci-images.yml b/.github/workflows/build-ci-images.yml new file mode 100644 index 0000000..b1e7b76 --- /dev/null +++ b/.github/workflows/build-ci-images.yml @@ -0,0 +1,45 @@ +name: build & push ci base images + +on: + push: + branches: + - dev + - main + paths: + - '.github/workflows/build-ci-images.yml' + pull_request: + branches: + - dev + - main + paths: + - '.github/workflows/build-ci-images.yml' + workflow_dispatch: + branches: + - main + +env: + IMAGE_REPO: "artifact.onwalk.net" + IMAGE_PATH: "public/base/code-lint" + IMAGE_TAG: "0.0.1" + + +jobs: + build-images: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: actions/login-action@v1 + with: + registry: ${{ env.IMAGE_REPO }} + username: ${{ secrets.REPO_USER }} + password: ${{ secrets.HELM_REPO_PASSWORD }} + + - name: Build & push code-lint images + working-directory: oci/base/debian-code-lint/ + run: | + docker build --network host -t "${{ env.IMAGE_REPO }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}" -f Dockerfile . + docker push "${{ env.IMAGE_REPO }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}" + docker rmi ${{ env.IMAGE_REPO }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} || true diff --git a/oci/base/debian-code-lint/Dockerfile b/oci/base/debian-code-lint/Dockerfile new file mode 100644 index 0000000..af44b69 --- /dev/null +++ b/oci/base/debian-code-lint/Dockerfile @@ -0,0 +1,36 @@ +FROM debian:buster + +# Install necessary system dependencies +RUN apt-get update && apt-get install -y \ + git \ + curl \ + python3 \ + python3-pip \ + golang-go \ + nodejs \ + npm \ + libyaml-dev \ + libffi-dev + +# Install pip and Ansible +RUN pip3 install --upgrade pip +RUN pip3 install ansible ansible-lint + +# Set up Go, install Go dependencies, and clear Go package cache +RUN go get -u golang.org/x/lint/golint +RUN rm -rf /go/pkg/* + +# Install yamllint +RUN pip3 install yamllint + +# Set up Node.js and npm, install eslint and React plugin +RUN npm install -g eslint eslint-plugin-react + +# Ensure the tools are in the PATH +ENV PATH="/go/bin:${PATH}" + +# Set work directory +WORKDIR /src + +# Define an entrypoint +ENTRYPOINT ["/bin/bash"]