Chore/build pipeline (#6)

* chg: chore: add linter

* chg: chore: update go

* new: chore: add pipeline

* chg: fix: dockerfile path

* chg: fix: main branch name

* chg: fix: add goimports

* chg: fix: remove goimports

* chg: fix: use goreleaser

* new: chore: add goreleaser config

* new: docs: add LICENSE

* chg: fix: container version

* chg: fix: dockerfile setup
This commit is contained in:
2024-04-28 11:52:01 -03:00
committed by GitHub
parent 268ece5650
commit 98f1700b21
12 changed files with 984 additions and 14 deletions

26
.github/workflows/pipeline.dockerfile vendored Normal file
View File

@@ -0,0 +1,26 @@
#####################################################
### Copy platform specific binary
FROM bash as copy-binary
ARG TARGETPLATFORM
RUN echo "Target Platform = ${TARGETPLATFORM}"
COPY dist .
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then cp torrentindexer_linux_amd64_linux_amd64_v1/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/386" ]; then cp torrentindexer_linux_386_linux_386/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then cp torrentindexer_linux_arm64_linux_arm64/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then cp torrentindexer_linux_arm_linux_arm_6/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then cp torrentindexer_linux_arm_linux_arm_7/torrent-indexer /torrent-indexer; fi
RUN chmod +x /torrent-indexer
#####################################################
### Build Final Image
FROM alpine as release
LABEL maintainer="felipevm97@gmail.com"
COPY --from=copy-binary /torrent-indexer /app/
WORKDIR /app
ENTRYPOINT ["/app/torrent-indexer"]