diff --git a/README.md b/README.md index ed6afca2..acb430bf 100644 --- a/README.md +++ b/README.md @@ -912,10 +912,9 @@ You can change their location by setting `hooks_path` in the configuration file. If the script returns a non-zero exit code the command will be aborted. -There are currently two hooks: +There is currently one hook: - pre-build -- post-push ## Stage of development diff --git a/lib/mrsk/cli/build.rb b/lib/mrsk/cli/build.rb index f060cd10..9628c757 100644 --- a/lib/mrsk/cli/build.rb +++ b/lib/mrsk/cli/build.rb @@ -32,8 +32,6 @@ class Mrsk::Cli::Build < Mrsk::Cli::Base end end end - - run_hook "post-push" end end diff --git a/lib/mrsk/cli/templates/sample_hooks/post-push.sample b/lib/mrsk/cli/templates/sample_hooks/post-push.sample deleted file mode 100755 index a5ca5d27..00000000 --- a/lib/mrsk/cli/templates/sample_hooks/post-push.sample +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# A sample post-push hook -# -# Checks: -# 1. We have a clean checkout -# -# These environment variables are available: -# MRSK_RECORDED_AT -# MRSK_PERFORMER -# MRSK_VERSION -# MRSK_DESTINATION (if set) - -if [ -n "$(git status --porcelain)" ]; then - echo "Git checkout is not clean, aborting..." - git status --porcelain >&2 - exit 1 -fi - -exit 0 diff --git a/test/cli/build_test.rb b/test/cli/build_test.rb index 8d70df2d..ccf8e370 100644 --- a/test/cli/build_test.rb +++ b/test/cli/build_test.rb @@ -49,14 +49,6 @@ class CliBuildTest < CliTestCase assert @executions.none? { |args| args[0..2] == [:docker, :buildx, :build] } end - test "push post-push hook failure" do - fail_hook("post-push") - - assert_raises(Mrsk::Cli::HookError) { run_command("push") } - - assert @executions.any? { |args| args[0..2] == [:docker, :buildx, :build] } - end - test "pull" do run_command("pull").tap do |output| assert_match /docker image rm --force dhh\/app:999/, output diff --git a/test/integration/docker/deployer/app/.mrsk/hooks/post-push b/test/integration/docker/deployer/app/.mrsk/hooks/post-push deleted file mode 100755 index d9f037da..00000000 --- a/test/integration/docker/deployer/app/.mrsk/hooks/post-push +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -echo "Built and pushed!" -mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/post-push diff --git a/test/integration/integration_test.rb b/test/integration/integration_test.rb index fb08af7c..bbaab9bc 100644 --- a/test/integration/integration_test.rb +++ b/test/integration/integration_test.rb @@ -84,7 +84,7 @@ class IntegrationTest < ActiveSupport::TestCase end def assert_hooks_ran - [ "pre-build", "post-push" ].each do |hook| + [ "pre-build" ].each do |hook| file = "/tmp/#{ENV["TEST_ID"]}/#{hook}" assert_match /File: #{file}/, deployer_exec("stat #{file}", capture: true) end