gocd_pre_push 0.1 → 1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/gocd_pre_push +12 -4
- data/lib/gocd_pre_push/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 118b9de888a0e3734b6b3d56ff173d26fee6c366
|
|
4
|
+
data.tar.gz: 734664b906d5ef9bb70ee872385a530f722424db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0639c4eea984b17e8292ed2ffa1b483f9cde2a89f784dcfac225d920df51c2239ae957bd5ea9867d7e3c26663bb340b0fc2c27b772ef435e1c17cb9698d906cc
|
|
7
|
+
data.tar.gz: 333fca15a0a30118c234c89f814e4547350b19f5fdb599437519531524b4181a6ea8e257753a93d3c361d281487565b7efe135f0d9d48956fa6577a89b8829b6
|
data/bin/gocd_pre_push
CHANGED
|
@@ -7,6 +7,12 @@ require_relative '../lib/gocd_pre_push/pretty_printer.rb'
|
|
|
7
7
|
|
|
8
8
|
include GOCD_PRE_PUSH::PrettyPrinter
|
|
9
9
|
|
|
10
|
+
def create_symlink
|
|
11
|
+
print_info "Creating symlink ./.git/hooks => hooks"
|
|
12
|
+
print_info "Your old hooks will be saved inside ./.git/hooks.old\n"
|
|
13
|
+
symlink_git_hooks
|
|
14
|
+
end
|
|
15
|
+
|
|
10
16
|
def execute
|
|
11
17
|
if ARGV[0] == 'create'
|
|
12
18
|
print_info "Creating pre-push hook.."
|
|
@@ -16,14 +22,16 @@ def execute
|
|
|
16
22
|
print_info "Adding executable permission to pre-push hook.."
|
|
17
23
|
`sudo chmod 777 hooks/pre-push`
|
|
18
24
|
print_success "Please update the pre-push hook with your gocd server url, username and password\n"
|
|
19
|
-
|
|
20
|
-
print_info "Your old hooks will be saved inside ./.git/hooks.old\n"
|
|
21
|
-
symlink_git_hooks
|
|
25
|
+
create_symlink
|
|
22
26
|
|
|
23
27
|
print_success "Adding pipelines.yml, change the pipelines as per your requirement!\n"
|
|
24
28
|
File.write('pipelines.yml', pipelines)
|
|
29
|
+
elsif ARGV[0] == 'use_hooks'
|
|
30
|
+
create_symlink
|
|
25
31
|
else
|
|
26
|
-
print_info "Right usage is:
|
|
32
|
+
print_info "Right usage is:"
|
|
33
|
+
print_info "gocd_pre_push create => For first time setup"
|
|
34
|
+
print_info "gocd_pre_push use_hooks => To use the already created hooks\n"
|
|
27
35
|
end
|
|
28
36
|
end
|
|
29
37
|
|