diff --git a/devtool/Dockerfile b/scripts/Dockerfile similarity index 90% rename from devtool/Dockerfile rename to scripts/Dockerfile index b6c3cbc8a8be27166fbaf0fc83a1c193a097afb7..0bba79d3ab94312c470237d74d2222bd56b78e4b 100644 --- a/devtool/Dockerfile +++ b/scripts/Dockerfile @@ -1,3 +1,7 @@ +# This Dockerfile should be used to create an development environment to +# develop applications for cozy-stack. It installs go and couchdb 2. +# It should not be used for hosting your cozy cloud in production. + FROM debian:jessie ENV COUCHDB_VERSION 2.0.0 diff --git a/build.sh b/scripts/build.sh similarity index 99% rename from build.sh rename to scripts/build.sh index cb83e23c7c380d904e8ad7eca2c6cdd8e5d1527a..2ea4f194185806d87a57b13cb65bc842da3e53ff 100755 --- a/build.sh +++ b/scripts/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e COZY_ENV_DFL=production @@ -7,7 +7,7 @@ COZY_ENV_DFL=production [ -z ${COZY_DEPLOY_USER} ] && COZY_DEPLOY_USER=${USER} pushd `dirname $0` > /dev/null -WORK_DIR=`pwd` +WORK_DIR=$(dirname "`pwd`") popd > /dev/null if [ -r ${WORK_DIR}/local.env ]; then diff --git a/coverage.sh b/scripts/coverage.sh similarity index 100% rename from coverage.sh rename to scripts/coverage.sh diff --git a/devtool/dev.sh b/scripts/dev.sh similarity index 80% rename from devtool/dev.sh rename to scripts/dev.sh index baf40c340dfe3f4258860f11dc69e4b7b950a9e0..f2dd19c5d500d7c19c5487356450695afde0cfc3 100755 --- a/devtool/dev.sh +++ b/scripts/dev.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash [ -z ${COZY_DEV_HOST} ] && COZY_DEV_HOST="cozy.local" [ -z ${COZY_DEV_PORT} ] && COZY_DEV_PORT="8080" @@ -14,31 +14,31 @@ if [ -d ${COZY_STACK_PATH} ] && [ -f ${COZY_STACK_PATH}/cozy-stack ]; then fi usage() { - echo "Usage: ${0} [-h] [-d <app path>] [–v <stack version>]" - - echo "\nEnvironment variables" - echo "\n COZY_DEV_HOST" - echo " specify the hostname or domain on which the dev server is listening" - echo " to incoming requests. default: dev.cozycloud.cc" - echo "\n COZY_DEV_PORT" - echo " specify the port on which the dev server is listening." - echo " default: 8080." - echo "\n COZY_STACK_PATH" - echo " specify the path of the cozy-stack binary folder or the binary" - echo " itself. default: \"\$GOPATH/bin\"." - echo "\n COZY_STACK_HOST" - echo " specify the hostname on which the cozy-stack is launched." - echo " default: localhost." - echo "\n COZY_STACK_PORT" - echo " specify the port on which the cozy-stack is listening." - echo " default: 8080." - echo "\n COUCHDB_ENABLE" - echo " specify whether or not this script should launch couchdb." - echo " default: 1" - echo "\n COUCHDB_HOST" - echo " specify the host of the couchdb database. default: localhost" - echo "\n COUCHDB_PORT" - echo " specify the port of the couchdb database. default: 5984" + echo -e "Usage: ${0} [-h] [-d <app path>] [–v <stack version>]" + + echo -e "\nEnvironment variables" + echo -e "\n COZY_DEV_HOST" + echo -e " specify the hostname or domain on which the dev server is listening" + echo -e " to incoming requests. default: dev.cozycloud.cc" + echo -e "\n COZY_DEV_PORT" + echo -e " specify the port on which the dev server is listening." + echo -e " default: 8080." + echo -e "\n COZY_STACK_PATH" + echo -e " specify the path of the cozy-stack binary folder or the binary" + echo -e " itself. default: \"\$GOPATH/bin\"." + echo -e "\n COZY_STACK_HOST" + echo -e " specify the hostname on which the cozy-stack is launched." + echo -e " default: localhost." + echo -e "\n COZY_STACK_PORT" + echo -e " specify the port on which the cozy-stack is listening." + echo -e " default: 8080." + echo -e "\n COUCHDB_ENABLE" + echo -e " specify whether or not this script should launch couchdb." + echo -e " default: 1" + echo -e "\n COUCHDB_HOST" + echo -e " specify the host of the couchdb database. default: localhost" + echo -e "\n COUCHDB_PORT" + echo -e " specify the port of the couchdb database. default: 5984" } if [ -n "${COZY_STACK_PATH}" ] && [ ! -f "${COZY_STACK_PATH}" ]; then @@ -214,7 +214,7 @@ check_hosts() { } echo_err() { - >&2 echo "error: ${1}" + >&2 echo -e "error: ${1}" } while getopts ":hd:v:" optname; do