Skip to content

Commit 566405e

Browse files
author
btoll
authored
Fix bugs in mule test stage (#1679)
Miscellaneous sign and test pipeline fixes: - fix status file name - change name of image in mule yaml - add vars to dynamically account for both algorand and algorand-devtools packages (all channels)
1 parent cccd1bf commit 566405e

File tree

5 files changed

+51
-18
lines changed

5 files changed

+51
-18
lines changed

package-sign.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
agents:
22
- name: deb
33
dockerFilePath: docker/build/cicd.ubuntu.Dockerfile
4-
image: algorand/cicd-ubuntu
4+
image: algorand/go-algorand-ci-linux-ubuntu
55
version: scripts/configure_dev-deps.sh
66
buildArgs:
77
- GOLANG_VERSION=`./scripts/get_golang_version.sh`

scripts/release/mule/sign/sign.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ BRANCH=${BRANCH:-$(./scripts/compute_branch.sh)}
1414
CHANNEL=${CHANNEL:-$(./scripts/compute_branch_channel.sh "$BRANCH")}
1515
PKG_DIR="./tmp/node_pkgs"
1616
17-
STATUSFILE="build_status_${CHANNEL}_${VERSION}"
1817

1918
# It seems that copying/mounting the gpg dir from another machine can result in insecure
2019
# access privileges, so set the correct permissions to avoid the following warning:
@@ -62,14 +61,14 @@ for os in "${OS_TYPES[@]}"; do
6261
done
6362

6463
HASHFILE="hashes_${CHANNEL}_${os}_${arch}_${VERSION}"
65-
6664
md5sum *.tar.gz *.deb *.rpm >> "$HASHFILE"
6765
shasum -a 256 *.tar.gz *.deb *.rpm >> "$HASHFILE"
6866
shasum -a 512 *.tar.gz *.deb *.rpm >> "$HASHFILE"
6967

7068
gpg -u "$SIGNING_KEY_ADDR" --detach-sign "$HASHFILE"
7169
gpg -u "$SIGNING_KEY_ADDR" --clearsign "$HASHFILE"
7270

71+
STATUSFILE="build_status_${CHANNEL}_${os}-${arch}_${VERSION}"
7372
gpg -u "$SIGNING_KEY_ADDR" --clearsign "$STATUSFILE"
7473
gzip -c "$STATUSFILE.asc" > "$STATUSFILE.asc.gz"
7574
)

scripts/release/mule/test/test.sh

+34-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ export CHANNEL=${CHANNEL:-$(./scripts/compute_branch_channel.sh "$BRANCH")}
1616
export NETWORK=${NETWORK:-$(./scripts/compute_branch_network.sh "$BRANCH")}
1717
export SHA=${SHA:-$(git rev-parse HEAD)}
1818
export VERSION=${VERSION:-$(./scripts/compute_build_number.sh -f)}
19+
ALGORAND_PACKAGE_NAME=$([ "$CHANNEL" = beta ] && echo algorand-beta || echo algorand)
20+
DEVTOOLS_PACKAGE_NAME=$([ "$CHANNEL" = beta ] && echo algorand-devtools-beta || echo algorand-devtools)
21+
export ALGORAND_PACKAGE_NAME
22+
export DEVTOOLS_PACKAGE_NAME
1923

2024
PKG_DIR="./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE"
2125

26+
mkdir -p "$PKG_DIR"
2227
pushd "$PKG_DIR"
2328

2429
if [ -n "$S3_SOURCE" ]
@@ -38,6 +43,7 @@ popd
3843

