Skip to content

Commit 93a746f

Browse files
committed
WIP
1 parent d22c9da commit 93a746f

File tree

7 files changed

+133
-108
lines changed

7 files changed

+133
-108
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.circleci
2+
.github
23
keys
34
vendor
45
.gitignore

.github/workflows/docker-build.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
push:
55
branches: ['feature/github-actions-docker-build']
66

7-
env:
8-
REGISTRY: ghcr.io
9-
IMAGE_NAME: ${{ github.repository }}
10-
117
jobs:
128
build-and-push-image:
139
runs-on: ubuntu-latest
@@ -19,19 +15,25 @@ jobs:
1915
steps:
2016
- name: Checkout repository
2117
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
2220

2321
- name: Log in to the Container registry
2422
uses: docker/login-action@v3.4.0
2523
with:
26-
registry: ${{ env.REGISTRY }}
24+
registry: ghcr.io
2725
username: ${{ github.actor }}
2826
password: ${{ secrets.GITHUB_TOKEN }}
2927

3028
- name: Extract metadata (tags, labels) for Docker
3129
id: meta
3230
uses: docker/metadata-action@v5.7.0
3331
with:
34-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32+
images: |
33+
ghcr.io/${{ github.repository }}
34+
tags: |
35+
type=sha
36+
type=semver,pattern={{version}}
3537
3638
- name: Build and push Docker image
3739
id: push
@@ -41,10 +43,3 @@ jobs:
4143
push: false
4244
tags: ${{ steps.meta.outputs.tags }}
4345
labels: ${{ steps.meta.outputs.labels }}
44-
45-
- name: Generate artifact attestation
46-
uses: actions/attest-build-provenance@v2
47-
with:
48-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
49-
subject-digest: ${{ steps.push.outputs.digest }}
50-
push-to-registry: false

.github/workflows/goreleaser.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
branches: ['feature/github-actions-docker-build']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: stable
22+
23+
- name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v6
25+
with:
26+
distribution: goreleaser
27+
version: '~> v2'
28+
# args: release --skip=publish --release-notes release-notes.md
29+
args: build
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,26 @@ ENV HELM_SECRETS_VERSION=$GLOBAL_HELM_SECRETS_VERSION
2626
ENV SOPS_VERSION=$GLOBAL_SOPS_VERSION
2727
ENV HELM_DIFF_THREE_WAY_MERGE=true
2828

29-
RUN apk add --update --no-cache ca-certificates git openssh-client openssl ruby curl wget tar gzip make bash
29+
RUN apk add --update --no-cache ca-certificates git openssh-client openssl ruby curl wget tar gzip make bash \
30+
&& curl -L https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64 -o /usr/local/bin/sops \
31+
&& chmod +x /usr/local/bin/sops \
32+
&& curl --retry 5 -L https://dl.k8s.io/release/${KUBE_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \
33+
&& chmod +x /usr/local/bin/kubectl \
34+
&& curl --retry 5 -Lk https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar zxv -C /tmp \
35+
&& mv /tmp/linux-amd64/helm /usr/local/bin/helm && rm -rf /tmp/linux-amd64 \
36+
&& chmod +x /usr/local/bin/helm
3037

31-
RUN curl -L https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64 -o /usr/local/bin/sops \
32-
&& chmod +x /usr/local/bin/sops
33-
34-
RUN curl --retry 5 -L https://dl.k8s.io/release/${KUBE_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl
35-
RUN chmod +x /usr/local/bin/kubectl
36-
37-
RUN curl --retry 5 -Lk https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar zxv -C /tmp
38-
RUN mv /tmp/linux-amd64/helm /usr/local/bin/helm && rm -rf /tmp/linux-amd64
39-
RUN chmod +x /usr/local/bin/helm
40-
41-
RUN helm plugin install https://github.com/hypnoglow/helm-s3.git --version ${HELM_S3_VERSION}
42-
RUN helm plugin install https://github.com/nouney/helm-gcs --version ${HELM_GCS_VERSION}
43-
RUN helm plugin install https://github.com/databus23/helm-diff --version ${HELM_DIFF_VERSION}
44-
RUN helm plugin install https://github.com/jkroepke/helm-secrets --version ${HELM_SECRETS_VERSION}
38+
RUN helm plugin install https://github.com/hypnoglow/helm-s3.git --version ${HELM_S3_VERSION} \
39+
&& helm plugin install https://github.com/nouney/helm-gcs --version ${HELM_GCS_VERSION} \
40+
&& helm plugin install https://github.com/databus23/helm-diff --version ${HELM_DIFF_VERSION} \
41+
&& helm plugin install https://github.com/jkroepke/helm-secrets --version ${HELM_SECRETS_VERSION}
4542

4643
### Go Builder & Tester ###
4744
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder
4845

49-
RUN apk add --update --no-cache ca-certificates git openssh-client ruby bash make curl
50-
RUN gem install hiera-eyaml hiera-eyaml-gkms --no-doc
51-
RUN update-ca-certificates
46+
RUN apk add --update --no-cache ca-certificates git openssh-client ruby bash make curl \
47+
&& gem install hiera-eyaml hiera-eyaml-gkms --no-doc \
48+
&& update-ca-certificates
5249

