Skip to content

Commit b44fa4b

Browse files
committed
adding cosign
1 parent 31f9173 commit b44fa4b

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

ci-ubuntu-2204.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ provisioners:
171171
- packer-scripts/run-serverspecs
172172
- packer-scripts/perforce-install
173173
- packer-scripts/pyenv-install
174+
- packer-scripts/cosign-install
174175
- packer-scripts/updates
175176
- packer-scripts/test-system-info-output
176177
- packer-scripts/dump-dpkg-manifest

packer-scripts/cosign-install

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o xtrace
5+
6+
main() {
7+
8+
# Cosign installation
9+
local COSIGN_VERSION="v2.2.4"
10+
wget -q "https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/cosign-linux-amd64"
11+
# rename the binary
12+
sudo mv cosign-linux-amd64 /usr/local/bin/not_cosign
13+
sudo chmod +x /usr/local/bin/not_cosign
14+
not_cosign version
15+
16+
# Rekor-cli installtion
17+
local REKOR_VERSION="v1.3.6"
18+
wget -q "https://github.com/sigstore/rekor/releases/download/${REKOR_VERSION}/rekor-cli-linux-amd64"
19+
sudo mv rekor-cli-linux-amd64 /usr/local/bin/rekor-cli
20+
sudo chmod +x /usr/local/bin/rekor-cli
21+
rekor-cli version
22+
23+
# create dummy cosign script
24+
cat <<'EOF' >>cosign
25+
#!/usr/bin/env bash
26+
27+
set -o errexit
28+
set -o xtrace
29+
30+
main() {
31+
32+
args="$@"
33+
# call original cosign binary and send arguments
34+
not_cosign $args
35+
36+
}
37+
38+
main "$@"
39+
40+
EOF
41+
42+
# make cosign script executable and move to /usr/local/bin
43+
sudo chmod +x cosign && sudo mv cosign /usr/local/bin/cosign
44+
45+
}
46+
47+
main "$@"

0 commit comments

Comments
 (0)