3944
for test in $(ls ./scripts/release/mule/test/tests/pre/*.sh)
4045
do
46+
echo ">>>>>>>>>> PRE TESTING $(basename "$test")"
4147
bash "$test"
4248
done
4349

@@ -52,14 +58,40 @@ else
5258
# Normally, this is installed for us b/c it's a dependency.
5359
# See `./installer/rpm/algorand/algorand.spec`.
5460
yum install yum-cron -y
55-
rpm -i algorand-"$VERSION"-1."$ARCH_BIT".rpm
56-
rpm -i algorand-devtools-"$VERSION"-1."$ARCH_BIT".rpm
61+
#
62+
# Note that the RPM package DOES NOT have the CHANNEL in its filename (unlike DEB),
63+
# instead it contains the package name.
64+
#
65+
# deb:
66+
# algorand_CHANNEL*VERSION.deb
67+
# algorand-devtools_CHANNEL*VERSION.deb
68+
#
69+
# (this pattern is for all channels)
70+
#
71+
# rpm:
72+
# (this pattern is for stable)
73+
# algorand-VERSION*.rpm
74+
# algorand-devtools-VERSION.rpm
75+
#
76+
# (this pattern is for beta)
77+
# algorand-beta-VERSION*.rpm
78+
# algorand-devtools-beta-VERSION.rpm
79+
#
80+
# SO.....
81+
# ALGORAND_PACKAGE_NAME-VERSION*.rpm
82+
# DEVTOOLS_PACKAGE_NAME-beta-VERSION.rpm
83+
#
84+
# Hope that makes sense :)
85+
#
86+
rpm -i "$ALGORAND_PACKAGE_NAME"-"$VERSION"-1."$ARCH_BIT".rpm
87+
rpm -i "$DEVTOOLS_PACKAGE_NAME"-*"$VERSION"-1."$ARCH_BIT".rpm
5788
fi
5889

5990
popd
6091

6192
for test in $(ls ./scripts/release/mule/test/tests/post/*.sh)
6293
do
94+
echo ">>>>>>>>>> POST TESTING $(basename "$test")"
6395
bash "$test"
6496
done
6597

scripts/release/mule/test/tests/post/verify_package_binaries.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ cd "./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE"
1212

1313
if [ "$PKG_TYPE" = deb ]
1414
then
15-
dpkg -L algorand > "$RPMTMP/algorand.install"
16-
dpkg -L algorand-devtools > "$RPMTMP/algorand-devtools.install"
15+
dpkg -L "$ALGORAND_PACKAGE_NAME" > "$RPMTMP/algorand.install"
16+
dpkg -L "$DEVTOOLS_PACKAGE_NAME" > "$RPMTMP/algorand-devtools.install"
1717
else
18-
rpm -ql algorand > "$RPMTMP/algorand.install"
19-
rpm -ql algorand-devtools > "$RPMTMP/algorand-devtools.install"
18+
rpm -ql "$ALGORAND_PACKAGE_NAME" > "$RPMTMP/algorand.install"
19+
rpm -ql "$DEVTOOLS_PACKAGE_NAME" > "$RPMTMP/algorand-devtools.install"
2020
fi
2121

2222
ALGORAND_BINS=(

scripts/release/mule/test/tests/pre/verify_control_files.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,43 @@ then
1515
# Pre-Depends: algorand (>= 2.1.6)
1616
#
1717

18-
cp "./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE"/algorand-devtools*"$VERSION"*.deb "$RPMTMP"
18+
cp "./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE"/algorand-devtools*"$CHANNEL"*"$VERSION"*.deb "$RPMTMP"
1919
cd "$RPMTMP"
2020
ar xv *"$VERSION"*.deb
2121
tar xf control.tar.xz
2222

23-
if ! grep -F "Pre-Depends: algorand (>= $VERSION)" control
23+
if ! grep -F "Pre-Depends: $ALGORAND_PACKAGE_NAME (>= $VERSION)" control
2424
then
25-
echo "[$0] The dependency for algorand version $VERSION is incorrect."
25+
echo "[$0] The dependency for $ALGORAND_PACKAGE_NAME version $VERSION is incorrect."
2626
exit 1
2727
fi
2828

29-
echo "[$0] The dependency for algorand version $VERSION is correct."
29+
echo "[$0] The dependency for $ALGORAND_PACKAGE_NAME version $VERSION is correct."
3030
else
3131
# Note that the .spec file isn't packaged in the RPM. There are tools such `rpmrebuild` that
3232
# attempt to generate the .spec file, but it doesn't give us the info we need.
3333
#
3434
# Instead, we'll just install using `dpkg` and grep the error stream.
35-
if ! rpm -i "./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE/algorand-devtools-$VERSION"*"$ARCH_BIT".rpm 2> "$RPMTMP/rpm.install"
35+
#
36+
# Also, note that the RPM package DOES NOT have the CHANNEL in its filename (unlike DEB)!!
37+
if ! rpm -i "./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE/algorand-devtools-"*"$VERSION"*"$ARCH_BIT".rpm 2> "$RPMTMP/rpm.install"
3638
then
3739
#
3840
# We're looking for lines that looks like the following:
3941
#
4042
# error: Failed dependencies:
4143
# algorand >= 2.1.86017 is needed by algorand-devtools-2.1.86017-1.x86_64
4244
#
43-
if [[ $(cat "$RPMTMP/rpm.install") =~ "algorand >= $VERSION is needed by algorand-devtools-$VERSION" ]]
45+
if [[ $(cat "$RPMTMP/rpm.install") =~ "$ALGORAND_PACKAGE_NAME >= $VERSION is needed by $DEVTOOLS_PACKAGE_NAME-$VERSION" ]]
4446
then
45-
echo "[$0] The package \`algorand-devtools\` correctly has a dependency on package \`algorand\` and failed to install."
47+
echo "[$0] The package \`algorand-devtools\` correctly has a dependency on package $ALGORAND_PACKAGE_NAME and failed to install."
4648
exit 0
4749
fi
4850

49-
echo "[$0] The package \`algorand-devtools\` failed to install because of a missing dependency other than the \`algorand\` package."
51+
echo "[$0] The package \`algorand-devtools\` failed to install because of a missing dependency other than the $ALGORAND_PACKAGE_NAME package."
5052
exit 1
5153
else
52-
echo "[$0] The package \`algorand-devtools\` was installed without any dependencies, while it should have a dependency on the \`algorand\` package."
54+
echo "[$0] The package \`algorand-devtools\` was installed without any dependencies, while it should have a dependency on the $ALGORAND_PACKAGE_NAME package."
5355
exit 1
5456
fi
5557
fi

0 commit comments

Comments
 (0)