diff options
author | Ting-Wei Lan <tingwei.lan@cobinhood.com> | 2019-04-12 18:22:50 +0800 |
---|---|---|
committer | Ting-Wei Lan <tingwei.lan@cobinhood.com> | 2019-04-25 13:48:06 +0800 |
commit | 949505a4bccb95437f7b992597175e16b9a4fae3 (patch) | |
tree | 6f9d9630bf6f594a6815eee7ed7f0caea7272633 /simulation | |
parent | 3939c62ed80c59f1a06bf0978598b1ea2c40a496 (diff) | |
download | dexon-consensus-wip/lantw/license-makefile-shell-scripts.tar dexon-consensus-wip/lantw/license-makefile-shell-scripts.tar.gz dexon-consensus-wip/lantw/license-makefile-shell-scripts.tar.bz2 dexon-consensus-wip/lantw/license-makefile-shell-scripts.tar.lz dexon-consensus-wip/lantw/license-makefile-shell-scripts.tar.xz dexon-consensus-wip/lantw/license-makefile-shell-scripts.tar.zst dexon-consensus-wip/lantw/license-makefile-shell-scripts.zip |
Merge Makefile and shell script improvements from an internal projectwip/lantw/license-makefile-shell-scripts
The Makefile used in this project was based on the one used in an
internal project. Since the Makefile and shell scripts have been
refactored several times and become easier to use, it should be good to
bring these improvements to the project.
Diffstat (limited to 'simulation')
-rwxr-xr-x | simulation/kubernetes/run_scheduler.sh | 14 | ||||
-rwxr-xr-x | simulation/kubernetes/run_simulation.sh | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/simulation/kubernetes/run_scheduler.sh b/simulation/kubernetes/run_scheduler.sh index 8b45eb5..d6e7ced 100755 --- a/simulation/kubernetes/run_scheduler.sh +++ b/simulation/kubernetes/run_scheduler.sh @@ -3,13 +3,13 @@ IMAGE_TAG=asia.gcr.io/cobinhood/dexcon-simulation:latest build_binary() { - make DOCKER=true -C ../.. + make -C ../.. BUILD_IN_DOCKER=true cp -r ../../build . } build_docker_image() { - docker build -t ${IMAGE_TAG} . - docker push ${IMAGE_TAG} + docker build -t "${IMAGE_TAG}" . + docker push "${IMAGE_TAG}" } start_simulation() { @@ -23,11 +23,11 @@ main() { local num_nodes=$1 local num_cpus=$2 - if [ "$num_nodes" == "" ]; then - num_nodes=31 + if [ "$num_nodes" = "" ]; then + num_nodes=31 fi - if [ "$num_cpus" == "" ]; then + if [ "$num_cpus" = "" ]; then num_cpus=2 fi @@ -41,4 +41,4 @@ main() { start_simulation } -main $* +main "$@" diff --git a/simulation/kubernetes/run_simulation.sh b/simulation/kubernetes/run_simulation.sh index 2537eb6..d3bf28b 100755 --- a/simulation/kubernetes/run_simulation.sh +++ b/simulation/kubernetes/run_simulation.sh @@ -4,13 +4,13 @@ IMAGE_TAG=asia.gcr.io/dexon-dev/dexcon-simulation:latest build_binary() { - make DOCKER=true -C ../.. + make -C ../.. BUILD_IN_DOCKER=true cp -r ../../build . } build_docker_image() { - docker build -t ${IMAGE_TAG} . - docker push ${IMAGE_TAG} + docker build -t "${IMAGE_TAG}" . + docker push "${IMAGE_TAG}" } start_simulation() { @@ -34,7 +34,7 @@ start_simulation() { main() { local num_nodes=$1 - if [ "$num_nodes" == "" ]; then + if [ "$num_nodes" = "" ]; then num_nodes=7 fi @@ -47,4 +47,4 @@ main() { start_simulation } -main $* +main "$@" |