Skip to content

Commit 59563b8

Browse files
authored
Merge pull request #2 from scaleway/feat/update
feat: update fork
2 parents a9f22bd + 3f952a9 commit 59563b8

30 files changed

+451
-1203
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gomod" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/docker-image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 'Docker image'
33
on:
44
push:
55
branches:
6-
- 'master'
6+
- 'main'
77
tags:
88
- 'v*'
99
jobs:
@@ -13,7 +13,7 @@ jobs:
1313
- uses: 'actions/checkout@v2'
1414
- uses: 'docker/build-push-action@v1'
1515
with:
16-
repository : 'minicliposs/gonsul'
16+
repository : 'scaleway/gonsul'
1717
username : ${{ secrets.DOCKER_USERNAME }}
1818
password : ${{ secrets.DOCKER_PASSWORD }}
1919
add_git_labels : true
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Docker
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
schedule:
10+
- cron: '40 12 * * *'
11+
push:
12+
branches: [ "main" ]
13+
# Publish semver tags as releases.
14+
tags: [ 'v*.*.*' ]
15+
pull_request:
16+
branches: [ "main" ]
17+
18+
env:
19+
# Use docker.io for Docker Hub if empty
20+
REGISTRY: ghcr.io
21+
# github.repository as <account>/<repo>
22+
IMAGE_NAME: ${{ github.repository }}
23+
24+
25+
jobs:
26+
build:
27+
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
# This is used to complete the identity challenge
33+
# with sigstore/fulcio when running outside of PRs.
34+
id-token: write
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
40+
# Install the cosign tool except on PR
41+
# https://github.com/sigstore/cosign-installer
42+
- name: Install cosign
43+
if: github.event_name != 'pull_request'
44+
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
45+
with:
46+
cosign-release: 'v2.2.4'
47+
48+
# Set up BuildKit Docker container builder to be able to build
49+
# multi-platform images and export cache
50+
# https://github.com/docker/setup-buildx-action
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
53+
54+
# Login against a Docker registry except on PR
55+
# https://github.com/docker/login-action
56+
- name: Log into registry ${{ env.REGISTRY }}
57+
if: github.event_name != 'pull_request'
58+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
59+
with:
60+
registry: ${{ env.REGISTRY }}
61+
username: ${{ github.actor }}
62+
password: ${{ secrets.GITHUB_TOKEN }}
63+
64+
# Extract metadata (tags, labels) for Docker
65+
# https://github.com/docker/metadata-action
66+
- name: Extract Docker metadata
67+
id: meta
68+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
69+
with:
70+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
71+
72+
# Build and push Docker image with Buildx (don't push on PR)
73+
# https://github.com/docker/build-push-action
74+
- name: Build and push Docker image
75+
id: build-and-push
76+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
77+
with:
78+
context: .
79+
push: ${{ github.event_name != 'pull_request' }}
80+
tags: ${{ steps.meta.outputs.tags }}
81+
labels: ${{ steps.meta.outputs.labels }}
82+
cache-from: type=gha
83+
cache-to: type=gha,mode=max
84+
85+
# Sign the resulting Docker image digest except on PRs.
86+
# This will only write to the public Rekor transparency log when the Docker
87+
# repository is public to avoid leaking data. If you would like to publish
88+
# transparency data even for private images, pass --force to cosign below.
89+
# https://github.com/sigstore/cosign
90+
- name: Sign the published Docker image
91+
if: ${{ github.event_name != 'pull_request' }}
92+
env:
93+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
94+
TAGS: ${{ steps.meta.outputs.tags }}
95+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
96+
# This step uses the identity token to provision an ephemeral certificate
97+
# against the sigstore community Fulcio instance.
98+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gonsul is licenced under [The MIT LICENCE](LICENCE.md) for all code.
1515

1616
## Submitting a Bug
1717

18-
Bugs can be submitted to the [Github issue page](https://github.com/miniclip/gonsul/issues).
18+
Bugs can be submitted to the [Github issue page](https://github.com/scaleway/gonsul/issues).
1919

2020
Gonsul is not perfect software and will be buggy. When submitting a bug, be
2121
careful to know the following:
@@ -43,7 +43,7 @@ ask for respect and understanding and will try to provide the same back.
4343

4444
Before requesting or implementing a new feature, please do the following:
4545

46-
- Verify in existing [issues](https://github.com/miniclip/gonsul/issues) whether
46+
- Verify in existing [issues](https://github.com/scaleway/gonsul/issues) whether
4747
the feature might already be in the works, or
4848
has already been rejected.
4949
- Make sure you're using the latest release (or even the latest code, if you're
@@ -128,5 +128,4 @@ eventual automated changelog generation.
128128

129129
### Credit
130130

131-
`gonsul` has been improved by
132-
[many contributors](https://github.com/miniclip/gonsul/graphs/contributors)!
131+
`gonsul` has been improved by [many contributors](https://github.com/scaleway/gonsul/graphs/contributors)!

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
ARG GONSUL=/go/src/github.com/miniclip/gonsul
1+
ARG GONSUL=/go/src/github.com/scaleway/gonsul
2+
3+
FROM golang:1.24.2-alpine AS build
24

3-
FROM golang:1.14.3-alpine3.11 as build
45
ARG GONSUL
56

6-
RUN apk --no-cache add build-base dep git
7+
RUN apk --no-cache add build-base git make
8+
79
RUN mkdir -p $GONSUL
10+
811
WORKDIR $GONSUL
12+
913
COPY . .
14+
1015
RUN make
1116

1217
FROM alpine
18+
1319
ARG GONSUL
1420

15-
COPY --from=build $GONSUL/bin/gonsul /usr/bin/gonsul
21+
COPY --from=build --chmod=0755 $GONSUL/bin/gonsul /usr/bin/gonsul
22+
1623
RUN adduser -D gonsul
24+
1725
USER gonsul
1826

1927
ENTRYPOINT [ "/usr/bin/gonsul" ]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ VERSION=$(shell git describe --abbrev=0 --always --tags)
1111
BUILD_DATE=$(shell date -u +%Y%m%d.%H%M%S)
1212

1313
# Setup the -ldflags option for go build here, interpolate the variable values
14-
LDFLAGS_APP=-ldflags "-X github.com/miniclip/gonsul/app.Version=${VERSION} -X github.com/miniclip/gonsul/app.BuildDate=${BUILD_DATE}"
14+
LDFLAGS_APP=-ldflags "-X github.com/scaleway/gonsul/app.Version=${VERSION} -X github.com/scaleway/gonsul/app.BuildDate=${BUILD_DATE}"
1515

1616
# Builds the application
1717
build:
@@ -24,7 +24,7 @@ GOPATH?=${HOME}/go
2424
mocks:
2525
@echo "=== Generating mocks ==="
2626
rm -rf ./tests/mocks/*.go
27-
go install github.com/vektra/mockery/v2/.../
27+
go install github.com/vektra/mockery/v2@latest
2828
CGO_ENABLED=0 $(GOPATH)/bin/mockery --all --output ./tests/mocks --dir ./app/
2929
CGO_ENABLED=0 $(GOPATH)/bin/mockery --all --output ./tests/mocks --dir ./internal/
3030
@echo "=== Done ==="

0 commit comments

Comments
 (0)