Fix submodule doesn't update when create release#220
Closed
numbcoder wants to merge 1 commit intomattbrictson:mainfrom
Closed
Fix submodule doesn't update when create release#220numbcoder wants to merge 1 commit intomattbrictson:mainfrom
numbcoder wants to merge 1 commit intomattbrictson:mainfrom
Conversation
Owner
mattbrictson
left a comment
There was a problem hiding this comment.
This looks reasonable, but as the sole maintainer of tomo and someone who has never used submodules in a production capacity, I am not comfortable including this in the default tomo git plugin.
As a result, I am going to close this PR.
However, for those interested in using this code in their own tomo projects, you can implement it as follows:
1. Create a plugin local to your project.
# .tomo/plugins/submodule.rb
def update_and_init
remote.chdir(paths.release) do
remote.git("--work-tree=. --git-dir=#{paths.git_repo} submodule update --init --recursive --depth=1")
end
end2. Load the plugin in your config file
# .tomo/config.rb
plugin "./plugins/submodule"3. Add the new task right after git:create_release
setup do
# ...
run "git:create_release"
run "submodule:update_and_init"
# ...
deploy do
# ...
run "git:create_release"
run "submodule:update_and_init"
# ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #219