Skip to content

Commit 6b3621b

Browse files
authored
Merge pull request #27 from Anmol1696/anmol/build-branch
Add ability to pass upgrade version as a branch name
2 parents 00482e2 + 769ba1b commit 6b3621b

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

charts/devnet/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.7
18+
version: 0.1.8
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/devnet/scripts/build_chain.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
#!/bin/bash
22

3-
set -eu
3+
set -euxo pipefail
44

55
mkdir -p /tmp/chains $UPGRADE_DIR
66

77
echo "Fetching code from tag"
88
mkdir -p /tmp/chains/$CHAIN_NAME
99
cd /tmp/chains/$CHAIN_NAME
10-
curl -LO $CODE_REPO/archive/refs/tags/$CODE_TAG.zip
11-
unzip $CODE_TAG.zip
12-
cd ${CODE_REPO##*/}-${CODE_TAG#"v"}
10+
11+
if [[ $CODE_TAG = v* ]]; then
12+
echo "Trying to fetch code from tag"
13+
curl -LO $CODE_REPO/archive/refs/tags/$CODE_TAG.zip
14+
unzip $CODE_TAG.zip
15+
code_dir=${CODE_REPO##*/}-${CODE_TAG#"v"}
16+
else
17+
echo "Trying to fetch code from branch"
18+
curl -LO $CODE_REPO/archive/refs/heads/$CODE_TAG.zip
19+
unzip $(echo $CODE_TAG | rev | cut -d "/" -f 1 | rev).zip
20+
code_dir=${CODE_REPO##*/}-${CODE_TAG/\//-}
21+
fi
1322

1423
echo "Fetch wasmvm if needed"
24+
cd /tmp/chains/$CHAIN_NAME/$code_dir
1525
WASM_VERSION=$(cat go.mod | grep -oe "github.com/CosmWasm/wasmvm v[0-9.]*" | cut -d ' ' -f 2)
1626
if [[ WASM_VERSION != "" ]]; then
1727
mkdir -p /tmp/chains/libwasmvm_muslc
@@ -21,8 +31,8 @@ if [[ WASM_VERSION != "" ]]; then
2131
fi
2232

2333
echo "Build chain binary"
24-
cd /tmp/chains/$CHAIN_NAME/${CODE_REPO##*/}-${CODE_TAG#"v"}
25-
BUILD_TAGS="muslc linkstatic" LINK_STATICALLY=true LEDGER_ENABLED=false make install
34+
cd /tmp/chains/$CHAIN_NAME/$code_dir
35+
CGO_ENABLED=1 BUILD_TAGS="muslc linkstatic" LINK_STATICALLY=true LEDGER_ENABLED=false make install
2636

2737
echo "Copy created binary to the upgrade directories"
2838
if [[ $UPGRADE_NAME == "genesis" ]]; then

docker/builder/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM golang:1.18-alpine3.16
1+
FROM golang:1.19-alpine3.16
22

33
# Set up dependencies
4-
ENV PACKAGES curl unzip make git libusb-dev libc-dev bash gcc linux-headers eudev-dev python3 musl-dev build-base
4+
ENV PACKAGES curl unzip make git libusb-dev libc-dev bash gcc linux-headers eudev-dev python3 musl-dev
55

66
# Install ca-certificates
77
RUN set -eux; apk add --no-cache ca-certificates build-base;

examples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
EXAMPLE = mesh-security
1+
EXAMPLE = upgrade-testing
22
FILE = custom-values.yaml
33

44
HELM_REPO = shuttle

examples/upgrade-testing/custom-values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ chains:
1515
upgrades:
1616
- name: v5
1717
version: v5.0.0-rc2
18+
- name: v6
19+
version: anmol/v6
1820
ports:
1921
rpc: 26657
2022
rest: 1317

0 commit comments

Comments
 (0)