Roots Discourse

Skip tasks for specific site


#1

We have three sites on a DO Droplet.

Two are WP sites, the third is just HTML (for now, anyway).

What I’ve been doing to deploy the HTML only site is to run the deploy command, skipping the WP-dependent tasks associated with two tags:

./bin/deploy.sh production example.com --skip-tags "deploy-finalize-before,deploy-finalize-after"

I looked at the following thread and imagine that there is a place where I could add a when: is_not_example_site, but am not sure what that command would be or where it would go.

I guess another option would be to modify deploy.sh so that

if [[ "$SITE" = "example.com" ]]
then
EXTRA_PARAMS="$EXTRA_PARAMS --skip-tags \"deploy-finalize-before,deploy-finalize-after\""
fi

DEPLOY_CMD="ansible-playbook deploy.yml -e env=$ENV -e site=$SITE $EXTRA_PARAMS"
etc...

As always, the Roots community wisdom and feedback would be much appreciated.


#2

In terms of the bash command, the above doesn’t quite work.

I had to either change the last line of the script to use eval:

eval $DEPLOY_CMD

It might be better to use an array to hold the command as referenced in following two threads.

http://mywiki.wooledge.org/BashFAQ/050