Skip to content

Commit deca8e0

Browse files
authored
Merge pull request #3700 from Random-Liu/automate-cri-tarball-release
[release/1.2] Automate CRI tarball release.
2 parents b34a5c8 + 889f5f8 commit deca8e0

6 files changed

Lines changed: 104 additions & 11 deletions

File tree

.travis.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,22 @@ after_success:
9696

9797
before_deploy:
9898
- make release
99+
- if [ "$TRAVIS_GOOS" = "linux" ]; then make cri-release; fi
99100

100101
deploy:
101-
provider: releases
102-
api_key:
103-
secure: HO+WSIVVUMMsbU74x+YyFsTP3ahqnR4xjwKAziedJ5lZXKJszQBhiYTFmcTeVBoouNjTISd07GQzpoLChuGC20U3+1NbT+CkK8xWR/x1ao2D3JY3Ds6AD9ubWRNWRLptt/xOn5Vq3F8xZyUYchwvDMl4zKCuTKxQGVdHKsINb2DehKcP5cVL6MMvqzEdfj2g99vqXAqs8uuo6dOmvxmHV43bfzDaAJSabjZZs6TKlWTqCQMet8uxyx2Dmjl2lxLwdqv12oJdrszacasn41NYuEyHI2bXyef1mhWGYN4n9bU/Y5winctZ8DOSOZvYg/2ziAaUN0+CTn1IESwVesrPz23P2Sy7wdLxu8dSIZ2yUHl7OsA5T5a5rDchAGguRVNBWvoGtuepEhdRacxTQUo1cMFZsEXjgRKKjdfc1emYQPVdN8mBv8GJwndty473ZXdvFt5R0kNVFtvWuYCa6UYJD2cKrsPSAfbZCDC/LiR3FOoTaUPMZUVkR2ACEO7Dn4+KlmBajqT40Osk/A7k1XA/TzVhMIpLtE0Vk2DfPmGsjCv8bC+MFd+R2Sc8SFdE92oEWRdoPQY5SxMYQtGxA+cbKVlT1kSw6y80yEbx5JZsBnT6+NTHwmDO3kVU9ztLdawOozTElKNAK8HoAyFmzIZ3wL64oThuDrv/TUuY8Iyn814=
104-
file_glob: true
105-
file: releases/*.tar.gz
106-
skip_cleanup: true
107-
on:
108-
repo: containerd/containerd
109-
tags: true
102+
- provider: releases
103+
api_key:
104+
secure: HO+WSIVVUMMsbU74x+YyFsTP3ahqnR4xjwKAziedJ5lZXKJszQBhiYTFmcTeVBoouNjTISd07GQzpoLChuGC20U3+1NbT+CkK8xWR/x1ao2D3JY3Ds6AD9ubWRNWRLptt/xOn5Vq3F8xZyUYchwvDMl4zKCuTKxQGVdHKsINb2DehKcP5cVL6MMvqzEdfj2g99vqXAqs8uuo6dOmvxmHV43bfzDaAJSabjZZs6TKlWTqCQMet8uxyx2Dmjl2lxLwdqv12oJdrszacasn41NYuEyHI2bXyef1mhWGYN4n9bU/Y5winctZ8DOSOZvYg/2ziAaUN0+CTn1IESwVesrPz23P2Sy7wdLxu8dSIZ2yUHl7OsA5T5a5rDchAGguRVNBWvoGtuepEhdRacxTQUo1cMFZsEXjgRKKjdfc1emYQPVdN8mBv8GJwndty473ZXdvFt5R0kNVFtvWuYCa6UYJD2cKrsPSAfbZCDC/LiR3FOoTaUPMZUVkR2ACEO7Dn4+KlmBajqT40Osk/A7k1XA/TzVhMIpLtE0Vk2DfPmGsjCv8bC+MFd+R2Sc8SFdE92oEWRdoPQY5SxMYQtGxA+cbKVlT1kSw6y80yEbx5JZsBnT6+NTHwmDO3kVU9ztLdawOozTElKNAK8HoAyFmzIZ3wL64oThuDrv/TUuY8Iyn814=
105+
file_glob: true
106+
file: releases/*.tar.gz
107+
skip_cleanup: true
108+
on:
109+
repo: containerd/containerd
110+
tags: true
111+
- provider: script
112+
script: bash script/release/deploy-cri
113+
skip_cleanup: true
114+
on:
115+
repo: containerd/containerd
116+
tags: true
117+
condition: $TRAVIS_GOOS = linux

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,19 @@ install-man:
203203
@echo "$(WHALE) $@"
204204
$(foreach manpage,$(addprefix man/,$(MANPAGES)), $(call installmanpage,$(manpage),$(subst .,,$(suffix $(manpage))),$(notdir $(manpage))))
205205

206-
release: $(BINARIES)
206+
releases/$(RELEASE).tar.gz: $(BINARIES)
207207
@echo "$(WHALE) $@"
208208
@rm -rf releases/$(RELEASE) releases/$(RELEASE).tar.gz
209209
@install -d releases/$(RELEASE)/bin
210210
@install $(BINARIES) releases/$(RELEASE)/bin
211211
@cd releases/$(RELEASE) && tar -czf ../$(RELEASE).tar.gz *
212212

213+
release: $(BINARIES) releases/$(RELEASE).tar.gz
214+
215+
cri-release: $(BINARIES) releases/$(RELEASE).tar.gz
216+
@echo "$(WHALE) $@"
217+
@VERSION=$(VERSION:v%=%) script/release/release-cri
218+
213219
clean: ## clean up binaries
214220
@echo "$(WHALE) $@"
215221
@rm -f $(BINARIES)

script/release/deploy-cri

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright The containerd Authors.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
#
18+
# Deploy the cri-containerd release tarball to gcs.
19+
#
20+
set -eu -o pipefail
21+
22+
ROOT=${GOPATH}/src/github.com/containerd/containerd
23+
BUCKET="gs://cri-containerd-release"
24+
25+
rm -rf "${HOME}/google-cloud-sdk"
26+
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
27+
curl https://sdk.cloud.google.com | bash > /dev/null
28+
gcloud version
29+
30+
openssl aes-256-cbc -K $encrypted_5a565171e51f_key -iv $encrypted_5a565171e51f_iv -in "${ROOT}/script/release/gcp-secret.json.enc" -out gcp-secret.json -d
31+
gcloud auth activate-service-account --key-file gcp-secret.json --project=k8s-cri-containerd
32+
33+
for file in $(ls "${ROOT}"/releases/cri/*.tar.gz.sha256); do
34+
output="$(gsutil cp -n "${file}" "${BUCKET}" 2>&1)"
35+
if [[ "$output" =~ "Skipping existing item" ]];then
36+
echo "$(basename ${file}) already exists, skip the release tarball"
37+
continue
38+
fi
39+
gsutil cp "${file%.sha256}" "${BUCKET}"
40+
done

script/release/gcp-secret.json.enc

2.3 KB
Binary file not shown.

script/release/release-cri

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright The containerd Authors.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
#
18+
# Releases and publishes cri-containerd release tarball.
19+
#
20+
set -eu -o pipefail
21+
22+
if [[ -z "${VERSION:-}" ]]; then
23+
echo "VERSION is not set"
24+
exit 1
25+
fi
26+
27+
ROOT=${GOPATH}/src/github.com/containerd/containerd
28+
CRI_COMMIT=$(grep github.com/containerd/cri ${ROOT}/vendor.conf | cut -d " " -f 2)
29+
30+
go get -d github.com/containerd/cri/...
31+
cd $GOPATH/src/github.com/containerd/cri
32+
git checkout $CRI_COMMIT
33+
make clean
34+
make release TARBALL_PREFIX=cri-containerd LOCAL_RELEASE=true VERSION=${VERSION} VENDOR=${ROOT}/vendor.conf
35+
make release TARBALL_PREFIX=cri-containerd-cni LOCAL_RELEASE=true INCLUDE_CNI=true VERSION=${VERSION} VENDOR=${ROOT}/vendor.conf
36+
37+
mkdir -p ${ROOT}/releases/cri
38+
cp _output/*.tar.gz ${ROOT}/releases/cri
39+
cp _output/*.tar.gz.sha256 ${ROOT}/releases/cri

vendor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ github.com/google/go-cmp v0.1.0
4343
go.etcd.io/bbolt v1.3.1-etcd.8
4444

4545
# cri dependencies
46-
github.com/containerd/cri 40affe7c7402d41618b9791a8cf105ac74ce56d0 # release/1.2 branch
46+
github.com/containerd/cri bab7348fcfcc795e0dda2cc02e8cac6316c85edc # release/1.2 branch
4747
github.com/containerd/go-cni 40bcf8ec8acd7372be1d77031d585d5d8e561c90
4848
github.com/blang/semver v3.1.0
4949
github.com/containernetworking/cni v0.6.0

0 commit comments

Comments
 (0)