-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
update_code
recipe - 3rd option update_code_strategy
that loads submodule
#4063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
// Can be one of: | ||
// - archive | ||
// - clone (if you need the origin repository `.git` dir in your {{release_path}}) | ||
// - close_submodule (same as `clone`, but running `git submodule init` and `git submodule update` as well) | ||
set('update_code_strategy', 'archive'); | ||
|
||
// Sets environment variable _GIT_SSH_COMMAND_ for `git clone` command. | ||
|
@@ -114,6 +115,13 @@ | |
run("$git clone -l $bare ."); | ||
run("$git remote set-url origin $repository", env: $env); | ||
run("$git checkout --force $target"); | ||
} elseif (get('update_code_strategy') === 'clone_submodule') { | ||
cd('{{release_path}}'); | ||
run("$git clone -l $bare ."); | ||
run("$git remote set-url origin $repository", env: $env); | ||
run("$git checkout --force $target"); | ||
run("$git submodule init"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it's better to define it as a separate task which can be attached if needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, I'm not much into Deployer. I don't know how to solve this differently. Also, a separate task just for basically one line would be more complex. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. task('deploy:git:submodules', function () {
run('git submodule init');
run('git submodule update');
}); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. host('production')
->set('needs_submodules', true);
after('deploy:update_code', function () {
if (get('needs_submodules', false)) {
invoke('deploy:git:submodules');
}
}); |
||
run("$git submodule update"); | ||
} else { | ||
throw new ConfigurationException(parse("Unknown `update_code_strategy` option: {{update_code_strategy}}.")); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.