5350
COPY --from=helm-installer /usr/local/bin/kubectl /usr/local/bin/kubectl
5451
COPY --from=helm-installer /usr/local/bin/helm /usr/local/bin/helm
@@ -69,9 +66,9 @@ RUN make test \
6966
### Final Image ###
7067
FROM alpine:${ALPINE_VERSION} AS base
7168

72-
RUN apk add --update --no-cache ca-certificates git openssh-client ruby curl bash gnupg gcompat
73-
RUN gem install hiera-eyaml hiera-eyaml-gkms --no-doc
74-
RUN update-ca-certificates
69+
RUN apk add --update --no-cache ca-certificates git openssh-client ruby curl bash gnupg gcompat \
70+
&& gem install hiera-eyaml hiera-eyaml-gkms --no-doc \
71+
&& update-ca-certificates
7572

7673
COPY --from=helm-installer /usr/local/bin/kubectl /usr/local/bin/kubectl
7774
COPY --from=helm-installer /usr/local/bin/helm /usr/local/bin/helm

go.mod

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
module github.com/mkubaczyk/helmsman
22

33
go 1.24.1
4+
45
require (
5-
cloud.google.com/go/storage v1.51.0
6+
cloud.google.com/go/storage v1.52.0
67
dario.cat/mergo v1.0.1
78
github.com/Azure/azure-pipeline-go v0.2.3
89
github.com/Azure/azure-storage-blob-go v0.15.0
910
github.com/BurntSushi/toml v1.5.0
1011
github.com/Masterminds/semver v1.5.0
1112
github.com/apsdehal/go-logger v0.0.0-20190515212710-b0d6ccfee0e6
12-
github.com/aws/aws-sdk-go v1.55.6
13+
github.com/aws/aws-sdk-go v1.55.7
1314
github.com/invopop/jsonschema v0.13.0
1415
github.com/logrusorgru/aurora v2.0.3+incompatible
1516
github.com/subosito/gotenv v1.6.0
@@ -19,13 +20,13 @@ require (
1920

2021
require (
2122
cel.dev/expr v0.19.2 // indirect
22-
cloud.google.com/go v0.118.3 // indirect
23-
cloud.google.com/go/auth v0.15.0 // indirect
24-
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
23+
cloud.google.com/go v0.120.0 // indirect
24+
cloud.google.com/go/auth v0.16.0 // indirect
25+
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
2526
cloud.google.com/go/compute/metadata v0.6.0 // indirect
26-
cloud.google.com/go/iam v1.4.1 // indirect
27+
cloud.google.com/go/iam v1.5.0 // indirect
2728
cloud.google.com/go/monitoring v1.24.0 // indirect
28-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect
29+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
2930
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
3031
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
3132
github.com/bahlo/generic-list-go v0.2.0 // indirect
@@ -39,33 +40,33 @@ require (
3940
github.com/go-logr/stdr v1.2.2 // indirect
4041
github.com/google/s2a-go v0.1.9 // indirect
4142
github.com/google/uuid v1.6.0 // indirect
42-
github.com/googleapis/enterprise-certificate-proxy v0.3.5 // indirect
43+
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
4344
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
4445
github.com/jmespath/go-jmespath v0.4.0 // indirect
4546
github.com/mailru/easyjson v0.7.7 // indirect
4647
github.com/mattn/go-ieproxy v0.0.1 // indirect
4748
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
4849
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
4950
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
50-
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
51-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
52-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
53-
go.opentelemetry.io/otel v1.34.0 // indirect
54-
go.opentelemetry.io/otel/metric v1.34.0 // indirect
55-
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
56-
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
57-
go.opentelemetry.io/otel/trace v1.34.0 // indirect
51+
go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
52+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
53+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
54+
go.opentelemetry.io/otel v1.35.0 // indirect
55+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
56+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
57+
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
58+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
5859
golang.org/x/crypto v0.37.0 // indirect
59-
golang.org/x/oauth2 v0.28.0 // indirect
60+
golang.org/x/oauth2 v0.29.0 // indirect
6061
golang.org/x/sync v0.13.0 // indirect
6162
golang.org/x/sys v0.32.0 // indirect
6263
golang.org/x/text v0.24.0 // indirect
63-
golang.org/x/time v0.10.0 // indirect
64-
google.golang.org/api v0.224.0 // indirect
64+
golang.org/x/time v0.11.0 // indirect
65+
google.golang.org/api v0.229.0 // indirect
6566
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
66-
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
67-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
68-
google.golang.org/grpc v1.71.0 // indirect
69-
google.golang.org/protobuf v1.36.5 // indirect
67+
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
68+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
69+
google.golang.org/grpc v1.71.1 // indirect
70+
google.golang.org/protobuf v1.36.6 // indirect
7071
gopkg.in/yaml.v3 v3.0.1 // indirect
7172
)

0 commit comments

Comments
 (0)