diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..11f2be0 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,23 @@ +--- +name: ci + +on: + push: + branches: + - main + pull_request: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build and push + uses: lsst-dm/build-and-push@main + id: build + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + platforms: linux/amd64,linux/arm64 + image: ${{ github.repository }} + push: true diff --git a/.github/workflows/markdownlint.yaml b/.github/workflows/markdownlint.yaml new file mode 100644 index 0000000..e6685c0 --- /dev/null +++ b/.github/workflows/markdownlint.yaml @@ -0,0 +1,12 @@ +--- +name: Lint Markdown Files + +on: + push: + branches: + - main + pull_request: + +jobs: + call-workflow: + uses: lsst/rubin_workflows/.github/workflows/markdownlint.yaml@main diff --git a/.github/workflows/rebase_checker.yaml b/.github/workflows/rebase_checker.yaml new file mode 100644 index 0000000..62aeca7 --- /dev/null +++ b/.github/workflows/rebase_checker.yaml @@ -0,0 +1,8 @@ +--- +name: Check that 'main' is not merged into the development branch + +on: pull_request + +jobs: + call-workflow: + uses: lsst/rubin_workflows/.github/workflows/rebase_checker.yaml@main diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml new file mode 100644 index 0000000..aec968a --- /dev/null +++ b/.github/workflows/yamllint.yaml @@ -0,0 +1,12 @@ +--- +name: Lint YAML Files + +on: + push: + branches: + - main + pull_request: + +jobs: + call-workflow: + uses: lsst/rubin_workflows/.github/workflows/yamllint.yaml@main diff --git a/.hadolint.yaml b/.hadolint.yaml deleted file mode 100644 index 7411973..0000000 --- a/.hadolint.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -ignored: - # disable USER root - - DL3002 - # disable pinning apk package versions - - DL3018 - # disable following sourced files - - SC1091 - # disable JSON style CMD - - DL3025 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 338cce8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -sudo: false -language: c -matrix: - include: - - &docker - env: TEST=markdownlint - services: - - docker - script: ./tests/mdl.sh - - - <<: *docker - env: TEST=yamllint - script: ./tests/yamllint.sh - - - <<: *docker - env: TEST=shellcheck - script: ./tests/shellcheck.sh - - - <<: *docker - env: TEST=hadolint - script: ./tests/hadolint.sh - - - env: TEST=make - script: ./tests/make.sh -branches: - only: - - master - # also matched against tag pushes - - /^\d+\.\d+\.\d+$/ -notifications: - email: false diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..7214609 --- /dev/null +++ b/.yamllint @@ -0,0 +1,5 @@ +--- +extends: default +rules: + truthy: + check-keys: false diff --git a/Makefile b/Makefile deleted file mode 100644 index 84a92af..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: build - -build: - docker build \ - -t lsstsqre/docker-gc . diff --git a/README.md b/README.md index 73ee40d..caf75d2 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,5 @@ Usage --- ```sh -docker run -ti lsstsqre/docker-gc +docker run -ti ghcr.io/lsst-dm/docker-docker-gc ``` diff --git a/tests/hadolint.sh b/tests/hadolint.sh deleted file mode 100755 index fb8b19a..0000000 --- a/tests/hadolint.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e -shopt -s globstar nullglob - -CHECK=( **/Dockerfile ) -IGNORE=() - -for c in "${!CHECK[@]}"; do - for i in "${IGNORE[@]}"; do - [[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]' - done -done -[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; } - -echo '---' -echo 'check:' -for c in "${CHECK[@]}"; do - echo " - ${c}" -done -echo - -for f in "${CHECK[@]}"; do - docker run -ti -v "$(pwd):$(pwd)" -w "$(pwd)" \ - hadolint/hadolint:v1.13.0 hadolint "$f" -done - -# vim: tabstop=2 shiftwidth=2 expandtab diff --git a/tests/make.sh b/tests/make.sh deleted file mode 100755 index 341d206..0000000 --- a/tests/make.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e -shopt -s globstar nullglob - -CHECK=( **/Makefile ) -IGNORE=() - -for c in "${!CHECK[@]}"; do - for i in "${IGNORE[@]}"; do - [[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]' - done -done -[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; } - -echo '---' -echo 'check:' -for c in "${CHECK[@]}"; do - echo " - ${c}" -done -echo - -for f in "${CHECK[@]}"; do - ( set -e - cd "$(dirname "$f")" - echo "checking $f" - make --dry-run --warn-undefined-variables - ) -done - -# vim: tabstop=2 shiftwidth=2 expandtab diff --git a/tests/mdl.sh b/tests/mdl.sh deleted file mode 100755 index 40fa8e6..0000000 --- a/tests/mdl.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -e -shopt -s globstar nullglob - -CHECK=( **/*.md ) -IGNORE=() - -for c in "${!CHECK[@]}"; do - for i in "${IGNORE[@]}"; do - [[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]' - done -done -[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; } - -echo '---' -echo 'check:' -for c in "${CHECK[@]}"; do - echo " - ${c}" -done -echo - -docker run -ti -v "$(pwd):$(pwd)" -w "$(pwd)" \ - mivok/markdownlint:0.4.0 "${CHECK[@]}" - -# vim: tabstop=2 shiftwidth=2 expandtab diff --git a/tests/shellcheck.sh b/tests/shellcheck.sh deleted file mode 100755 index f067e9f..0000000 --- a/tests/shellcheck.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -e -shopt -s globstar nullglob - -CHECK=( **/*.sh ) -IGNORE=( {environments,.bundle,.tmp}/** ) - -for c in "${!CHECK[@]}"; do - for i in "${IGNORE[@]}"; do - [[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]' - done -done -[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; } - -echo '---' -echo 'check:' -for c in "${CHECK[@]}"; do - echo " - ${c}" -done -echo - -docker run -ti -v "$(pwd):$(pwd)" -w "$(pwd)" \ - koalaman/shellcheck-alpine:v0.6.0 shellcheck -x "${CHECK[@]}" - -# vim: tabstop=2 shiftwidth=2 expandtab diff --git a/tests/yamllint.sh b/tests/yamllint.sh deleted file mode 100755 index dfa18ba..0000000 --- a/tests/yamllint.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -set -e -shopt -s globstar nullglob - -CHECK=( **/*.{yaml,yml,.eyaml} .*.{yml,yaml} ) -EYAML=( **/*.eyaml ) -IGNORE=() -CONF_FILE=".yamllint.yaml" - -# filter out plain text versions of .eyaml files -for e in "${!EYAML[@]}"; do - uneyaml=${EYAML[e]/eyaml/yaml} - for c in "${!CHECK[@]}"; do - [[ ${CHECK[c]} == "$uneyaml" ]] && unset -v 'CHECK[c]' - done -done - -for c in "${!CHECK[@]}"; do - for i in "${IGNORE[@]}"; do - [[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]' - done -done -[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; } - -echo '---' -echo 'check:' -for c in "${CHECK[@]}"; do - echo " - ${c}" -done -echo - -ARGS=() -[[ -f $CONF_FILE ]] && ARGS+=(-c "$CONF_FILE") -ARGS+=("${CHECK[@]}") -docker run -ti -v "$(pwd):/workdir" lsstsqre/yamllint:1.13.0 "${ARGS[@]}" - -# vim: tabstop=2 shiftwidth=2 expandtab