Skip to content

Commit 3db6416

Browse files
authored
Merge pull request #338 from nais/mega_bump
Mega bump
2 parents c55d607 + c999846 commit 3db6416

65 files changed

Lines changed: 846 additions & 1018 deletions

Some content is hidden

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

.github/workflows/check-dist.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
working-directory: actions/spa-setup-task
2525

2626
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-node@v4
27+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
28+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
2929
with:
3030
node-version: '20'
3131
- run: yarn install
@@ -41,7 +41,7 @@ jobs:
4141
id: diff
4242

4343
# If index.js was different than expected, upload the expected version as an artifact
44-
- uses: actions/upload-artifact@v4
44+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # ratchet:actions/upload-artifact@v7
4545
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
4646
with:
4747
name: dist

.github/workflows/master.yaml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,30 @@ env:
1414
GOOGLE_REGISTRY: "europe-north1-docker.pkg.dev"
1515

1616
jobs:
17+
check:
18+
name: Static analysis
19+
runs-on: ubuntu-22.04
20+
permissions:
21+
contents: read
22+
steps:
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
24+
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
25+
- run: mise run check
26+
27+
test:
28+
name: Tests
29+
runs-on: ubuntu-22.04
30+
permissions:
31+
contents: read
32+
steps:
33+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
34+
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
35+
- run: mise run test
36+
1737
build_and_push:
1838
name: Build, push and sign images
1939
runs-on: ubuntu-22.04
40+
needs: [check, test]
2041
permissions:
2142
contents: "read"
2243
id-token: "write"
@@ -35,21 +56,41 @@ jobs:
3556
chart: true
3657
- component: canary-deployer
3758
chart: true
59+
dockerfile: Dockerfile.deploy
60+
target: canary-deployer
61+
- component: deploy-action
62+
dockerfile: Dockerfile.deploy
63+
target: deploy-action
64+
- component: deploy
65+
target: deploy
3866
steps:
39-
- uses: actions/checkout@v4 # ratchet:exclude
40-
- uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # ratchet:azure/setup-helm@v3
67+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
68+
69+
- name: Set build metadata
70+
id: meta
71+
run: |
72+
echo "last_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
73+
echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
74+
echo "buildtime=$(date '+%s')" >> $GITHUB_OUTPUT
75+
76+
- uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # ratchet:azure/setup-helm@v5
4177
if: matrix.chart
4278
with:
4379
version: "v3.11.1"
4480
- name: "Build and push image"
45-
uses: nais/platform-build-push-sign@main # ratchet:exclude
81+
uses: nais/platform-build-push-sign@31014e4bcac554cb52525fe2364244c5166b84d2 # ratchet:nais/platform-build-push-sign@main
4682
id: build_push_sign
4783
with:
48-
dockerfile: Dockerfile.${{ matrix.component }}
84+
dockerfile: ${{ matrix.dockerfile || format('Dockerfile.{0}', matrix.component) }}
85+
target: ${{ matrix.target }}
4986
name: ${{ matrix.component }}
5087
google_service_account: gh-deploy
5188
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
5289
push: ${{ github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/master' }}
90+
build_args: |
91+
LAST_COMMIT=${{ steps.meta.outputs.last_commit }}
92+
DATE=${{ steps.meta.outputs.date }}
93+
BUILDTIME=${{ steps.meta.outputs.buildtime }}
5394
5495
- name: "Package chart"
5596
if: matrix.chart
@@ -78,7 +119,7 @@ jobs:
78119
- name: "Authenticate to Google Cloud"
79120
if: matrix.chart && github.ref == 'refs/heads/master'
80121
id: "auth"
81-
uses: "google-github-actions/auth@v2" # ratchet:exclude
122+
uses: "google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093" # ratchet:google-github-actions/auth@v3
82123
with:
83124
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
84125
service_account: "gh-deploy@nais-io.iam.gserviceaccount.com"
@@ -113,7 +154,7 @@ jobs:
113154
- build_and_push
114155
steps:
115156
- name: "Deploy hookd"
116-
uses: nais/fasit-deploy@v4 # ratchet:exclude
157+
uses: nais/fasit-deploy@9f870e05e92cde6cfd827b13384ec09e80be65fd # ratchet:nais/fasit-deploy@v4
117158
with:
118159
chart: oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/${{ needs.build_and_push.outputs.hookd_chart_name }}
119160
version: ${{ needs.build_and_push.outputs.hookd_chart_version }}
@@ -124,7 +165,7 @@ jobs:
124165
]
125166
126167
- name: "Deploy deployd"
127-
uses: nais/fasit-deploy@v4 # ratchet:exclude
168+
uses: nais/fasit-deploy@9f870e05e92cde6cfd827b13384ec09e80be65fd # ratchet:nais/fasit-deploy@v4
128169
with:
129170
chart: oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/${{ needs.build_and_push.outputs.deployd_chart_name }}
130171
version: ${{ needs.build_and_push.outputs.deployd_chart_version }}
@@ -137,7 +178,7 @@ jobs:
137178
]
138179
139180
- name: "Deploy canary-deployer"
140-
uses: nais/fasit-deploy@v4 # ratchet:exclude
181+
uses: nais/fasit-deploy@9f870e05e92cde6cfd827b13384ec09e80be65fd # ratchet:nais/fasit-deploy@v4
141182
with:
142183
chart: oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/${{ needs.build_and_push.outputs.canary_deployer_chart_name }}
143184
version: ${{ needs.build_and_push.outputs.canary_deployer_chart_version }}
@@ -154,11 +195,9 @@ jobs:
154195
- build_and_push
155196
runs-on: ubuntu-22.04
156197
steps:
157-
- uses: actions/checkout@v4 # ratchet:exclude
198+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
158199

