codex-factory/generator/scripts/build-environment.sh

157 lines
5.4 KiB
Bash
Raw Normal View History

#!/bin/bash
set -o errexit
set -o pipefail
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
usage() {
cat << USAGE >&2
USAGE:
$ build-environment.sh [PARAMETERS]
PARAMETERS:
--build-base-bee The base bee image will be built from source code
--base-bee-commit-hash=string the source code commit hash of the base bee; Default: HEAD; Dependency: --build-base-bee
--gen-traffic Generate traffic before bee image commit.
--gen-traffic-upload-node=string The traffic will be generated on the node under the given API URL. Default: http://locahost:1635; Dependency: --gen-traffic
--gen-traffic-upload-node-debug=string The traffic will be generated on the node under the given API URL. Default: http://locahost:1635; Dependency: --gen-traffic
--gen-traffic-checker-node-debug=string The incoming cheques will be checked on the node under the given Debug API URL. Default: http://localhost:11635; Dependency: --gen-traffic
--cheques-count=number This amount of cheques is intended to be generated by the traffic gen. Default: 1; Dependency: --gen-traffic
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
USAGE
exit 1
}
echoerr() {
>&2 echo "$@"
}
build_bee() {
# Clone source code
BEE_SOURCE_PATH=$MY_PATH/../bee
if [ -d "$BEE_SOURCE_PATH" ] ; then
rm -rf "$BEE_SOURCE_PATH"
fi
mkdir "$BEE_SOURCE_PATH" && cd "$BEE_SOURCE_PATH" || exit 1
git init
git remote add origin https://github.com/ethersphere/bee.git
git fetch origin --depth=1 "$COMMIT_HASH"
git reset --hard FETCH_HEAD
# Build bee and make docker image
export BEE_VERSION=${COMMIT_HASH::7}-commit
make binary
echo "Bee image will be built with version: $BEE_VERSION"
docker build . -t ethersphere/bee:$BEE_VERSION
cd "$MY_PATH" || exit 1
# Set build image tag so that other terminal session can retrieve
"$MY_PATH/utils/build-image-tag.sh" set "$BEE_VERSION"
}
deploy_contracts_and_return_addresses() {
CONTRACT_ADDRESSES=""
while IFS=$'\n' read -r contract; do
CONTRACT_ADDRESSES+="$(echo $contract | cut -d ":" -f 4)=$(echo $contract | cut -d ":" -f 5);"
done < <(npm run migrate:contracts | grep ^::CONTRACT)
echo "$CONTRACT_ADDRESSES"
}
MY_PATH=$(dirname "$0")
MY_PATH=$( cd "$MY_PATH" && pwd )
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
COMMIT_HASH=HEAD
BUILD_BASE_BEE=false
GEN_TRAFFIC=false
GEN_TRAFFIC_CHECKER_NODE_DEBUG="http://localhost:1635"
GEN_TRAFFIC_UPLOAD_NODE="http://localhost:11633"
GEN_TRAFFIC_UPLOAD_NODE_DEBUG="http://localhost:11635"
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
CHEQUES_COUNT=1
# Bee version here means the base bee version on which the images will be built
BEE_VERSION=$("$MY_PATH/utils/env-variable-value.sh" BEE_VERSION)
BLOCKCHAIN_VERSION=$("$MY_PATH/utils/env-variable-value.sh" BLOCKCHAIN_VERSION)
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
SUPPORTED_WORKER_N=4
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
# handle passed options
while [ $# -gt 0 ]
do
case "$1" in
--build-base-bee)
BUILD_BASE_BEE=true
shift 1
;;
--base-bee-commit-hash=*)
COMMIT_HASH="${1#*=}"
shift 1
;;
--gen-traffic)
GEN_TRAFFIC=true
shift 1
;;
--cheques-count=*)
CHEQUES_COUNT=${1#*=}
shift 1
;;
--gen-traffic-upload-node=*)
GEN_TRAFFIC_UPLOAD_NODE="${1#*=}"
shift 1
;;
--gen-traffic-upload-node-debug=*)
GEN_TRAFFIC_UPLOAD_NODE_DEBUG="${1#*=}"
shift 1
;;
--gen-traffic-checker-node-debug=*)
GEN_TRAFFIC_CHECKER_NODE_DEBUG="${1#*=}"
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
shift 1
;;
*)
echoerr "Unknown argument: $1"
usage
;;
esac
done
# cleanup for start from an empty state
"$MY_PATH/bee-cleanup.sh"
2022-02-08 13:23:18 +01:00
if $BUILD_BASE_BEE ; then
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
build_bee
fi
"$MY_PATH/network.sh"
"$MY_PATH/blockchain.sh"
CONTRACT_ADDRESSES=$(deploy_contracts_and_return_addresses)
npm run supply
chmod -R 777 "$MY_PATH/bee-data-dirs/"
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
if $GEN_TRAFFIC ; then
export STATE_COMMIT='true'
echo "Bee image with special state will be commited... traffic generation is on."
# give the permission to the bee user
echo "Start Bee nodes so that traffic can be generated and commited to the images"
"$MY_PATH/bee.sh" start --version="$BEE_VERSION" --workers=$SUPPORTED_WORKER_N --contract-addrs=$CONTRACT_ADDRESSES --detach
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
echo "Generating traffic on Bee node $GEN_TRAFFIC_UPLOAD_NODE"
echo "Run traffic generation until $CHEQUES_COUNT incoming cheques will arrive to node under Debug API $GEN_TRAFFIC_CHECKER_NODE_DEBUG"
npm run gen:traffic -- "$CHEQUES_COUNT" "$GEN_TRAFFIC_CHECKER_NODE_DEBUG;$GEN_TRAFFIC_UPLOAD_NODE;$GEN_TRAFFIC_UPLOAD_NODE_DEBUG"
2022-02-09 08:26:03 +01:00
echo "traffic has been generated"
echo "Adding postage stamp to Queen"
npx swarm-cli stamp buy --yes --quiet --depth 22 --amount 1_000_000 --label "==testingStamp=="
echo "Stamp bought"
2022-02-09 08:26:03 +01:00
# This sets output parameter in Github Actions that
# is then used to trigger Bee-js PR creation
if [ "$CI" == 'true' ]; then
echo "Image version tag will be extracted from the bee version command..."
docker pull "ethersphere/bee:$BEE_VERSION"
FULL_BEE_VERSION=$(docker run --rm "ethersphere/bee:$BEE_VERSION" version 2>&1)
echo "Extracted Bee version: $FULL_BEE_VERSION"
echo "::set-output name=full-version::$FULL_BEE_VERSION"
2022-02-09 08:26:03 +01:00
npm run setApiVersions "$GEN_TRAFFIC_CHECKER_NODE_DEBUG"
fi
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
"$MY_PATH/bee.sh" stop
docker container prune -f
export BLOCKCHAIN_VERSION+="-for-$BEE_VERSION"
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
fi
"$MY_PATH/bee-docker-build.sh" "$CONTRACT_ADDRESSES"
feat: bee 1.0.0 (#41) * feat: new Price Oracle bytecode * refactor: remove file smth.txt * feat: new PostageStamp contract * feat: change contract deploy workflow * feat: bee-1.0.0-rc2 compatible runner * feat: build from source (#47) * feat: extend build-envrionment.sh with building bee image from source * ci: new workflow option parameter - beeVersionAsCommitHash * fix(ci): try to overwrite BEE_VERSION sys variable * fix: do not export BEE_VERSION after env build * fix(ci): run build-environment without source command * fix(ci): try to retrieve built BEE_VERSION value * fix: save build BEE_VERSION value * fix(ci): retrieve built image tag in the last step * refactor: echoerr * refactor(ci): export sys variables * feat: disable warmup time (#46) * feat: disable warmup time * fix: place warmup-time to the correct place * fix: put quote back where it truly belongs * feat: state commit (#45) * refactor: remove payment treshold option because it causes performance issues * docs: design planned parameters for the new build workflow * feat: build environment with traffic gen option * fix(log): rephrase traffic gen log * feat: special bee version tagging when state commit happens * build: new env variable STATE_COMMIT * ci: STATE_COMMIT * feat: state commit scripts * refactor: destroy containers after state producing * refactor: remove unnecessary echo * fix: blockchain version at state commit * build: bumo bee-js version * build: update package-lock * fix: fixes * ci: build environment workflow with state commit * refactor: buy larger stamp * fix: publish workflow * refactor: increase stamp depth * fix: bee version fetch at commit * refactor: start containers normally instead of ephemeral for debugging * fix(ci): add chown for bee user on bee-data-dirs in order to write bee state * fix: try out the permission on bee data dir with 777 chmod * fix(ci): give folder permission in the build environment phrase * refactor(ci): raise sleep between uploads in order to generate cheques * refactor: wait 11 secs after batch purchase * fix: commit version tag string true instead of boolean * fix: add state commit check for set COMMIT_VERSION_TAG * chore: bump bee version Co-authored-by: Cafe137 <77121044+Cafe137@users.noreply.github.com>
2021-06-21 16:10:55 +02:00
"$MY_PATH/blockchain-docker-build.sh"