From fbcde180f88b1a6b901ce4ab512469e25aea0962 Mon Sep 17 00:00:00 2001 From: jm Date: Thu, 5 Sep 2024 08:32:31 +0200 Subject: [PATCH] initial --- .dockerignore | 2 ++ .gitattributes | 1 + .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ Dockerfile | 11 ++++++++++ Readme.md | 5 +++++ scripts/update.tag.bat | 8 +++++++ 6 files changed, 73 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml create mode 100644 Dockerfile create mode 100644 Readme.md create mode 100644 scripts/update.tag.bat diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3e5f79d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +* +!assets \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8218efd --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh eol=lf \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..418a3d5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: ☃ build-and-publish +on: + push: + branches-ignore: + - '*' + tags: + - '*' + workflow_dispatch: + +env: + IMG_REPO: ghcr.io/mazoea/docker-handle-server + JOBNAME: build-and-test + +permissions: + contents: read + packages: write + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: mazoea/ga-maz/start@master + + - uses: actions/checkout@v4 + + - name: pull and build + run: | + TAG=${{ env.IMG_REPO }}:${{ github.ref_name }} + echo "Using TAG:$TAG" + + echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + docker pull $TAG || true + docker build . -f Dockerfile --tag $TAG --cache-from $TAG + + - name: push image + run: | + docker push ${{ env.IMG_REPO }} --all-tags + if: ${{ success() && github.ref_type == 'tag' }} + + - uses: mazoea/ga-maz/end@master + if: ${{ always() }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..95e113e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3.8 + +WORKDIR /opt/src/ + +RUN apk update && \ + apk info cloc && \ + apk add cloc +RUN cloc --version + +ENTRYPOINT [ "cloc" ] +CMD [ "--version" ] diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..028e82b --- /dev/null +++ b/Readme.md @@ -0,0 +1,5 @@ +# Status + +# Overview + +Dockerized https://github.com/DSpace/Remote-Handle-Resolver \ No newline at end of file diff --git a/scripts/update.tag.bat b/scripts/update.tag.bat new file mode 100644 index 0000000..c70fe98 --- /dev/null +++ b/scripts/update.tag.bat @@ -0,0 +1,8 @@ +git push origin :latest +git tag -d latest +git tag latest +git push origin master --tags + +IF "%1"=="nopause" GOTO No1 + pause +:No1 \ No newline at end of file