File tree 3 files changed +68
-7
lines changed
3 files changed +68
-7
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,23 @@ release-binaries: clean
174
174
hack/extract-release.sh
175
175
.PHONY : release-binaries
176
176
177
+ # Release the integrated components for OpenShift, logging and metrics.
178
+ #
179
+ # Example:
180
+ # make release-components
181
+ release-components : clean
182
+ hack/release-components.sh
183
+ .PHONY : release-components
184
+
185
+ # Perform an official release. Requires HEAD of the repository to have a matching
186
+ # tag. Will push images that are tagged tagged with the latest release commit.
187
+ #
188
+ # Example:
189
+ # make perform-official-release
190
+ perform-official-release : | release-binaries release-components
191
+ OS_PUSH_ALWAYS=" 1" OS_PUSH_TAG=" HEAD" OS_PUSH_LOCAL=" 1" hack/push-release.sh
192
+ .PHONY : perform-official-release
193
+
177
194
# Build the cross compiled release binaries
178
195
#
179
196
# Example:
Original file line number Diff line number Diff line change @@ -20,7 +20,15 @@ cd "${OS_ROOT}"
20
20
# Allow a release to be repushed with a tag
21
21
tag=" ${OS_PUSH_TAG:- } "
22
22
if [[ -n " ${tag} " ]]; then
23
- tag=" :${tag} "
23
+ if [[ " ${tag} " == " HEAD" ]]; then
24
+ if [[ " $( git tag --points-at HEAD | wc -l ) " -ne 1 ]]; then
25
+ echo " error: There must be exactly one tag pointing to HEAD to use OS_PUSH_TAG=HEAD"
26
+ exit 1
27
+ fi
28
+ tag=" :$( git tag --points-at HEAD) "
29
+ else
30
+ tag=" :${tag} "
31
+ fi
24
32
else
25
33
tag=" :latest"
26
34
fi
77
85
# Pull latest in preparation for tagging
78
86
if [[ " ${tag} " != " :latest" ]]; then
79
87
if [[ -z " ${OS_PUSH_LOCAL-} " ]]; then
80
- set -e
81
88
for image in " ${images[@]} " ; do
82
89
docker pull " ${OS_PUSH_BASE_REGISTRY-}${image} :${source_tag} "
83
90
done
84
- set +e
85
91
else
86
92
echo " WARNING: Pushing local :${source_tag} images to ${OS_PUSH_BASE_REGISTRY-} *${tag} "
87
- echo " CTRL+C to cancel, or any other key to continue"
88
- read
93
+ if [[ -z " ${OS_PUSH_ALWAYS:- } " ]]; then
94
+ echo " CTRL+C to cancel, or any other key to continue"
95
+ read
96
+ fi
89
97
fi
90
98
fi
91
99
92
100
if [[ " ${OS_PUSH_BASE_REGISTRY-} " != " " || " ${tag} " != " " ]]; then
93
- set -e
94
101
for image in " ${images[@]} " ; do
95
102
docker tag -f " ${image} :${source_tag} " " ${OS_PUSH_BASE_REGISTRY-}${image}${tag} "
96
103
done
97
- set +e
98
104
fi
99
105
100
106
for image in " ${images[@]} " ; do
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This script builds and pushes a release to DockerHub.
4
+
5
+ set -o errexit
6
+ set -o nounset
7
+ set -o pipefail
8
+
9
+ OS_ROOT=$( dirname " ${BASH_SOURCE} " ) /..
10
+ source " ${OS_ROOT} /hack/lib/init.sh"
11
+
12
+ # Go to the top of the tree.
13
+ cd " ${OS_ROOT} "
14
+
15
+ tag=" ${OS_TAG:- } "
16
+ if [[ -z " ${tag} " ]]; then
17
+ if [[ " $( git tag --points-at HEAD | wc -l ) " -ne 1 ]]; then
18
+ echo " error: Specify OS_TAG or ensure the current git HEAD is tagged."
19
+ exit 1
20
+ fi
21
+ tag=" :$( git tag --points-at HEAD ) "
22
+ fi
23
+
24
+ # release_component is the standard release pattern for subcomponents
25
+ function release_component() {
26
+ local STARTTIME=$( date +%s)
27
+ echo " --- $1 $2 ---"
28
+ mkdir -p " _output/components"
29
+ (
30
+ pushd _output/components/
31
+ git clone --recursive " $2 " " $1 " -b " ${tag} "
32
+ OS_TAG=" ${tag} " hack/release.sh
33
+ )
34
+ local ENDTIME=$( date +%s) ; echo " --- $1 took $(( $ENDTIME - $STARTTIME )) seconds ---"
35
+ }
36
+
37
+ release_component logging https://github.com/openshift/origin-aggregated-logging
38
+ release_component metrics https://github.com/openshift/origin-metrics
You can’t perform that action at this time.
0 commit comments