Skip to content

Conditional set based on a parameter set on the host #3373

Discussion options

You must be logged in to vote

Thanks @antonmedv, worked perfectly.

For reference, this is what I ended up doing:

/**
 * Set config based on environment
 */
task('environment:prepare', function () {
	switch (get('ll_deployer_environment')) {
		case 'vps':
			/**
			 * writable_use_sudo
			 * @package deployer
			 *
			 * Using sudo in writable commands?
			 */
			set('writable_use_sudo', true);

			/**
			* bin/composer
			* @package deployer
			*
			* Set default composer path
			*/
			set('bin/composer', '/usr/local/bin/composer');

			break;
		case 'cpanel':
			writeln('Environment: cPanel');

			/**
			 * writable_mode
			 * @package deployer
			 *
			 * What writeable mode should we use?
			 */
			set('writable_mode'

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@mikestreety
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by mikestreety
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants