diff --git a/README.md b/README.md index d23c140b..54a7a728 100644 --- a/README.md +++ b/README.md @@ -898,6 +898,12 @@ The following options are available: * dependency: `force_ip:` * example: `force_ip_exclude: ["production"]` * array of select environments `["dev","test","qc","production"]` to exclude from the `force_ip` option +* `idle:` + * default: `false` + * required: no + * option: `idle: true` + * turns off all website operations in the dev and test environment, including git pulls and database refreshing + * used for websites that are not under active software development * `repo:` * required: yes * example: `repo: git@github.com:devopsgroup-io/devopsgroup-io.git` diff --git a/VERSION.yml b/VERSION.yml index 9da7fca3..c714e517 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- -version: 4.5.1 +version: 4.6.0 major: description: "Catapult uses Semantic Versioning. During a MAJOR increment, incompatable API changes are made which require a manual upgrade path. Please follow these directions:" notice: "NEW MAJOR VERSION OF CATAPULT AVAILABLE" diff --git a/catapult/catapult.rb b/catapult/catapult.rb index 30ad98d6..67fd1e94 100644 --- a/catapult/catapult.rb +++ b/catapult/catapult.rb @@ -2294,6 +2294,12 @@ def Command::getSignatureKey(key, dateStamp, regionName, serviceName) catapult_exception("There is an error in your secrets/configuration.yml file.\nThe force_ip_exclude for websites => #{service} => domain => #{instance["domain"]} is invalid, it must only include one, some, or all of the following [\"dev\",\"test\",\"qc\",\"production\"].") end end + # validate idle + unless instance["idle"] == nil + unless ["true"].include?("#{instance["idle"]}") + catapult_exception("There is an error in your secrets/configuration.yml file.\nThe idle for websites => #{service} => domain => #{instance["domain"]} is invalid, it must be true or removed.") + end + end # validate software unless instance["software"] == nil # create an array of available software diff --git a/provisioners/redhat/provision_server.sh b/provisioners/redhat/provision_server.sh index 4f764559..43b5c2bd 100644 --- a/provisioners/redhat/provision_server.sh +++ b/provisioners/redhat/provision_server.sh @@ -151,9 +151,13 @@ if [ $(cat "/catapult/provisioners/provisioners.yml" | shyaml get-values-0 redha website_index=0 # loop through websites and start sub-processes while read -r -d $'\0' website; do - # if there are no incoming catapult changes, website changes, and there is no need to run persistent modules for this domain - if ([ ! -f "/catapult/provisioners/redhat/logs/catapult.changes" ] && [ $(cat "/catapult/provisioners/provisioners.yml" | shyaml get-value redhat.modules.${module}.multithreading_persistent) != "True" ] && [ ! -f "/catapult/provisioners/redhat/logs/domain.$(echo "${website}" | shyaml get-value domain).changes" ]); then - echo "> module skipped for this website when there are no catapult repository changes and no website repository changes..." > "/catapult/provisioners/redhat/logs/${module}.$(echo "${website}" | shyaml get-value domain).log" + # determine if we need to skip modules + idle=$(echo "${website}" | shyaml get-value idle 2>/dev/null ) + if ([ "${idle}" = "True" ]) && ([ $1 = "dev" ] || [ $1 = "test" ]); then + echo "> skipping module, website is set to idle..." > "/catapult/provisioners/redhat/logs/${module}.$(echo "${website}" | shyaml get-value domain).log" + touch "/catapult/provisioners/redhat/logs/${module}.$(echo "${website}" | shyaml get-value domain).complete" + elif ([ ! -f "/catapult/provisioners/redhat/logs/catapult.changes" ] && [ $(cat "/catapult/provisioners/provisioners.yml" | shyaml get-value redhat.modules.${module}.multithreading_persistent) != "True" ] && [ ! -f "/catapult/provisioners/redhat/logs/domain.$(echo "${website}" | shyaml get-value domain).changes" ]); then + echo "> skipping module, there are no catapult or website repository changes..." > "/catapult/provisioners/redhat/logs/${module}.$(echo "${website}" | shyaml get-value domain).log" touch "/catapult/provisioners/redhat/logs/${module}.$(echo "${website}" | shyaml get-value domain).complete" # if there are incoming websites changes, run the persistent module for this domain else