diff --git a/.gitignore b/.gitignore index 6f112ab895..376a59b5ba 100644 --- a/.gitignore +++ b/.gitignore @@ -50,5 +50,5 @@ profile.cov **/yarn-error.log coverage.txt go.sum -cicd/devnet/terraform/.terraform +cicd/devnet/terraform/.terraform* cicd/devnet/tmp diff --git a/.travis.yml b/.travis.yml index a3d805d999..aaeb1b2bc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,7 +116,7 @@ jobs: - docker push xinfinorg/devnet:latest - stage: (Devnet)Terraform plan - if: branch = dev-upgrade AND type = pull_request + if: branch = dev-upgrade AND type = push AND tag IS blank dist: xenial language: bash install: @@ -142,7 +142,9 @@ jobs: - unzip terraform_"$tf_version"_linux_amd64.zip - sudo mv terraform /usr/local/bin/ - rm terraform_"$tf_version"_linux_amd64.zip - - pip install --user awscli # install aws cli w/o sudo + - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + - unzip awscliv2.zip + - sudo ./aws/install - export PATH=$PATH:$HOME/.local/bin # put aws in the path script: - echo "Merge detected, executing changes(Devnet)" diff --git a/cicd/devnet/start.sh b/cicd/devnet/start.sh index e57f31f80d..7c9d79adcf 100755 --- a/cicd/devnet/start.sh +++ b/cicd/devnet/start.sh @@ -18,11 +18,11 @@ then echo "${private_key}" >> /tmp/key echo "Creating a new wallet" - wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | sed -n 's/Address: {\(.*\)}/\1/p') + wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') XDC --datadir /work/xdcchain init /work/genesis.json else echo "Wallet already exist, re-use the same one" - wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | sed -n 's/Address: {\(.*\)}/\1/p') + wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | awk -F '[{}]' '{print $2}') fi input="/work/bootnodes.list" diff --git a/cicd/entry.sh b/cicd/entry.sh index 9c5bd2e7bd..777bd58692 100755 --- a/cicd/entry.sh +++ b/cicd/entry.sh @@ -1,5 +1,5 @@ #!/bin/bash -if test -z "$NETWORK" +if test -z "$NETWORK" then echo "NETWORK env Must be set, mainnet/testnet/devnet" exit 1 diff --git a/cicd/mainnet/start.sh b/cicd/mainnet/start.sh index e44555606b..7b795ac1f3 100755 --- a/cicd/mainnet/start.sh +++ b/cicd/mainnet/start.sh @@ -3,7 +3,7 @@ if [ ! -d /work/xdcchain/XDC/chaindata ] then # Randomly select a key from environment variable, seperated by ',' - if test -z "$PRIVATE_KEYS" + if test -z "$PRIVATE_KEYS" then echo "PRIVATE_KEYS environment variable has not been set. You need to pass at least one PK, or you can pass multiple PK seperated by ',', we will randomly choose one for you" exit 1 @@ -13,11 +13,11 @@ then echo "${private_key}" >> /tmp/key echo "Creating a new wallet" - wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | sed -n 's/Address: {\(.*\)}/\1/p') + wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') XDC --datadir /work/xdcchain init /work/genesis.json else echo "Wallet already exist, re-use the same one" - wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | sed -n 's/Address: {\(.*\)}/\1/p') + wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | awk -F '[{}]' '{print $2}') fi input="/work/bootnodes.list" @@ -33,7 +33,7 @@ do done < "$input" log_level=3 -if test -z "$LOG_LEVEL" +if test -z "$LOG_LEVEL" then echo "Log level not set, default to verbosity of 3" else diff --git a/cicd/testnet/start.sh b/cicd/testnet/start.sh index 6a162d2036..fde9df3a9d 100755 --- a/cicd/testnet/start.sh +++ b/cicd/testnet/start.sh @@ -13,11 +13,11 @@ then echo "${private_key}" >> /tmp/key echo "Creating a new wallet" - wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | sed -n 's/Address: {\(.*\)}/\1/p') + wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') XDC --datadir /work/xdcchain init /work/genesis.json else echo "Wallet already exist, re-use the same one" - wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | sed -n 's/Address: {\(.*\)}/\1/p') + wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | awk -F '[{}]' '{print $2}') fi input="/work/bootnodes.list"