forked from istio/istio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-commit.sh
executable file
·105 lines (89 loc) · 2.8 KB
/
release-commit.sh
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
WD=$(dirname "$0")
WD=$(cd "$WD"; pwd)
ROOT=$(dirname "$WD")
set -eux
# shellcheck source=prow/lib.sh
source "${ROOT}/prow/lib.sh"
setup_gcloud_credentials
# Old prow image does not set this, so needed explicitly here as this is not called through make
export GO111MODULE=on
DOCKER_HUB=${DOCKER_HUB:-gcr.io/istio-testing}
GCS_BUCKET=${GCS_BUCKET:-istio-build/dev}
# Use a pinned version in case breaking changes are needed
BUILDER_SHA=343862e8279d9acd0308256b69a5f93fe74d5fde
# Reference to the next minor version of Istio
# This will create a version like 1.4-alpha.sha
NEXT_VERSION=1.12
TAG=$(git rev-parse HEAD)
VERSION="${NEXT_VERSION}-alpha.${TAG}"
# In CI we want to store the outputs to artifacts, which will preserve the build
# If not specified, we can just create a temporary directory
WORK_DIR="$(mktemp -d)/build"
mkdir -p "${WORK_DIR}"
MANIFEST=$(cat <<EOF
version: ${VERSION}
docker: ${DOCKER_HUB}
directory: ${WORK_DIR}
ignoreVulnerability: true
dependencies:
${DEPENDENCIES:-$(cat <<EOD
istio:
localpath: ${ROOT}
api:
git: https://github.com/istio/api
auto: modules
proxy:
git: https://github.com/istio/proxy
auto: deps
pkg:
git: https://github.com/istio/pkg
auto: modules
client-go:
git: https://github.com/istio/client-go
branch: master
gogo-genproto:
git: https://github.com/istio/gogo-genproto
branch: master
test-infra:
git: https://github.com/istio/test-infra
branch: master
tools:
git: https://github.com/istio/tools
branch: master
EOD
)}
dashboards:
istio-mesh-dashboard: 7639
istio-performance-dashboard: 11829
istio-service-dashboard: 7636
istio-workload-dashboard: 7630
pilot-dashboard: 7645
istio-extension-dashboard: 13277
${PROXY_OVERRIDE:-}
EOF
)
# "Temporary" hacks
export PATH=${GOPATH}/bin:${PATH}
# cd to not impact go.mod
(cd /tmp; go get "istio.io/release-builder@${BUILDER_SHA}")
release-builder build --manifest <(echo "${MANIFEST}")
release-builder validate --release "${WORK_DIR}/out"
if [[ -z "${DRY_RUN:-}" ]]; then
release-builder publish --release "${WORK_DIR}/out" \
--gcsbucket "${GCS_BUCKET}" --gcsaliases "${NEXT_VERSION}-dev,latest" \
--dockerhub "${DOCKER_HUB}" --dockertags "${VERSION},${NEXT_VERSION}-dev,latest"
fi