-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved logic of devided bash scripts.
- Loading branch information
1 parent
bda0086
commit 23dbd58
Showing
5 changed files
with
61 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
function runInBackground { | ||
export IMAGE_VERSION=$1 | ||
DIR=$1 | ||
export IMAGE_VERSION=$2 | ||
DOCKER_COMPOSE_FILE="${DIR}/docker-compose.yml" | ||
DOCKER_COMPOSE_LOCAL_FILE="${DIR}/docker-compose.local.yml" | ||
|
||
cd "${__DIR}" | ||
|
||
docker-compose -f docker-compose.yml -f docker-compose.local.yml kill > /dev/null 2>&1 | ||
docker-compose -f docker-compose.yml -f docker-compose.local.yml rm -f -v > /dev/null 2>&1 | ||
docker-compose -f docker-compose.yml -f docker-compose.local.yml up -d nginx php mysql | ||
docker-compose -f docker-compose.yml -f docker-compose.local.yml exec php bash | ||
docker-compose -f docker-compose.yml -f docker-compose.local.yml kill > /dev/null 2>&1 | ||
docker-compose -f docker-compose.yml -f docker-compose.local.yml rm -f -v > /dev/null 2>&1 | ||
docker-compose -f "${DOCKER_COMPOSE_FILE}" -f "${DOCKER_COMPOSE_LOCAL_FILE}" kill > /dev/null 2>&1 | ||
docker-compose -f "${DOCKER_COMPOSE_FILE}" -f "${DOCKER_COMPOSE_LOCAL_FILE}" rm -f -v > /dev/null 2>&1 | ||
docker-compose -f "${DOCKER_COMPOSE_FILE}" -f "${DOCKER_COMPOSE_LOCAL_FILE}" up -d nginx php mysql | ||
docker-compose -f "${DOCKER_COMPOSE_FILE}" -f "${DOCKER_COMPOSE_LOCAL_FILE}" exec php bash | ||
docker-compose -f "${DOCKER_COMPOSE_FILE}" -f "${DOCKER_COMPOSE_LOCAL_FILE}" kill > /dev/null 2>&1 | ||
docker-compose -f "${DOCKER_COMPOSE_FILE}" -f "${DOCKER_COMPOSE_LOCAL_FILE}" rm -f -v > /dev/null 2>&1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
export PROJECT_NAME=$(cat "${__DIR}/.project_name") | ||
export PROJECT_XDEBUG_ENABLED=false | ||
export PROJECT_WEB_DIR=${PROJECT_WEB_DIR:="web"} | ||
export PROJECT_INDEX_FILE=${PROJECT_INDEX_FILE:="index.php"} | ||
export PROJECT_DEV_INDEX_FILE=${PROJECT_DEV_INDEX_FILE:="index_dev.php"} | ||
export APP_NAME=$(echo $(cat "${__DIR}/composer.json" | grep name | head -1 | awk -F: '{ print $2 }' | sed 's/[",\r]//g' | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')) | ||
export APP_VERSION=$(echo $(cat "${__DIR}/composer.json" | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",\r]//g')) | ||
export USERID=$(id -u); | ||
function defineVariables | ||
{ | ||
DIR=$1 | ||
export PROJECT_NAME=$(cat "${DIR}/.project_name") | ||
export PROJECT_XDEBUG_ENABLED=false | ||
export PROJECT_WEB_DIR=${PROJECT_WEB_DIR:="web"} | ||
export PROJECT_INDEX_FILE=${PROJECT_INDEX_FILE:="index.php"} | ||
export PROJECT_DEV_INDEX_FILE=${PROJECT_DEV_INDEX_FILE:="index_dev.php"} | ||
export APP_NAME=$(echo $(cat "${DIR}/composer.json" | grep name | head -1 | awk -F: '{ print $2 }' | sed 's/[",\r]//g' | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')) | ||
export APP_VERSION=$(echo $(cat "${DIR}/composer.json" | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",\r]//g')) | ||
export USERID=$(id -u); | ||
|
||
|
||
echo "User ID: $USERID"; | ||
echo -e "\nIMAGE VERSION: $APP_NAME:$APP_VERSION\n"; | ||
declare -i BUILD_STATUS=0; | ||
echo "User ID: $USERID"; | ||
echo -e "\nIMAGE VERSION: $APP_NAME:$APP_VERSION\n"; | ||
declare -i BUILD_STATUS=0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters