-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add cross build binary support
- Loading branch information
Showing
9 changed files
with
169 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ config.yml | |
data | ||
it/*.db | ||
cmd/migrations | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
- go generate ./cmd | ||
|
||
builds: | ||
- id: ot-recorder | ||
flags: | ||
- -tags=osusergo,netgo,sqlite_omit_load_extension | ||
ldflags: | ||
- -extldflags=-static | ||
- -s -w | ||
- -X ot-recorder/app.Version={{.Version}} | ||
- -X ot-recorder/app.BuildTime={{.Date}} | ||
env: | ||
- CGO_ENABLED=1 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
overrides: | ||
- goos: linux | ||
goarch: arm | ||
goarm: "6" | ||
env: | ||
- CC=arm-linux-gnueabi-gcc | ||
- goos: linux | ||
goarch: arm64 | ||
env: | ||
- CC=aarch64-linux-gnu-gcc | ||
- goos: linux | ||
goarch: amd64 | ||
env: | ||
- cc=gcc | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
|
||
archives: | ||
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
files: | ||
- LICENSE | ||
|
||
changelog: | ||
sort: asc | ||
use: github | ||
filters: | ||
exclude: | ||
- '^test:' | ||
- '^chore' | ||
- 'merge conflict' | ||
- 'Merge pull request' | ||
- 'Merge remote-tracking branch' | ||
- 'Merge branch' | ||
- 'go mod tidy' | ||
|
||
dockers: | ||
- image_templates: | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-amd64" | ||
dockerfile: Dockerfile_gr | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--build-arg=BUILD_VERSION={{.Version}}" | ||
- "--build-arg=BUILD_TIME={{.Date}}" | ||
- "--platform=linux/amd64" | ||
- image_templates: | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-arm64" | ||
dockerfile: Dockerfile_gr | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--build-arg=BUILD_VERSION={{.Version}}" | ||
- "--build-arg=BUILD_TIME={{.Date}}" | ||
- "--platform=linux/arm64" | ||
goarch: arm64 | ||
- image_templates: | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-arm" | ||
dockerfile: Dockerfile_gr | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--build-arg=BUILD_VERSION={{.Version}}" | ||
- "--build-arg=BUILD_TIME={{.Date}}" | ||
- "--platform=linux/arm/v6" | ||
goarch: arm | ||
|
||
docker_manifests: | ||
- name_template: "hrshadhin/{{ .ProjectName }}:{{ .Version }}" | ||
image_templates: | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-amd64" | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-arm64" | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-arm" | ||
- name_template: "hrshadhin/{{ .ProjectName }}:latest" | ||
image_templates: | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-amd64" | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-arm64" | ||
- "hrshadhin/{{ .ProjectName }}:{{ .Version }}-arm" | ||
|
||
release: | ||
footer: | | ||
**Full Changelog**: https://github.com/hrshadhin/ot-recorder/compare/{{ .PreviousTag }}...{{ .Tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM alpine | ||
|
||
ARG BUILD_VERSION=0.0.1 | ||
ARG BUILD_TIME=2022-12-13T000000Z | ||
|
||
LABEL org.opencontainers.image.created=$BUILD_TIME \ | ||
org.opencontainers.image.version=$BUILD_VERSION \ | ||
org.opencontainers.image.source="https://github.com/hrshadhin/ot-recoder" \ | ||
org.opencontainers.image.url="https://github.com/hrshadhin/ot-recoder" \ | ||
org.opencontainers.image.name="ot-recorder" \ | ||
org.opencontainers.image.title="OwnTracks Recorder" \ | ||
org.opencontainers.image.description="Store and access data published by OwnTracks apps" | ||
|
||
# Install/Create dependent tools,location,directory | ||
RUN apk add --no-cache curl tini tzdata && \ | ||
rm -rf /var/cache/apk/* && \ | ||
mkdir /persist && chown -R 1000:1000 /persist | ||
|
||
ENV ZONEINFO=/usr/share/zoneinfo | ||
|
||
## Open port | ||
EXPOSE 8000 | ||
|
||
## Perform any further action as an unprivileged location. | ||
USER 1000 | ||
WORKDIR /app | ||
COPY --chmod=0755 ot-recorder ot-recorder | ||
|
||
|
||
HEALTHCHECK --interval=1m --timeout=1s --retries=3 --start-period=2s CMD ["curl", "--fail", "http://localhost:8000/health"] | ||
|
||
## Run the compiled binary. | ||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["/app/ot-recorder","--config","/app/config.yml", "serve"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters