-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
…assignment
- Loading branch information
Showing
3 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Exit on any error | ||
set -e | ||
|
||
# Always run the commands from the "test" dir | ||
cd $(dirname $0)/.. | ||
|
||
if [[ -z "${1}" || ${1} == "undefined" ]]; then | ||
OUTPUT_FOLDER="tmp" | ||
else | ||
OUTPUT_FOLDER="${1}" | ||
fi | ||
|
||
LATEST_NODE_RELEASE=$(curl -s https://api.github.com/repos/moondance-labs/tanssi/releases | jq -r '.[] | select(.name | test("v0.";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') && [[ ! -z "${LATEST_NODE_RELEASE}" ]] | ||
ENDPOINT="https://api.github.com/repos/moondance-labs/tanssi/git/refs/tags/$LATEST_NODE_RELEASE" | ||
RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" $ENDPOINT) | ||
TYPE=$(echo $RESPONSE | jq -r '.object.type') | ||
if [[ $TYPE == "commit" ]] | ||
then | ||
LATEST_NODE_SHA8=$(echo $RESPONSE | jq -r '.object.sha' | cut -c -8) | ||
elif [[ $TYPE == "tag" ]] | ||
then | ||
URL=$(echo $RESPONSE | jq -r '.object.url') | ||
TAG_RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" $URL) | ||
TAG_RESPONSE_CLEAN=$(echo $TAG_RESPONSE | tr -d '\000-\037') | ||
LATEST_NODE_SHA8=$(echo $TAG_RESPONSE_CLEAN | jq -r '.object.sha' | cut -c -8) | ||
fi | ||
|
||
DOCKER_TAG_TANSSI="moondancelabs/tanssi:sha-$LATEST_NODE_SHA8" | ||
|
||
docker rm -f tanssi_container 2> /dev/null | true | ||
docker create --name tanssi_container $DOCKER_TAG_TANSSI bash | ||
docker cp tanssi_container:tanssi/tanssi-node $OUTPUT_FOLDER/tanssi-node | ||
docker rm -f tanssi_container | ||
chmod uog+x ../target/release/tanssi-node | ||
chmod uog+x $OUTPUT_FOLDER/tanssi-node | ||
|
||
DOCKER_TAG_CONTAINER_SIMPLE="moondancelabs/container-chain-simple-template:sha-$LATEST_NODE_SHA8" | ||
|
||
docker rm -f tanssi_container_simple 2> /dev/null | true | ||
docker create --name tanssi_container_simple $DOCKER_TAG_CONTAINER_SIMPLE bash | ||
docker cp tanssi_container_simple:container-chain-template-simple/container-chain-simple-node $OUTPUT_FOLDER/container-chain-simple-node | ||
docker rm -f tanssi_container_simple | ||
chmod uog+x ../target/release/container-chain-simple-node | ||
chmod uog+x $OUTPUT_FOLDER/container-chain-simple-node | ||
|
||
DOCKER_TAG_CONTAINER_FRONTIER="moondancelabs/container-chain-evm-template:sha-$LATEST_NODE_SHA8" | ||
|
||
docker rm -f tanssi_container_frontier 2> /dev/null | true | ||
docker create --name tanssi_container_frontier $DOCKER_TAG_CONTAINER_FRONTIER bash | ||
docker cp tanssi_container_frontier:container-chain-template-evm/container-chain-frontier-node $OUTPUT_FOLDER/container-chain-frontier-node | ||
docker rm -f tanssi_container_frontier | ||
chmod uog+x ../target/release/container-chain-frontier-node | ||
chmod uog+x $OUTPUT_FOLDER/container-chain-frontier-node |