Test release and webhook trigger
- commit
- c82e06d529d30ec16efa78f1a81230b23d120e2d
- author
- bnema · · 2023-11-01 19:56 UTC
- committer
- bnema · · 2023-11-01 22:09 UTC
- parent
- e87d3c3
- signature
- unsigned
3 files · +37 -8
M .goreleaser.yaml +33 -5
| @@ -1,6 +1,8 @@ | |||
| 1 | 1 | before: | |
| 2 | 2 | hooks: | |
| 3 | 3 | - go mod tidy | |
| 4 | + | release: | |
| 5 | + | draft: true | |
| 4 | 6 | ||
| 5 | 7 | builds: | |
| 6 | 8 | - id: "gordon" | |
| @@ -17,18 +19,44 @@ builds: | |||
| 17 | 19 | ||
| 18 | 20 | dockers: | |
| 19 | 21 | - image_templates: | |
| 20 | - | - "ghcr.io/bnema/gordon:{{ .Tag }}" | |
| 21 | - | - "ghcr.io/bnema/gordon:latest" | |
| 22 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-amd64" | |
| 22 | 23 | use: buildx | |
| 23 | - | skip_push: false | |
| 24 | 24 | dockerfile: Dockerfile | |
| 25 | + | goarch: amd64 | |
| 26 | + | build_flag_templates: | |
| 27 | + | - "--pull" | |
| 28 | + | - "--platform=linux/amd64" | |
| 29 | + | - "--label=org.opencontainers.image.created={{.Date}}" | |
| 30 | + | - "--label=org.opencontainers.image.title={{.ProjectName}}" | |
| 31 | + | - "--label=org.opencontainers.image.revision={{.FullCommit}}" | |
| 32 | + | - "--label=org.opencontainers.image.version={{.Version}}" | |
| 33 | + | - "--label=org.opencontainers.image.source=https://github.com/bnema/gordon" | |
| 34 | + | - image_templates: | |
| 35 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-arm64" | |
| 36 | + | use: buildx | |
| 37 | + | dockerfile: Dockerfile | |
| 38 | + | goarch: arm64 | |
| 39 | + | build_flag_templates: | |
| 40 | + | - "--pull" | |
| 41 | + | - "--platform=linux/arm64" | |
| 42 | + | - "--label=org.opencontainers.image.created={{.Date}}" | |
| 43 | + | - "--label=org.opencontainers.image.title={{.ProjectName}}" | |
| 44 | + | - "--label=org.opencontainers.image.revision={{.FullCommit}}" | |
| 45 | + | - "--label=org.opencontainers.image.version={{.Version}}" | |
| 46 | + | - "--label=org.opencontainers.image.source=https://github.com/bnema/gordon" | |
| 47 | + | ||
| 48 | + | docker_manifests: | |
| 49 | + | - name_template: "ghcr.io/bnema/gordon:latest" | |
| 50 | + | image_templates: | |
| 51 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-amd64" | |
| 52 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-arm64" | |
| 53 | + | create_flags: ["--amend"] | |
| 25 | 54 | ||
| 26 | 55 | archives: | |
| 27 | 56 | - format: tar.gz | |
| 28 | - | # this name template makes the OS and Arch compatible with the results of `uname`. | |
| 29 | 57 | name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | |
| 30 | 58 | ||
| 31 | - | changelog: # Added this section | |
| 59 | + | changelog: | |
| 32 | 60 | sort: asc | |
| 33 | 61 | filters: | |
| 34 | 62 | exclude: | |
| @@ -1,6 +1,8 @@ | |||||
| 1 | before: | 1 | before: | ||
| 2 | hooks: | 2 | hooks: | ||
| 3 | - go mod tidy | 3 | - go mod tidy | ||
| 4 | + | release: | |||
| 5 | + | draft: true | |||
| 4 | 6 | ||||
| 5 | builds: | 7 | builds: | ||
| 6 | - id: "gordon" | 8 | - id: "gordon" | ||
| @@ -17,18 +19,44 @@ builds: | |||||
| 17 | 19 | ||||
| 18 | dockers: | 20 | dockers: | ||
| 19 | - image_templates: | 21 | - image_templates: | ||
| 20 | - | - "ghcr.io/bnema/gordon:{{ .Tag }}" | 22 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-amd64" |
| 21 | - | - "ghcr.io/bnema/gordon:latest" | |||
| 22 | use: buildx | 23 | use: buildx | ||
| 23 | - | skip_push: false | |||
| 24 | dockerfile: Dockerfile | 24 | dockerfile: Dockerfile | ||
| 25 | + | goarch: amd64 | |||
| 26 | + | build_flag_templates: | |||
| 27 | + | - "--pull" | |||
| 28 | + | - "--platform=linux/amd64" | |||
| 29 | + | - "--label=org.opencontainers.image.created={{.Date}}" | |||
| 30 | + | - "--label=org.opencontainers.image.title={{.ProjectName}}" | |||
| 31 | + | - "--label=org.opencontainers.image.revision={{.FullCommit}}" | |||
| 32 | + | - "--label=org.opencontainers.image.version={{.Version}}" | |||
| 33 | + | - "--label=org.opencontainers.image.source=https://github.com/bnema/gordon" | |||
| 34 | + | - image_templates: | |||
| 35 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-arm64" | |||
| 36 | + | use: buildx | |||
| 37 | + | dockerfile: Dockerfile | |||
| 38 | + | goarch: arm64 | |||
| 39 | + | build_flag_templates: | |||
| 40 | + | - "--pull" | |||
| 41 | + | - "--platform=linux/arm64" | |||
| 42 | + | - "--label=org.opencontainers.image.created={{.Date}}" | |||
| 43 | + | - "--label=org.opencontainers.image.title={{.ProjectName}}" | |||
| 44 | + | - "--label=org.opencontainers.image.revision={{.FullCommit}}" | |||
| 45 | + | - "--label=org.opencontainers.image.version={{.Version}}" | |||
| 46 | + | - "--label=org.opencontainers.image.source=https://github.com/bnema/gordon" | |||
| 47 | + | ||||
| 48 | + | docker_manifests: | |||
| 49 | + | - name_template: "ghcr.io/bnema/gordon:latest" | |||
| 50 | + | image_templates: | |||
| 51 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-amd64" | |||
| 52 | + | - "ghcr.io/bnema/gordon:{{ .Tag }}-arm64" | |||
| 53 | + | create_flags: ["--amend"] | |||
| 25 | 54 | ||||
| 26 | archives: | 55 | archives: | ||
| 27 | - format: tar.gz | 56 | - format: tar.gz | ||
| 28 | - | # this name template makes the OS and Arch compatible with the results of `uname`. | |||
| 29 | name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | 57 | name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
| 30 | 58 | ||||
| 31 | - | changelog: # Added this section | 59 | + | changelog: |
| 32 | sort: asc | 60 | sort: asc | ||
| 33 | filters: | 61 | filters: | ||
| 34 | exclude: | 62 | exclude: | ||
M Dockerfile +1 -3
| @@ -6,9 +6,7 @@ RUN mkdir -p /etc/ssl/certs/ && \ | |||
| 6 | 6 | # Start from scratch | |
| 7 | 7 | FROM scratch | |
| 8 | 8 | ||
| 9 | - | # Copy CA certificates | |
| 10 | - | COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | |
| 11 | - | ||
| 9 | + | RUN apk --no-cache add ca-certificates | |
| 12 | 10 | COPY gordon / | |
| 13 | 11 | ||
| 14 | 12 | EXPOSE 1323 | |
| @@ -6,9 +6,7 @@ RUN mkdir -p /etc/ssl/certs/ && \ | |||||
| 6 | # Start from scratch | 6 | # Start from scratch | ||
| 7 | FROM scratch | 7 | FROM scratch | ||
| 8 | 8 | ||||
| 9 | - | # Copy CA certificates | 9 | + | RUN apk --no-cache add ca-certificates |
| 10 | - | COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | |||
| 11 | - | ||||
| 12 | COPY gordon / | 10 | COPY gordon / | ||
| 13 | 11 | ||||
| 14 | EXPOSE 1323 | 12 | EXPOSE 1323 | ||
M internal/server/sqliteclose.go +3 -0
| @@ -16,5 +16,8 @@ func saveDB(a *App) error { | |||
| 16 | 16 | ||
| 17 | 17 | // TODO | |
| 18 | 18 | func backupDBFile(a *App) error { | |
| 19 | + | // Create a backup of the database file at the same location as the database file. | |
| 20 | + | // The backup file name is the database file name with a timestamp appended to it. | |
| 21 | + | // If the backup file already exists, overwrite it. | |
| 19 | 22 | return nil | |
| 20 | 23 | } | |
| @@ -16,5 +16,8 @@ func saveDB(a *App) error { | |||||
| 16 | 16 | ||||
| 17 | // TODO | 17 | // TODO | ||
| 18 | func backupDBFile(a *App) error { | 18 | func backupDBFile(a *App) error { | ||
| 19 | + | // Create a backup of the database file at the same location as the database file. | |||
| 20 | + | // The backup file name is the database file name with a timestamp appended to it. | |||
| 21 | + | // If the backup file already exists, overwrite it. | |||
| 19 | return nil | 22 | return nil | ||
| 20 | } | 23 | } | ||