Skip to content

Commit 01ab7df

Browse files
authored
Merge 6047d93 into 31dd7dd
2 parents 31dd7dd + 6047d93 commit 01ab7df

File tree

71 files changed

+4457
-3758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4457
-3758
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
22
# Ignore build and test binaries.
33
bin/
4-
testbin/

.github/workflows/helm.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build and Release
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
pull_request:
7+
branches:
8+
- 'v*'
9+
types:
10+
# action should run when the pull request is closed
11+
# (regardless of whether it was merged or just closed)
12+
- closed
13+
# Make sure the action runs every time new commits are
14+
# pushed to the pull request's branch
15+
- synchronize
16+
17+
env:
18+
REGISTRY: ghcr.io
19+
20+
jobs:
21+
helm:
22+
runs-on: ubuntu-latest
23+
if: github.event.pull_request.merged == true
24+
steps:
25+
- name: Set IMAGE_NAME
26+
run: |
27+
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
28+
29+
# Checkout code
30+
# https://github.com/actions/checkout
31+
- name: Checkout code
32+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
33+
34+
# Extract metadata (tags, labels) to use in Helm chart
35+
# https://github.com/docker/metadata-action
36+
- name: Extract Docker metadata
37+
id: meta
38+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
42+
# Set version from DOCKER_METADATA_OUTPUT_VERSION as environment variable
43+
- name: Set Version
44+
run: |
45+
echo "VERSION=${DOCKER_METADATA_OUTPUT_VERSION:1}" >> $GITHUB_ENV
46+
47+
# Change version and appVersion in Chart.yaml to the tag in the closed PR
48+
- name: Update Helm App/Chart Version
49+
shell: bash
50+
run: |
51+
sed -i "s/^version: .*/version: ${{ env.VERSION }}/g" deploy/charts/command-cert-manager-issuer/Chart.yaml
52+
sed -i "s/^appVersion: .*/appVersion: \"${{ env.DOCKER_METADATA_OUTPUT_VERSION }}\"/g" deploy/charts/command-cert-manager-issuer/Chart.yaml
53+
54+
# Setup Helm
55+
# https://github.com/Azure/setup-helm
56+
- name: Install Helm
57+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
61+
# Helm requires an ident name to be set for chart-releaser to work
62+
- name: Configure Git
63+
run: |
64+
git config user.name "$GITHUB_ACTOR"
65+
git config user.email "[email protected]"
66+
67+
# Build and release Helm chart to GitHub Pages
68+
# https://github.com/helm/chart-releaser-action
69+
- name: Run chart-releaser
70+
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
71+
env:
72+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
73+
with:
74+
charts_dir: deploy/charts
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Keyfactor Bootstrap Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, closed, synchronize, edited, reopened]
7+
push:
8+
create:
9+
branches:
10+
- 'release-*.*'
11+
12+
jobs:
13+
call-starter-workflow:
14+
uses: keyfactor/actions/.github/workflows/starter.yml@v3
15+
secrets:
16+
token: ${{ secrets.V2BUILDTOKEN}}
17+
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
18+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
19+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
20+
scan_token: ${{ secrets.SAST_TOKEN }}
21+
docker-user: ${{ secrets.DOCKER_USER }}
22+
docker-token: ${{ secrets.DOCKER_PWD }}
23+

.github/workflows/release.yml

Lines changed: 0 additions & 213 deletions
This file was deleted.

.golangci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
run:
2+
deadline: 5m
3+
allow-parallel-runners: true
4+
5+
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
11+
exclude-rules:
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "internal/*"
16+
linters:
17+
- dupl
18+
- lll
19+
linters:
20+
disable-all: true
21+
enable:
22+
- dupl
23+
- errcheck
24+
- exportloopref
25+
- goconst
26+
- gocyclo
27+
- gofmt
28+
- goimports
29+
- gosimple
30+
- govet
31+
- ineffassign
32+
- lll
33+
- misspell
34+
- nakedret
35+
- prealloc
36+
- staticcheck
37+
- typecheck
38+
- unconvert
39+
- unparam
40+
- unused

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.19 as builder
2+
FROM golang:1.23.4 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

@@ -12,7 +12,7 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY main.go main.go
15+
COPY cmd/main.go cmd/main.go
1616
COPY api/ api/
1717
COPY internal/ internal/
1818

@@ -21,7 +21,7 @@ COPY internal/ internal/
2121
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2222
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2323
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
24-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
24+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
2525

2626
# Use distroless as minimal base image to package the manager binary
2727
# Refer to https://github.com/GoogleContainerTools/distroless for more details

0 commit comments

Comments
 (0)