Skip to content
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

Fix submodule doesn't update when create release #220

Closed
wants to merge 1 commit into from

Conversation

numbcoder
Copy link

Fix #219

Copy link
Owner

@mattbrictson mattbrictson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
end

2. 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"

# ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git:create_release doesn't pull submodule
2 participants