commit c7c4811f3a5df0c70952a0b7685a3902c058644d Author: Glauber Ferreira Date: Mon Apr 29 04:25:54 2024 -0300 primeiro commit diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..c64b3d8 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,31 @@ +name: Build and Push Image +on: [ push ] + +jobs: + build: + name: Build and push image + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: git.aehoo.net + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64 + tags: | + git.aehoo.net/alphard/sui:${{env.GITHUB_SHA}} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..879c9c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM cgr.dev/chainguard/wolfi-base +COPY run /usr/local/bin/run +RUN apk add --no-cache bash git wget ca-certificates libgcc tini +RUN wget -O /tmp/gw.tar.gz https://github.com/daniel7grant/gw/releases/download/v0.2.2/gw-bin_x86_64-unknown-linux-gnu.tar.gz &&\ + wget -O /tmp/algernon.tar.xz https://github.com/xyproto/algernon/releases/download/v1.16.0/algernon-1.16.0-linux_x86_64_static.tar.xz &&\ + tar -xvf /tmp/gw.tar.gz -C /usr/local/bin &&\ + tar -xvf /tmp/algernon.tar.xz --strip=1 -C /usr/local/bin &&\ + rm -f /tmp/gw.tar.gz /tmp/algernon.tar.xz /usr/local/bin/._LICENSE /usr/local/bin/LICENSE /usr/local/bin/algernon.1.gz &&\ + chmod +x /usr/local/bin/run &&\ + apk del -r wget +ENTRYPOINT ["tini"] +CMD ["/usr/local/bin/run"] diff --git a/run b/run new file mode 100644 index 0000000..97ba80e --- /dev/null +++ b/run @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +if [ -z "$GITREPO" ]; then + echo "variável GITREPO não encontrada" + exit 1 +fi +mkdir -p /var/lib/gw +git clone "$GITREPO" /var/lib/gw/gitrepo +cd /var/lib/gw +exec gw gitrepo & +algernon --httponly --nocache -x -s /var/lib/gw/gitrepo