Skip to content

Commit b2e50b6

Browse files
authored
Merge pull request #17505 from MinaProtocol/dkijania/enable_publishing_artifacts_on_scheduled_nightly
[CI] enable publishing artifacts on scheduled nightly
2 parents 610b742 + 0db1716 commit b2e50b6

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

buildkite/scripts/release/manager.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ set -E # inherit -e
3333
set -e # exit immediately on errors
3434
set -u # exit on not assigned variables
3535
set -o pipefail # exit on pipe failure
36+
set -x
3637

3738
CLEAR='\033[0m'
3839
RED='\033[0;31m'
@@ -49,7 +50,7 @@ DEFAULT_NETWORKS="devnet,mainnet"
4950
DEFAULT_CODENAMES="bullseye,focal"
5051
DEFAULT_ARCHITECTURE="amd64"
5152

52-
DEBIAN_CACHE_FOLDER=~/.release/debian/cache
53+
DEBIAN_CACHE_FOLDER=${DEBIAN_CACHE_FOLDER:-~/.release/debian/cache}
5354
GCR_REPO="gcr.io/o1labs-192920"
5455
DOCKER_IO_REPO="docker.io/minaprotocol"
5556
DEBIAN_REPO=packages.o1test.net

buildkite/src/Command/Packages/Publish.dhall

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ let DebianChannel = ../../Constants/DebianChannel.dhall
2020

2121
let Profiles = ../../Constants/Profiles.dhall
2222

23-
let Artifact = ../../Constants/Artifacts.dhall
24-
2523
let DebianVersions = ../../Constants/DebianVersions.dhall
2624

2725
let DebianRepo = ../../Constants/DebianRepo.dhall
2826

29-
let Toolchain = ../../Constants/Toolchain.dhall
30-
3127
let ContainerImages = ../../Constants/ContainerImages.dhall
3228

3329
let Command = ../Base.dhall
@@ -36,6 +32,8 @@ let Cmd = ../../Lib/Cmds.dhall
3632

3733
let Mina = ../Mina.dhall
3834

35+
let Artifact = ../../Constants/Artifacts.dhall
36+
3937
let Spec =
4038
{ Type =
4139
{ artifacts : List Artifact.Type
@@ -167,7 +165,8 @@ let publish
167165
( "git config --global --add safe.directory /workdir && "
168166
++ ". ./buildkite/scripts/export-git-env-vars.sh && "
169167
++ " gpg --import /var/secrets/debian/key.gpg && "
170-
++ "./buildkite/scripts/release/manager.sh publish "
168+
++ " mkdir -p ./cache && "
169+
++ "DEBIAN_CACHE_FOLDER=/workdir/cache ./buildkite/scripts/release/manager.sh publish "
171170
++ "--artifacts ${artifacts} "
172171
++ "--networks ${networks} "
173172
++ "--buildkite-build-id ${spec.build_id} "
@@ -211,9 +210,7 @@ let publish
211210
-> Command.build
212211
Command.Config::{
213212
, commands =
214-
Toolchain.runner
215-
DebianVersions.DebVersion.Bullseye
216-
[ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY" ]
213+
[ Cmd.run
217214
( ". ./buildkite/scripts/export-git-env-vars.sh && "
218215
++ "./buildkite/scripts/release/manager.sh publish "
219216
++ "--artifacts ${artifacts} "
@@ -228,6 +225,7 @@ let publish
228225
++ "--codenames ${codenames} "
229226
++ "--only-dockers "
230227
)
228+
]
231229
, label = "Docker Packages Publishing"
232230
, key = "publish-dockers-${Natural/show r.index}"
233231
, target = Size.Small

buildkite/src/Jobs/Promote/AutoPromoteNightly.dhall

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ let Artifacts = ../../Constants/Artifacts.dhall
1212

1313
let DebianChannel = ../../Constants/DebianChannel.dhall
1414

15+
let DebianRepo = ../../Constants/DebianRepo.dhall
16+
1517
let Network = ../../Constants/Network.dhall
1618

1719
let Profiles = ../../Constants/Profiles.dhall
@@ -45,16 +47,16 @@ let targetVersion =
4547
-> \(commit : Text)
4648
-> \(latestGitTag : Text)
4749
-> \(todayDate : Text)
48-
-> "${latestGitTag}-${todayDate}-${branch}-${DebianVersions.lowerName
49-
codename}-${DebianChannel.lowerName
50-
channel}"
50+
-> "${latestGitTag}-${todayDate}-${DebianVersions.lowerName
51+
codename}-${DebianChannel.lowerName
52+
channel}"
5153

5254
in Pipeline.build
5355
Pipeline.Config::{
5456
, spec = JobSpec::{
5557
, dirtyWhen = [ S.everything ]
5658
, path = "Promote"
57-
, tags = [ PipelineTag.Type.Promote ]
59+
, tags = [ PipelineTag.Type.Promote, PipelineTag.Type.TearDown ]
5860
, name = "AutoPromoteNightly"
5961
}
6062
, steps =
@@ -71,14 +73,15 @@ in Pipeline.build
7173
[ DebianVersions.DebVersion.Bullseye
7274
, DebianVersions.DebVersion.Focal
7375
]
76+
, debian_repo = DebianRepo.Type.Nightly
7477
, channel = DebianChannel.Type.Compatible
7578
, new_docker_tags = new_tags
7679
, target_version = targetVersion
7780
, publish_to_docker_io = False
7881
, backend = "local"
7982
, verify = True
8083
, branch = "\\\${BUILDKITE_BRANCH}"
81-
, source_version = "\\\${MINA_DOCKER_TAG}"
84+
, source_version = "\\\${MINA_DEB_VERSION}"
8285
, build_id = "\\\${BUILDKITE_BUILD_ID}"
8386
}
8487
}

scripts/debian/reversion-helper.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ function reversion() {
6060
# shellcheck disable=SC2140
6161
rm -rf "${__parent_dir}"/"${__new_deb}.deb"
6262

63+
if [[ ! -f "${__deb}_${__source_version}.deb" ]]; then
64+
echo "Error: File ${__deb}_${__source_version}.deb does not exist" >&2
65+
echo "Contents of ${__parent_dir}:" >&2
66+
ls -la "${__parent_dir}"
67+
exit 1
68+
fi
6369
dpkg-deb -R "${__deb}_${__source_version}.deb" "${__new_deb}"
6470
# shellcheck disable=SC2140
6571
sed -i 's/Version: '"${__source_version}"'/Version: '"${__new_version}"'/g' "${__new_deb}/DEBIAN/control"

0 commit comments

Comments
 (0)