Skip to content

Commit ede844c

Browse files
committed
Refactor run script to execute different local releases
1 parent 7ccff04 commit ede844c

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed
File renamed without changes.

local/rustup.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# This script is executed at the start of each local release for Rustup, and
4+
# prepares the environment by copying the artifacts built by CI onto the MinIO
5+
# instance. Then, it starts promote-release with the right flags.
6+
7+
set -euo pipefail
8+
IFS=$'\n\t'

local/setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ cat <<EOF
7777
7878
To start the release process locally, run either:
7979
80-
./run.sh nightly
81-
./run.sh beta
82-
./run.sh stable
80+
./run.sh release nightly
81+
./run.sh release beta
82+
./run.sh release stable
8383
8484
To use a release produced locally, set this environment variable when
8585
interacting with rustup:

run.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,28 @@
55
set -euo pipefail
66
IFS=$'\n\t'
77

8-
if [[ "$#" -lt 1 ]] || [[ "$#" -gt 2 ]]; then
9-
echo "Usage: $0 <channel> [commit]"
8+
if [[ "$#" -lt 1 ]]; then
9+
echo "Usage: $0 <release|rustup>"
10+
exit 1
11+
fi
12+
command="$1"
13+
14+
if [[ "${command}" == "release" ]]; then
15+
if [[ "$#" -lt 2 ]] || [[ "$#" -gt 3 ]]; then
16+
echo "Usage: $0 release <stable|dev|nightly> [commit]"
17+
exit 1
18+
fi
19+
fi
20+
21+
if [[ "${command}" == "rustup" ]]; then
22+
if [[ "$#" -ne 2 ]]; then
23+
echo "Usage: $0 rustup <stable|dev> [commit]"
1024
exit 1
25+
fi
1126
fi
12-
channel="$1"
13-
override_commit="${2-}"
27+
28+
channel="$2"
29+
override_commit="${3-}"
1430

1531
container_id="$(docker-compose ps -q local)"
1632
if [[ "${container_id}" == "" ]]; then
@@ -31,4 +47,4 @@ fi
3147
cargo build --release
3248

3349
# Run the command inside the docker environment.
34-
docker-compose exec -T local /src/local/run.sh "${channel}" "${override_commit}"
50+
docker-compose exec -T local "/src/local/${command}.sh" "${channel}" "${override_commit}"

0 commit comments

Comments
 (0)