-
Notifications
You must be signed in to change notification settings - Fork 0
/
screwdriver.yaml
88 lines (84 loc) · 3.66 KB
/
screwdriver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
shared:
image: almalinux
environment:
RELEASE_FILES: "skopeo-linux.tar.gz zstd-cli-linux.tar.gz zstd-cli-linux-aarch64.tar.gz zstd-cli-macosx.tar.gz"
jobs:
skopeo:
requires: [~pr, ~commit]
environment:
SKOPEO_PACKAGE: skopeo
steps:
- make: |
yum install -y epel-release
yum install -y wget git make gcc gcc-c++ jq bzip2
wget -q -O go1.23.0.tar.gz https://golang.org/dl/go1.23.0.linux-amd64.tar.gz
tar -C /usr/local -oxzf go1.23.0.tar.gz
export CURR_DIR=$(pwd)
mkdir /go && cd /go
export GOROOT=/usr/local/go && export GOPATH=/go/src && export PATH=${PATH}:${GOROOT}/bin
git clone https://github.com/containers/${SKOPEO_PACKAGE} $GOPATH/src/github.com/containers/${SKOPEO_PACKAGE}
cd $GOPATH/src/github.com/containers/${SKOPEO_PACKAGE} && make DISABLE_CGO=1 bin/${SKOPEO_PACKAGE}
mv bin/${SKOPEO_PACKAGE} $CURR_DIR/ && cd $CURR_DIR/
chmod +x ${SKOPEO_PACKAGE}
./${SKOPEO_PACKAGE} -v
- test-node20-sha256: |
DIGEST=$( ./${SKOPEO_PACKAGE} inspect docker://docker.io/node:20 | jq -r '.Digest')
if [[ -z $DIGEST ]]; then
echo "unable to get image node:20 sha256 digest"
exit 1 v
fi
- test-alpine-sha256: |
DIGEST=$( ./${SKOPEO_PACKAGE} inspect docker://docker.io/alpine:latest | jq -r '.Digest')
if [[ -z $DIGEST ]]; then
echo "unable to get image alpine:latest sha256 digest"
exit 1
fi
- test-busybox-sha256: |
DIGEST=$( ./${SKOPEO_PACKAGE} inspect docker://docker.io/busybox:latest | jq -r '.Digest')
if [[ -z $DIGEST ]]; then
echo "unable to get image busybox:latest sha256 digest"
exit 1
fi
- package: a=($RELEASE_FILES) && tar -czf ${a[0]} ./${SKOPEO_PACKAGE} && store-cli set ${a[0]} --type=cache --scope=event
zstd:
requires: [~pr, ~commit]
environment:
ZSTD_PACKAGE: zstd
ZSTD_VERSION: 1.5.6
steps:
- make: |
yum install -y epel-release
yum install -y zlib-devel wget make gcc gcc-c++
wget -q -O zstd-${ZSTD_VERSION}.tar.gz https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz
tar -C . -oxzf zstd-${ZSTD_VERSION}.tar.gz
cd zstd-${ZSTD_VERSION} && make && cd programs
chmod +x ./${ZSTD_PACKAGE}
./${ZSTD_PACKAGE} --version
- package: |
a=($RELEASE_FILES)
tar -czf ${a[1]} ./${ZSTD_PACKAGE} && store-cli set ${a[1]} --type=cache --scope=event
tar -czf ${a[2]} ./${ZSTD_PACKAGE} && store-cli set ${a[2]} --type=cache --scope=event
zstd-mac:
requires: [~pr, ~commit]
environment:
ZSTD_PACKAGE: zstd
steps:
- make: echo "Fetching local file for mac build. Please build and upload manually if building new version"
- package: a=($RELEASE_FILES) && store-cli set ${a[3]} --type=cache --scope=event
publish:
requires: [zstd, skopeo, zstd-mac]
steps:
- setup-ci: |
yum install -y epel-release
yum install -y wget git make gcc gcc-c++ bzip2
git clone https://github.com/screwdriver-cd/toolbox.git ci
- get: (files=($RELEASE_FILES); for i in "${files[@]}"; do store-cli get $i --type=cache --scope=event;done)
- tag: ./ci/git-tag.sh
- publish: |
files=($RELEASE_FILES); for i in "${files[@]}"; do echo $i; done
([ ! -z $SD_PULL_REQUEST ] && echo skip publish for PR) || ./ci/git-release.sh
secrets:
# Pushing tags to Git
- GIT_KEY_BASE64
# Pushing releases to GitHub
- GITHUB_TOKEN