159-
- uses: actions/setup-go@v5
160-
with:
161-
go-version: 'stable'
200+
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
162201

163202
- name: Force create tag
164203
env:
@@ -170,9 +209,9 @@ jobs:
170209
171210
- name: Create deploy binaries
172211
run: |
173-
make deploy-release-linux
174-
make deploy-release-darwin
175-
make deploy-release-windows
212+
mise run release:linux
213+
mise run release:darwin
214+
mise run release:windows
176215
177216
- name: Delete release if exists
178217
env:

.github/workflows/test-job.yaml

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

.github/workflows/test-naisjob-without-schedule.yaml

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

.github/workflows/test-naisjob.yaml

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

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @navikt/aura
1+
* @navikt/nais

Dockerfile.canary-deployer

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

Dockerfile.deploy

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
FROM golang:1.26-alpine AS builder
22

3-
RUN apk add --no-cache git make curl
3+
ARG LAST_COMMIT=local
4+
ARG DATE=unknown
5+
ARG BUILDTIME=0
6+
47
ENV GOOS=linux
58
ENV CGO_ENABLED=0
69

@@ -11,14 +14,36 @@ COPY go.sum .
1114
RUN go mod download
1215
COPY . .
1316

14-
RUN make kubebuilder
15-
RUN make test
16-
RUN make deploy-alpine
17+
RUN go build -a -installsuffix cgo -o bin/deploy \
18+
-ldflags "-s -X github.com/nais/deploy/pkg/version.Revision=${LAST_COMMIT} -X github.com/nais/deploy/pkg/version.Date=${DATE} -X github.com/nais/deploy/pkg/version.BuildUnixTime=${BUILDTIME}" \
19+
./cmd/deploy/
1720

1821

19-
FROM alpine:3
22+
FROM alpine:3 AS deploy
2023

2124
WORKDIR /app
2225
RUN apk add --no-cache ca-certificates wget
2326
COPY --from=builder /src/bin/deploy .
2427
CMD ["/app/deploy"]
28+
29+
30+
FROM alpine:3 AS canary-deployer
31+
32+
WORKDIR /app
33+
RUN apk add --no-cache ca-certificates
34+
COPY --from=builder /src/bin/deploy .
35+
ADD canary-deployer/deployer.sh /canary/deployer.sh
36+
ADD canary-deployer/canary.yml /canary/resource.yml
37+
ENV RESOURCE=/canary/resource.yml
38+
CMD ["/canary/deployer.sh"]
39+
40+
41+
FROM alpine:3 AS deploy-action
42+
43+
WORKDIR /app
44+
ENV TZ="Europe/Oslo"
45+
RUN apk add --no-cache ca-certificates curl jq
46+
RUN curl -L -f https://github.com/mikefarah/yq/releases/download/2.4.1/yq_linux_amd64 > /usr/local/bin/yq && chmod +x /usr/local/bin/yq
47+
COPY --from=builder /src/bin/deploy .
48+
COPY actions/deploy/entrypoint.sh /entrypoint.sh
49+
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile.deploy-action

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

Dockerfile.deployd

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
FROM golang:1.26-alpine AS builder
22

3-
RUN apk add --no-cache git make curl
3+
ARG LAST_COMMIT=local
4+
ARG DATE=unknown
5+
ARG BUILDTIME=0
6+
47
ENV GOOS=linux
58
ENV CGO_ENABLED=0
69

@@ -11,9 +14,9 @@ COPY go.sum .
1114
RUN go mod download
1215
COPY . .
1316

14-
RUN make kubebuilder
15-
RUN make test
16-
RUN make deployd-alpine
17+
RUN go build -a -installsuffix cgo -o bin/deployd \
18+
-ldflags "-s -X github.com/nais/deploy/pkg/version.Revision=${LAST_COMMIT} -X github.com/nais/deploy/pkg/version.Date=${DATE} -X github.com/nais/deploy/pkg/version.BuildUnixTime=${BUILDTIME}" \
19+
./cmd/deployd/
1720

1821

1922
FROM alpine:3

0 commit comments

Comments
 (0)