Skip to content

Commit 660fff3

Browse files
committed
added release check
1 parent 446ea21 commit 660fff3

File tree

3 files changed

+104
-92
lines changed

3 files changed

+104
-92
lines changed

.buildkite/pipeline.yml

+83-83
Original file line numberDiff line numberDiff line change
@@ -9,99 +9,99 @@ env:
99
BUILDX: 1
1010

1111
steps:
12-
- group: "Staging"
13-
key: "staging"
14-
15-
steps:
16-
- label: ":linux: Staging / Ubuntu X86_64 - {{matrix.makefile}}"
17-
key: "build-ubuntu-x86"
18-
command:
19-
- ".buildkite/scripts/build.sh {{matrix.makefile}}"
20-
- ".buildkite/scripts/publish.sh {{matrix.makefile}}"
21-
env:
22-
REPOSITORY: "${STAGING_IMAGE}"
23-
if: build.env("BUILDKITE_PULL_REQUEST") != "false"
24-
notify:
25-
- github_commit_status:
26-
context: "Staging / Ubuntu X86_64"
27-
agents:
28-
provider: "gcp"
29-
image: "${IMAGE_UBUNTU_X86_64}"
30-
matrix:
31-
setup:
32-
makefile:
33-
- "Makefile"
34-
- "Makefile.debian7"
35-
- "Makefile.debian8"
36-
- "Makefile.debian9"
37-
- "Makefile.debian10"
38-
- "Makefile.debian11"
39-
- "Makefile.debian12"
40-
41-
- label: ":linux: Staging / Ubuntu ARM - Makefile.debian9"
42-
key: "build-ubuntu-arm"
43-
command:
44-
- ".buildkite/scripts/build.sh Makefile.debian9"
45-
- ".buildkite/scripts/publish.sh Makefile.debian9"
46-
env:
47-
REPOSITORY: "${STAGING_IMAGE}"
48-
if: build.env("BUILDKITE_PULL_REQUEST") != "false"
49-
notify:
50-
- github_commit_status:
51-
context: "Staging / Ubuntu ARM"
52-
agents:
53-
provider: "aws"
54-
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
55-
instanceType: "t4g.large"
12+
# - group: "Staging"
13+
# key: "staging"
14+
#
15+
# steps:
16+
# - label: ":linux: Staging / Ubuntu X86_64 - {{matrix.makefile}}"
17+
# key: "build-ubuntu-x86"
18+
# command:
19+
# - ".buildkite/scripts/build.sh {{matrix.makefile}}"
20+
# - ".buildkite/scripts/publish.sh {{matrix.makefile}}"
21+
# env:
22+
# REPOSITORY: "${STAGING_IMAGE}"
23+
# if: build.env("BUILDKITE_PULL_REQUEST") != "false"
24+
# notify:
25+
# - github_commit_status:
26+
# context: "Staging / Ubuntu X86_64"
27+
# agents:
28+
# provider: "gcp"
29+
# image: "${IMAGE_UBUNTU_X86_64}"
30+
# matrix:
31+
# setup:
32+
# makefile:
33+
# - "Makefile"
34+
# - "Makefile.debian7"
35+
# - "Makefile.debian8"
36+
# - "Makefile.debian9"
37+
# - "Makefile.debian10"
38+
# - "Makefile.debian11"
39+
# - "Makefile.debian12"
40+
#
41+
# - label: ":linux: Staging / Ubuntu ARM - Makefile.debian9"
42+
# key: "build-ubuntu-arm"
43+
# command:
44+
# - ".buildkite/scripts/build.sh Makefile.debian9"
45+
# - ".buildkite/scripts/publish.sh Makefile.debian9"
46+
# env:
47+
# REPOSITORY: "${STAGING_IMAGE}"
48+
# if: build.env("BUILDKITE_PULL_REQUEST") != "false"
49+
# notify:
50+
# - github_commit_status:
51+
# context: "Staging / Ubuntu ARM"
52+
# agents:
53+
# provider: "aws"
54+
# imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
55+
# instanceType: "t4g.large"
5656

5757
- group: "Release"
5858
key: "release"
5959

6060
steps:
61-
- label: ":linux: Release / Ubuntu X86_64 - {{matrix.makefile}}"
62-
key: "release-ubuntu-x86"
63-
command:
64-
- ".buildkite/scripts/build.sh {{matrix.makefile}}"
65-
- ".buildkite/scripts/publish.sh {{matrix.makefile}}"
66-
if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+$$/
67-
agents:
68-
provider: "gcp"
69-
image: "${IMAGE_UBUNTU_X86_64}"
70-
matrix:
71-
setup:
72-
makefile:
73-
- "Makefile"
74-
- "Makefile.debian7"
75-
- "Makefile.debian8"
76-
- "Makefile.debian9"
77-
- "Makefile.debian10"
78-
- "Makefile.debian11"
79-
- "Makefile.debian12"
80-
notify:
81-
- github_commit_status:
82-
context: "Release / Ubuntu X86_64"
61+
# - label: ":linux: Release / Ubuntu X86_64 - {{matrix.makefile}}"
62+
# key: "release-ubuntu-x86"
63+
# command:
64+
# - ".buildkite/scripts/build.sh {{matrix.makefile}}"
65+
# - ".buildkite/scripts/publish.sh {{matrix.makefile}}"
66+
# if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+$$/
67+
# agents:
68+
# provider: "gcp"
69+
# image: "${IMAGE_UBUNTU_X86_64}"
70+
# matrix:
71+
# setup:
72+
# makefile:
73+
# - "Makefile"
74+
# - "Makefile.debian7"
75+
# - "Makefile.debian8"
76+
# - "Makefile.debian9"
77+
# - "Makefile.debian10"
78+
# - "Makefile.debian11"
79+
# - "Makefile.debian12"
80+
# notify:
81+
# - github_commit_status:
82+
# context: "Release / Ubuntu X86_64"
8383

84-
- label: ":linux: Release / Ubuntu ARM - Makefile.debian9"
85-
key: "release-ubuntu-arm"
86-
command:
87-
- ".buildkite/scripts/build.sh Makefile.debian9"
88-
- ".buildkite/scripts/publish.sh Makefile.debian9"
89-
if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+$$/
90-
agents:
91-
provider: "aws"
92-
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
93-
instanceType: "t4g.large"
94-
notify:
95-
- github_commit_status:
96-
context: "Release / Ubuntu ARM"
84+
# - label: ":linux: Release / Ubuntu ARM - Makefile.debian9"
85+
# key: "release-ubuntu-arm"
86+
# command:
87+
# - ".buildkite/scripts/build.sh Makefile.debian9"
88+
# - ".buildkite/scripts/publish.sh Makefile.debian9"
89+
# if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+$$/
90+
# agents:
91+
# provider: "aws"
92+
# imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
93+
# instanceType: "t4g.large"
94+
# notify:
95+
# - github_commit_status:
96+
# context: "Release / Ubuntu ARM"
9797

9898
- label: "Post-Release"
9999
key: "release-post"
100100
command: ".buildkite/scripts/post-release.sh ${GOLANG_VERSION}"
101-
if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+$$/
102-
depends_on:
103-
- "release-ubuntu-x86"
104-
- "release-ubuntu-arm"
101+
# if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+$$/
102+
# depends_on:
103+
# - "release-ubuntu-x86"
104+
# - "release-ubuntu-arm"
105105
notify:
106106
- github_commit_status:
107107
context: "Post-release"

.buildkite/scripts/common.sh

+10
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ tag_Exists() {
139139
fi
140140
}
141141

142+
release_exists() {
143+
local releases=$(retry 3 curl -s -u ${GITHUB_TOKEN_SECRET}:x-oauth-basic https://api.github.com/repos/elastic/${REPO}/releases)
144+
echo ":: RELEASES ::"
145+
echo $releases
146+
147+
if [[ $releases == *"${GOLANG_VERSION}"* ]]; then
148+
echo ":: RELEASE EXISTS! ::"
149+
fi
150+
}
151+
142152
check_is_arm() {
143153
if [[ ${HW_TYPE} == "aarch64" || ${HW_TYPE} == "arm64" ]]; then
144154
is_arm="-arm"

.buildkite/scripts/post-release.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ git_push_with_auth() {
2323
}
2424

2525
if [[ "${TAG_EXISTS}" == true ]]; then
26-
message="Tag '$TAG' already exists! Exiting Post-release stage."
27-
echo "$message"
28-
buildkite-agent annotate "$message" --style 'warning' --context 'ctx-warn'
29-
# This should return any error but skip the release.
30-
exit 0
26+
release_exists
27+
28+
# message="Tag '$TAG' already exists! Exiting Post-release stage."
29+
# echo "$message"
30+
# buildkite-agent annotate "$message" --style 'warning' --context 'ctx-warn'
31+
# # This should return any error but skip the release.
32+
# exit 0
3133
fi
3234

33-
set_git_config
34-
tag_commit
35-
git_push_with_auth
36-
buildkite-agent annotate "Tag '$TAG' has been created." --style 'success' --context 'ctx-success'
35+
#set_git_config
36+
#tag_commit
37+
#git_push_with_auth
38+
#buildkite-agent annotate "Tag '$TAG' has been created." --style 'success' --context 'ctx-success'

0 commit comments

Comments
 (0)