Skip to content

Commit

Permalink
Merge pull request #1035 from seth-reeser/develop-catapult
Browse files Browse the repository at this point in the history
Platform: Introduce the idle option for websites.
  • Loading branch information
seth-reeser authored Nov 12, 2022
2 parents 4415d4c + b43f34d commit e71b3b5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion VERSION.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 6 additions & 0 deletions catapult/catapult.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions provisioners/redhat/provision_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e71b3b5

Please sign in to comment.