Skip to content

Commit

Permalink
Merge pull request #27 from Anmol1696/anmol/build-branch
Browse files Browse the repository at this point in the history
Add ability to pass upgrade version as a branch name
  • Loading branch information
Anmol1696 authored Dec 16, 2022
2 parents 00482e2 + 769ba1b commit 6b3621b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/devnet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.7
version: 0.1.8

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
22 changes: 16 additions & 6 deletions charts/devnet/scripts/build_chain.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
#!/bin/bash

set -eu
set -euxo pipefail

mkdir -p /tmp/chains $UPGRADE_DIR

echo "Fetching code from tag"
mkdir -p /tmp/chains/$CHAIN_NAME
cd /tmp/chains/$CHAIN_NAME
curl -LO $CODE_REPO/archive/refs/tags/$CODE_TAG.zip
unzip $CODE_TAG.zip
cd ${CODE_REPO##*/}-${CODE_TAG#"v"}

if [[ $CODE_TAG = v* ]]; then
echo "Trying to fetch code from tag"
curl -LO $CODE_REPO/archive/refs/tags/$CODE_TAG.zip
unzip $CODE_TAG.zip
code_dir=${CODE_REPO##*/}-${CODE_TAG#"v"}
else
echo "Trying to fetch code from branch"
curl -LO $CODE_REPO/archive/refs/heads/$CODE_TAG.zip
unzip $(echo $CODE_TAG | rev | cut -d "/" -f 1 | rev).zip
code_dir=${CODE_REPO##*/}-${CODE_TAG/\//-}
fi

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

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

echo "Copy created binary to the upgrade directories"
if [[ $UPGRADE_NAME == "genesis" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions docker/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.18-alpine3.16
FROM golang:1.19-alpine3.16

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

# Install ca-certificates
RUN set -eux; apk add --no-cache ca-certificates build-base;
Expand Down
2 changes: 1 addition & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EXAMPLE = mesh-security
EXAMPLE = upgrade-testing
FILE = custom-values.yaml

HELM_REPO = shuttle
Expand Down
2 changes: 2 additions & 0 deletions examples/upgrade-testing/custom-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ chains:
upgrades:
- name: v5
version: v5.0.0-rc2
- name: v6
version: anmol/v6
ports:
rpc: 26657
rest: 1317
Expand Down

0 comments on commit 6b3621b

Please sign in to comment.