From 735d3de6f9d23b5936e4ab99e0428751f302e9f4 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 30 Aug 2024 17:53:06 +0200 Subject: [PATCH] ff --- .gitea/workflows/build.yaml | 36 ++++++++++++++++++++++++-------- .gitea/workflows/lint.yaml | 33 ----------------------------- .woodpecker/build.yml | 41 ------------------------------------- 3 files changed, 28 insertions(+), 82 deletions(-) delete mode 100644 .gitea/workflows/lint.yaml delete mode 100644 .woodpecker/build.yml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 3203bf9..21b6e78 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,16 +1,39 @@ -name: build +name: "lint, build and push" on: push: branches: [ master ] pull_request: - workflow_run: - workflows: [linter] - types: - - completed # Variables: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables jobs: + gitleaks: + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run Gitleaks + uses: docker://zricethezav/gitleaks:v8.18.4 + with: + args: detect --no-git --verbose --source ${{ github.workspace }} + + hadolint: + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run hadolint + uses: docker://pipelinecomponents/hadolint:0.26.4 + with: + args: hadolint Dockerfile + +# shellcheck: # https://github.com/marketplace/actions/shellcheck +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# - name: Run ShellCheck +# uses: sudo-bot/action-shellcheck@latest +# with: +# cli-args: "shell.sh" + build: steps: - uses: https://github.com/actions/checkout@v4 @@ -36,6 +59,3 @@ jobs: file: ./Dockerfile push: true tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}" - - -# depends on lint diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml deleted file mode 100644 index e5098f4..0000000 --- a/.gitea/workflows/lint.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: linter -on: - push: - branches: [ master ] - pull_request: - -jobs: - gitleaks: - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run Gitleaks - uses: docker://zricethezav/gitleaks:v8.18.4 - with: - args: detect --no-git --verbose --source ${{ github.workspace }} - - hadolint: - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run hadolint - uses: docker://pipelinecomponents/hadolint:0.26.4 - with: - args: hadolint Dockerfile - -# shellcheck: # https://github.com/marketplace/actions/shellcheck -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# - name: Run ShellCheck -# uses: sudo-bot/action-shellcheck@latest -# with: -# cli-args: "shell.sh" diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml deleted file mode 100644 index 181085b..0000000 --- a/.woodpecker/build.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -depends_on: - - lint - -clone: - git: - image: "woodpeckerci/plugin-git:2.5.2" - settings: - depth: 9999 # wird benötigt um die Commits zählen zu können - lfs: false - partial: false - -steps: - build_and_push: # damit dieser Step laufen kann muss das Repo in der Woodpecker-GUI "privilegiert" sein - image: "docker:27.2.0" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - commands: - # https://unix.stackexchange.com/questions/748633/error-multiple-platforms-feature-is-currently-not-supported-for-docker-driver - - docker buildx create --use --platform=linux/amd64 --name multi-platform-builder - - docker buildx inspect --bootstrap - - | - docker buildx build \ - --no-cache \ - --platform=linux/amd64 \ - --push \ - --tag registry.mgrote.net/${CI_REPO_NAME}:${CI_COMMIT_BRANCH} \ - --tag registry.mgrote.net/${CI_REPO_NAME}:latest \ - --label org.opencontainers.image.url=$CI_REPO_URL \ - --label org.opencontainers.image.source=$CI_REPO_URL \ - --label org.opencontainers.image.revision=$CI_COMMIT_SHA \ - --label org.opencontainers.image.created=$DATE \ - --file Dockerfile . - when: - - event: [push, pull_request, cron, manual] - evaluate: 'CI_COMMIT_AUTHOR_EMAIL != "renovate@mgrote.net"' -... - -# händisch: -# docker build . -t registry.mgrote.net/allzweckcontainer:latest -# docker push registry.mgrote.net/allzweckcontainer:latest