File tree Expand file tree Collapse file tree 7 files changed +25
-25
lines changed
Expand file tree Collapse file tree 7 files changed +25
-25
lines changed Original file line number Diff line number Diff line change 2121
2222# -----------------------------------------------------------------------
2323# This function has one main objective:
24- # 1. Check if the services on a docker-compose exists in docker
24+ # 1. Check if the services on a docker composeexists in docker
2525#
2626# You must/might inform the parameters below:
2727# 1. The compose file full path string
@@ -41,11 +41,11 @@ docker_compose_check_service_exists()
4141 LOCAL_QTY_SERVICES=${3:- 0}
4242
4343 [[ $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME == " " || $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME == null ]] && \
44- echoerror " You must inform the docker-compose full file path to the function: '${FUNCNAME[0]} '"
44+ echoerror " You must inform the docker composefull file path to the function: '${FUNCNAME[0]} '"
4545
46- [[ " $DEBUG " == true ]] && echo " Checking if docker-compose services exists for: '$LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME '"
46+ [[ " $DEBUG " == true ]] && echo " Checking if docker composeservices exists for: '$LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME '"
4747
48- LOCAL_RESULTS=$( docker-compose --file " $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME " ps --quiet | wc -l)
48+ LOCAL_RESULTS=$( docker compose --file " $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME " ps --quiet | wc -l)
4949
5050 # Check results
5151 if [[ $LOCAL_RESULTS > $LOCAL_QTY_SERVICES ]]; then
Original file line number Diff line number Diff line change 2121
2222# -----------------------------------------------------------------------
2323# This function has one main objective:
24- # 1. Check if the services on a docker-compose file is running
24+ # 1. Check if the services on a docker composefile is running
2525#
2626# You must/might inform the parameters below:
2727# 1. The compose file full path string
@@ -41,11 +41,11 @@ docker_compose_check_service_is_running()
4141 LOCAL_QTY_SERVICES=${3:- 0}
4242
4343 [[ $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME == " " || $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME == null ]] && \
44- echoerror " You must inform the docker-compose full file path to the function: '${FUNCNAME[0]} '"
44+ echoerror " You must inform the docker composefull file path to the function: '${FUNCNAME[0]} '"
4545
46- [[ " $DEBUG " == true ]] && echo " Checking if docker-compose services are running for: '$LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME '"
46+ [[ " $DEBUG " == true ]] && echo " Checking if docker composeservices are running for: '$LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME '"
4747
48- LOCAL_RESULTS=$( docker-compose --file " $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME " ps | grep " Up" | wc -l)
48+ LOCAL_RESULTS=$( docker compose --file " $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME /$LOCAL_DOCKER_COMPOSE_FILE_NAME " ps | grep " Up" | wc -l)
4949
5050 # Check results
5151 if [[ $LOCAL_RESULTS > $LOCAL_QTY_SERVICES ]]; then
Original file line number Diff line number Diff line change 2121
2222# -----------------------------------------------------------------------
2323# This function has one main objective:
24- # 1. Update specific string in docker-compose file
24+ # 1. Update specific string in docker composefile
2525#
2626# You must/might inform the parameters below:
2727# 1. Path where the compose file are located (/path/docker-compose.yml)
2828# 2. String that should be REPLACED
2929# 3. New String
30- # 4. [optional] docker-compose file name (default: docker-compose.yml)
30+ # 4. [optional] docker composefile name (default: docker-compose.yml)
3131#
3232# -----------------------------------------------------------------------
3333
@@ -46,6 +46,6 @@ docker_compose_replace_string()
4646 # Check if file exists
4747 [[ " $DEBUG " == true ]] && echo " Updating in file '$LOCAL_DOCKER_COMPOSE_FULL_FILE_PATH ' the string from: '$LOCAL_REPLACE_STRING_FROM ' to: '$LOCAL_REPLACE_STRING_TO ' - [function: ${FUNCNAME[0]} ]"
4848
49- # Update the docker-compose file
49+ # Update the docker composefile
5050 file_update_file $LOCAL_DOCKER_COMPOSE_FULL_FILE_PATH $LOCAL_REPLACE_STRING_FROM $LOCAL_REPLACE_STRING_TO
5151}
Original file line number Diff line number Diff line change 2121
2222# -----------------------------------------------------------------------
2323# This function has one main objective:
24- # 1. Start the docker-compose service
24+ # 1. Start the docker composeservice
2525#
2626# You must/might inform the parameters below:
2727# 1. Path where the compose file are located (/path/docker-compose.yml)
28- # 2. [optional] (default: false) pull docker-compose images before start
29- # 3. [optional] (default: docker-compose.yml) docker-compose file name
28+ # 2. [optional] (default: false) pull docker composeimages before start
29+ # 3. [optional] (default: docker-compose.yml) docker composefile name
3030# 4. [optional] (default: .env) .env file name
3131# 5. [optional] (default: same location in arg. 1) .env file location
3232#
@@ -49,10 +49,10 @@ docker_compose_start()
4949 [[ " $DEBUG " == true ]] && echo " Starting docker composer service for '$LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME ' - [function: ${FUNCNAME[0]} ]"
5050
5151 # Pull if set
52- [[ " $LOCAL_PULL_BEFORE_START " == true ]] && docker-compose --env-file $LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE --file $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME pull
52+ [[ " $LOCAL_PULL_BEFORE_START " == true ]] && docker compose --env-file $LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE --file $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME pull
5353
5454 # Start service
55- if ! docker-compose --env-file $LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE --file $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME up -d; then
55+ if ! docker compose --env-file $LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE --file $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME up -d; then
5656 ERROR_DOCKER_COMPOSE_START=true
5757 fi
5858}
Original file line number Diff line number Diff line change 2121
2222# -----------------------------------------------------------------------
2323# This function has one main objective:
24- # 1. Stop the docker-compose service
24+ # 1. Stop the docker composeservice
2525#
2626# You must inform the parameters below:
2727# 1. Path where the compose file are located (/path/docker-compose.yml)
28- # 2. [optional] (default: docker-compose.yml) docker-compose file name
28+ # 2. [optional] (default: docker-compose.yml) docker composefile name
2929# 3. [optional] (default: .env) .env file name
3030# 4. [optional] (default: same location in arg. 1) .env file location
3131#
@@ -42,12 +42,12 @@ docker_compose_stop()
4242 LOCAL_DOCKER_COMPOSE_ENV_PATH=${4:- $LOCAL_DOCKER_COMPOSE_PATH }
4343 LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE=" ${LOCAL_DOCKER_COMPOSE_ENV_PATH%/ } /$LOCAL_DOCKER_COMPOSE_ENV_FILE "
4444
45- [[ $LOCAL_DOCKER_COMPOSE_PATH == " " ]] && [[ $LOCAL_DOCKER_COMPOSE_PATH == null ]] && echoerror " You must inform the docker-compose file path to the function: '${FUNCNAME[0]} '"
45+ [[ $LOCAL_DOCKER_COMPOSE_PATH == " " ]] && [[ $LOCAL_DOCKER_COMPOSE_PATH == null ]] && echoerror " You must inform the docker composefile path to the function: '${FUNCNAME[0]} '"
4646
4747 [[ " $DEBUG " == true ]] && echo " Stopping docker composer service for '$LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME ' - [function: ${FUNCNAME[0]} ]"
4848
4949 # Stop service or return error variable
50- if ! docker-compose --env-file $LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE --file $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME down; then
50+ if ! docker compose --env-file $LOCAL_DOCKER_COMPOSE_ENV_FULL_FILE --file $LOCAL_DOCKER_COMPOSE_FULL_FILE_NAME down; then
5151 ERROR_DOCKER_COMPOSE_STOP=true
5252 fi
5353}
Original file line number Diff line number Diff line change 2121
2222# -----------------------------------------------------------------------
2323# This function has one main objective:
24- # 1. Run wp-cli search and replace function at a docker-compose file
24+ # 1. Run wp-cli search and replace function at a docker composefile
2525#
2626# You must/might inform the parameters below:
2727# 1. Path where the compose file are located (/path/docker-compose.yml)
2828# 2. String that should be REPLACED in database
2929# 3. New String
30- # 4. [optional] docker-compose file name (default: docker-compose.yml)
30+ # 4. [optional] docker composefile name (default: docker-compose.yml)
3131#
3232# -----------------------------------------------------------------------
3333
@@ -46,9 +46,9 @@ docker_compose_wpcli_search_replace()
4646 # Check if file exists
4747 [[ " $DEBUG " == true ]] && echo " Updating in file '$LOCAL_DOCKER_COMPOSE_FULL_FILE_PATH ' the string from: '$LOCAL_REPLACE_STRING_FROM ' to: '$LOCAL_REPLACE_STRING_TO ' - [function: ${FUNCNAME[0]} ]"
4848
49- # Update the docker-compose file
49+ # Update the docker composefile
5050 cd $( dirname $LOCAL_DOCKER_COMPOSE_FULL_FILE_PATH ) > /dev/null 2>&1
51- if ! docker-compose run --rm wpcli search-replace $LOCAL_REPLACE_STRING_FROM $LOCAL_REPLACE_STRING_TO ; then
51+ if ! docker composerun --rm wpcli search-replace $LOCAL_REPLACE_STRING_FROM $LOCAL_REPLACE_STRING_TO ; then
5252 ERROR_DOCKER_COMPOSE_WPCLI_SEARCH_REPLACE=true
5353 fi
5454 cd - > /dev/null 2>&1
Original file line number Diff line number Diff line change 4646 -s | --source Folder where the docker-compose.yml for the running site is located
4747 -d | --destination Folder where the clone site will be located
4848 -h | --help Display this help
49- --no-start Clone the site but does not start the docker-compose services
49+ --no-start Clone the site but does not start the docker composeservices
5050 [WARNING!] Careful when cloning sites with the same URL.
5151 It is recommended you ALWAYS USE the --new-url option.
5252
You can’t perform that action at this time.
0 commit comments