File tree 4 files changed +94
-16
lines changed
scripts/buildkite/release
4 files changed +94
-16
lines changed Original file line number Diff line number Diff line change @@ -587,7 +587,7 @@ steps:
587
587
588
588
- block : Windows E2E Tests
589
589
depends_on : []
590
- if : build.env("RELEASE_CANDIDATE") == null
590
+ if : build.env("RELEASE_CANDIDATE") == null || build.env("TEST_RC") == "TRUE"
591
591
key : trigger-windows-e2e-tests
592
592
593
593
- label : ⚙️ Windows E2E Tests
@@ -629,6 +629,15 @@ steps:
629
629
- ./artifacts/*.tgz
630
630
agents :
631
631
system : x86_64-linux
632
+
633
+ - label : Push test image to dockerhub
634
+ depends_on : push-dockerhub
635
+ commands :
636
+ - nix develop path:$RELEASE_SCRIPTS_DIR -c $RELEASE_SCRIPTS_DIR/push-to-dockerhub.sh
637
+ agents :
638
+ system : x86_64-linux
639
+ env :
640
+ RELEASE : false
632
641
633
642
- block : Docker Build
634
643
depends_on : []
Original file line number Diff line number Diff line change @@ -76,6 +76,19 @@ steps:
76
76
env :
77
77
RELEASE : false
78
78
79
+ # - block: Push test image to dockerhub
80
+ # key: push-dockerhub
81
+ # depends_on: create-release
82
+
83
+ # - label: Push test image to dockerhub
84
+ # depends_on: push-dockerhub
85
+ # commands:
86
+ # - nix develop path:$RELEASE_SCRIPTS_DIR -c $RELEASE_SCRIPTS_DIR/push-to-dockerhub.sh
87
+ # agents:
88
+ # system: x86_64-linux
89
+ # env:
90
+ # RELEASE: false
91
+
79
92
- group : Release
80
93
depends_on : nightly
81
94
if : build.branch == "master"
@@ -123,17 +136,22 @@ steps:
123
136
env :
124
137
RELEASE : true
125
138
126
- - label : Push Docker Image
127
- depends_on :
128
- - create-release
129
- command :
130
- - " mkdir -p config && echo '{ outputs = _: { dockerHubRepoName = \" cardanofoundation/cardano-wallet\" ; }; }' > config/flake.nix"
131
- - " nix build .#pushDockerImage --override-input hostNixpkgs \" path:$(nix eval --impure -I $NIX_PATH --expr '(import <nixpkgs> {}).path')\" --override-input customConfig path:./config -o docker-build-push"
132
- - " ./docker-build-push"
133
- agents :
134
- system : x86_64-linux
135
-
136
139
- label : Update Documentation Links
137
140
depends_on : create-release
138
141
commands :
139
142
- nix develop path:$RELEASE_SCRIPTS_DIR -c $RELEASE_SCRIPTS_DIR/update-documentation-links.sh
143
+
144
+ - block : Push to dockerhub
145
+ key : push-dockerhub
146
+ depends_on : create-release
147
+
148
+ - label : Push to dockerhub
149
+ depends_on : push-dockerhub
150
+ artifact_paths :
151
+ - ./artifacts/*.tgz
152
+ commands :
153
+ - nix develop path:$RELEASE_SCRIPTS_DIR -c $RELEASE_SCRIPTS_DIR/push-to-dockerhub.sh
154
+ agents :
155
+ system : x86_64-linux
156
+ env :
157
+ RELEASE : true
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euox pipefail
4
+
5
+ base_build=$( buildkite-agent meta-data get base-build)
6
+ NEW_GIT_TAG=$( buildkite-agent meta-data get release-version)
7
+
8
+ if [ " $RELEASE " == " false" ]; then
9
+ TAG=nightly
10
+ else
11
+ TAG=$NEW_GIT_TAG
12
+ fi
13
+
14
+ main_build=$( curl -H " Authorization: Bearer $BUILDKITE_API_TOKEN " \
15
+ -X GET " https://api.buildkite.com/v2/builds" \
16
+ | jq " .[] | select(.meta_data.\" triggered-by\" == \" $base_build \" )" \
17
+ | jq .number)
18
+
19
+ mkdir -p artifacts
20
+
21
+ artifact () {
22
+ local artifact_name=$1
23
+ # shellcheck disable=SC2155
24
+ local artifact_value=$( curl -H " Authorization: Bearer $BUILDKITE_API_TOKEN " \
25
+ -X GET " https://api.buildkite.com/v2/organizations/cardano-foundation/pipelines/cardano-wallet/builds/$main_build /artifacts?per_page=100" \
26
+ | jq -r " [.[] | select(.filename == \" $artifact_name \" )][0] \
27
+ | .download_url" )
28
+ curl -H " Authorization: Bearer $BUILDKITE_API_TOKEN " -L \
29
+ -o " artifacts/$artifact_name " \
30
+ " $artifact_value "
31
+ echo " $TAG "
32
+ echo " artifacts/$artifact_name "
33
+ }
34
+
35
+ artifact " cardano-wallet-$NEW_GIT_TAG -docker-image.tgz"
Original file line number Diff line number Diff line change 3
3
4
4
set -euox pipefail
5
5
6
+ if [ " $BUILDKITE_BRANCH " == " master" ]; then
7
+ TEST_RC=" FALSE"
8
+ else
9
+ TEST_RC=" TRUE"
10
+ fi
11
+
6
12
# date from git tag
7
13
# example v2023-04-04 -> 2023-04-04
8
14
tag_date () {
9
15
echo " ${1## v} "
10
16
}
17
+
18
+ tag_today () {
19
+ sed -e ' s/-0/-/g' -e ' s/-/./g' <<< " $1"
20
+ }
21
+
11
22
# cabal version from git tag
12
23
# example v2023-04-04 -> 2023.4.4
13
24
tag_cabal_ver () {
14
- tag_date " $1 " | sed -e s/-0/-/g -e s/-/./g
25
+ tag_today " $( tag_date " $1 " ) "
15
26
}
16
27
28
+
17
29
git tag -l | xargs git tag -d
18
30
git fetch --tags
19
31
@@ -23,9 +35,15 @@ git checkout "$BASE_COMMIT"
23
35
24
36
today=$( date +%Y-%m-%d)
25
37
26
- NEW_GIT_TAG=v$today
38
+ if [ $TEST_RC == " TRUE" ]; then
39
+ NEW_GIT_TAG=" v$today -test"
40
+ NEW_CABAL_VERSION=$( tag_today " $today " ) .1
41
+ else
42
+ NEW_GIT_TAG=" v$today "
43
+ NEW_CABAL_VERSION=$( tag_today " $today " )
44
+ fi
45
+
27
46
28
- NEW_CABAL_VERSION=$( tag_cabal_ver " $NEW_GIT_TAG " )
29
47
30
48
OLD_GIT_TAG=$( git tag -l " v2*-*-*" | sort | tail -n1)
31
49
@@ -47,10 +65,8 @@ CARDANO_NODE_TAG=$(cardano-node version | head -n1 | awk '{print $2}')
47
65
48
66
if [ " $BUILDKITE_BRANCH " == " master" ]; then
49
67
RELEASE_CANDIDATE_BRANCH=" release-candidate/$NEW_GIT_TAG "
50
- TEST_RC=" FALSE"
51
68
else
52
69
RELEASE_CANDIDATE_BRANCH=" test-rc/$BUILDKITE_BRANCH "
53
- TEST_RC=" TRUE"
54
70
fi
55
71
56
72
git config --global user.email
" [email protected] "
You can’t perform that action at this time.
0 commit comments