diff --git a/install/Dockerfile b/install/Dockerfile index e6daf05..0a7691e 100644 --- a/install/Dockerfile +++ b/install/Dockerfile @@ -21,5 +21,5 @@ RUN chown -R yo:yo /yo/.config USER yo WORKDIR /data -CMD ["yo","cyphernode"] +ENTRYPOINT ["yo","cyphernode"] diff --git a/install/generator-cyphernode/generators/app/index.js b/install/generator-cyphernode/generators/app/index.js index 6fa5982..591a7c7 100644 --- a/install/generator-cyphernode/generators/app/index.js +++ b/install/generator-cyphernode/generators/app/index.js @@ -19,6 +19,10 @@ module.exports = class extends Generator { constructor(args, opts) { super(args, opts); + if( args.indexOf('recreate') !== -1 ) { + this.recreate = true; + } + if( fs.existsSync(this.destinationPath('props.json')) ) { this.props = require(this.destinationPath('props.json')); } else { @@ -36,6 +40,10 @@ module.exports = class extends Generator { } prompting() { + if( this.recreate ) { + // no prompts + return; + } const splash = fs.readFileSync(this.templatePath('splash.txt')); this.log(splash.toString()); diff --git a/install/script/configure.sh b/install/script/configure.sh index d284a55..15811df 100644 --- a/install/script/configure.sh +++ b/install/script/configure.sh @@ -2,12 +2,16 @@ configure() { local current_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" ## build setup docker image + local recreate="" + + if [[ $1 == 1 ]]; then + recreate="recreate" + fi + build_docker_image ../ cyphernodeconf && clear && echo "Thinking..." # configure features of cyphernode docker run -v $current_path/../data:/data \ --log-driver=none\ - --rm -it cyphernodeconf:latest - - #docker image rm cyphernodeconf:latest + --rm -it cyphernodeconf:latest $recreate } diff --git a/install/script/setup.sh b/install/script/setup.sh index d48451f..4082994 100755 --- a/install/script/setup.sh +++ b/install/script/setup.sh @@ -6,9 +6,13 @@ CONFIGURE=0 INSTALL=0 +RECREATE=0 -while getopts ":ci" opt; do +while getopts ":cir" opt; do case $opt in + r) + RECREATE=1 + ;; c) CONFIGURE=1 ;; @@ -21,12 +25,12 @@ while getopts ":ci" opt; do esac done -if [[ $CONFIGURE == 0 && $INSTALL == 0 ]]; then - echo "Please use -c to configure, -i to install and -ci to do both" +if [[ $CONFIGURE == 0 && $INSTALL == 0 && RECREATE == 0 ]]; then + echo "Please use -c to configure, -i to install and -ci to do both. Use -r to recreate config files." else if [[ $CONFIGURE == 1 ]]; then trace "Starting configuration phase" - configure + configure $RECREATE fi if [[ $INSTALL == 1 ]]; then