Skip to content

Commit 3872532

Browse files
committed
ci: add fips check
1 parent 488eff3 commit 3872532

File tree

7 files changed

+111
-92
lines changed

7 files changed

+111
-92
lines changed

.tekton/client-server-pull-request.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ spec:
3333
value: "true"
3434
- name: build-source-image
3535
value: "true"
36+
- name: fips-check
37+
value: "true"
3638
pipelineRef:
3739
params:
3840
- name: url

.tekton/client-server-push.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ spec:
3030
value: "true"
3131
- name: build-source-image
3232
value: "true"
33+
- name: fips-check
34+
value: "true"
3335
pipelineRef:
3436
params:
3537
- name: url

.tekton/cosign-pull-request.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,22 @@ spec:
4141
value: "true"
4242
- name: go_unit_test
4343
value: "true"
44+
- name: build-platforms
45+
value:
46+
- linux/x86_64
47+
- linux/arm64
48+
- linux/ppc64le
49+
- linux/s390x
50+
- name: fips-check
51+
value: "true"
4452
pipelineRef:
4553
params:
4654
- name: url
4755
value: https://github.com/securesign/pipelines.git
4856
- name: revision
4957
value: main
5058
- name: pathInRepo
51-
value: pipelines/docker-build-oci-ta.yaml
59+
value: pipelines/docker-build-multi-platform-oci-ta.yaml
5260
resolver: git
5361
taskRunTemplate:
5462
serviceAccountName: build-pipeline-cosign

.tekton/cosign-push.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,22 @@ spec:
3838
value: "true"
3939
- name: go_unit_test
4040
value: "true"
41+
- name: build-platforms
42+
value:
43+
- linux/x86_64
44+
- linux/arm64
45+
- linux/ppc64le
46+
- linux/s390x
47+
- name: fips-check
48+
value: "true"
4149
pipelineRef:
4250
params:
4351
- name: url
4452
value: https://github.com/securesign/pipelines.git
4553
- name: revision
4654
value: main
4755
- name: pathInRepo
48-
value: pipelines/docker-build-oci-ta.yaml
56+
value: pipelines/docker-build-multi-platform-oci-ta.yaml
4957
resolver: git
5058
taskRunTemplate:
5159
serviceAccountName: build-pipeline-cosign

Build.mak

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
GIT_VERSION ?= $(shell git describe --tags --always --dirty)
32
GIT_HASH ?= $(shell git rev-parse HEAD)
43
DATE_FMT = +%Y-%m-%dT%H:%M:%SZ
@@ -18,34 +17,19 @@ LDFLAGS=-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=$(GIT_VERSION)
1817
-X sigs.k8s.io/release-utils/version.gitCommit=$(GIT_HASH) \
1918
-X sigs.k8s.io/release-utils/version.gitTreeState=$(GIT_TREESTATE) \
2019
-X sigs.k8s.io/release-utils/version.buildDate=$(BUILD_DATE)
20+
FIPS_MODULE ?= latest
2121

2222
.PHONY:
23-
cross-platform: cosign-darwin-arm64 cosign-darwin-amd64 cosign-linux-amd64 cosign-linux-arm64 cosign-linux-ppc64le cosign-linux-s390x cosign-windows-amd64 ## Build all distributable (cross-platform) binaries
23+
cross-platform: cosign-darwin-arm64 cosign-darwin-amd64 cosign-windows-amd64 ## Build all distributable (cross-platform) binaries
2424

2525
.PHONY: cosign-darwin-arm64
2626
cosign-darwin-arm64: ## Build for mac M1
27-
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o cosign-darwin-arm64 -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
27+
env CGO_ENABLED=0 GOFIPS140=$(FIPS_MODULE) GOOS=darwin GOARCH=arm64 go build -o cosign-darwin-arm64 -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
2828

2929
.PHONY: cosign-darwin-amd64
3030
cosign-darwin-amd64: ## Build for Darwin (macOS)
31-
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o cosign-darwin-amd64 -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
32-
33-
.PHONY: cosign-linux-amd64
34-
cosign-linux-amd64: ## Build for Linux amd64
35-
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o cosign-linux-amd64 -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
36-
37-
.PHONY: cosign-linux-arm64
38-
cosign-linux-arm64: ## Build for Linux arm64
39-
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o cosign-linux-arm64 -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
40-
41-
.PHONY: cosign-linux-ppc64le
42-
cosign-linux-ppc64le: ## Build for Linux ppc64le
43-
env CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o cosign-linux-ppc64le -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
44-
45-
.PHONY: cosign-linux-s390x
46-
cosign-linux-s390x: ## Build for Linux s390x
47-
env CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o cosign-linux-s390x -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
31+
env CGO_ENABLED=0 GOFIPS140=$(FIPS_MODULE) GOOS=darwin GOARCH=amd64 go build -o cosign-darwin-amd64 -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
4832

4933
.PHONY: cosign-windows-amd64
5034
cosign-windows-amd64: ## Build for Windows
51-
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o cosign-windows-amd64.exe -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign
35+
env CGO_ENABLED=0 GOFIPS140=$(FIPS_MODULE) GOOS=windows GOARCH=amd64 go build -o cosign-windows-amd64.exe -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/cosign

0 commit comments

Comments
 (0)