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

Support before/after hooks #13

Open
yuma-brendan opened this issue Oct 17, 2023 · 1 comment
Open

Support before/after hooks #13

yuma-brendan opened this issue Oct 17, 2023 · 1 comment

Comments

@yuma-brendan
Copy link

We currently use git submodules to manage some dependencies, and it makes it impossible to use cuber without some creativity.

Currently, it makes it difficult to decouple packaging the docker image with deploying. So currently, I have a vendored version that adds a rollout command that let's us add some hooks. but that's less than satisfying.

I would also be happier if it was easier to hook into the cli interface instead of having to play arround with ARGV.

In a custom Rakefile

require_relative '../cuber/commands'
ARGV.push('rollout')
Cuber::CLI.new
require_relative 'deploy'
# require sh
module Cuber::Commands
  class Rollout < Cuber::Commands::Deploy
    def pre_checkout
      puts "Pre-checkout"
    end

    def post_checkout
      puts "Do submodule things"
    end

    def execute
      if @options[:release]
        print_step 'Deploying a past release'
      else
        pre_checkout
        checkout
        post_checkout
        set_release_name
        if @options[:buildpacks]
          pack
        else
          build
          push
        end
      end
      configure
      apply
      rollout
    end
  end
end
@collimarco
Copy link
Contributor

Maybe a simpler solution would be to update the checkout command to use this:

git clone --recurse-submodules

Note: I haven't tested it and I wonder if that option has any side effects when there aren't any submodules.

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

No branches or pull requests

2 participants