fossil_scm_capistrano 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/capistrano/scm/fossil.rb +45 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 82e73c499e20c327842eefaacb822096a7309db6b11698a7053e309c6d5afcda
4
+ data.tar.gz: 4f6d8c09b0283b027cc2655b0b28a7a6813687618206598ee8db0ace1eea26ab
5
+ SHA512:
6
+ metadata.gz: 6e818ce6d054c027f68d7db03dc4506b43c6c5b3ec647c5801c05a61d7ff1d78f42f17b64254fc9e88feb1d44ec26e3f3b73c27048d6979f9af9d550c555511b
7
+ data.tar.gz: 85f3186a75c72c001a86b343d59aeb31f40226cbb579914cbac751bc0bf802ae3071ddf1db95147f2b02eca1be83995d319a3455b7da14195b6541ebeb59f396
@@ -0,0 +1,45 @@
1
+ require "capistrano/scm/plugin"
2
+ require "digest/sha1"
3
+
4
+ class Capistrano::SCM::Fossil < Capistrano::SCM::Plugin
5
+
6
+ def set_defaults
7
+ set_if_empty :fossil_branch, "trunk"
8
+ set_if_empty :fossil_tarball_path, lambda {
9
+ suffix = fetch(:application)
10
+ File.join(fetch(:tmp_dir), "fossil-#{suffix}.tar")
11
+ }
12
+ end
13
+
14
+ def define_tasks
15
+
16
+
17
+ namespace :fossil do
18
+
19
+ desc "Extract repository on release"
20
+ task :create_release do
21
+ %x{fossil tarball --name . #{fetch(:fossil_branch)} #{fetch(:fossil_tarball_path)}}
22
+
23
+ on release_roles :all do
24
+ tmp_file = capture("mktemp")
25
+ execute :mkdir, "-p", release_path
26
+ upload!(fetch(:fossil_tarball_path), tmp_file)
27
+ execute :tar, "-xzf", tmp_file, "-C", release_path
28
+ end
29
+ end
30
+
31
+ task :set_current_revision do
32
+ revision = %x{fossil info}[/checkout:([^\n]+)/,1].strip
33
+ on release_roles :all do
34
+ set :current_revision, revision
35
+ end
36
+ end
37
+
38
+ end
39
+ end
40
+
41
+ def register_hooks
42
+ after "deploy:new_release_path", "fossil:create_release"
43
+ after "deploy:set_current_revision", "fossil:set_current_revision"
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fossil_scm_capistrano
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jovany Leandro G.C
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Capistrano 3.x plugin to deploy fossil repositories
14
+ email: bit4bit@riseup.net
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/capistrano/scm/fossil.rb
20
+ homepage: http://chiselapp.com/user/bit4bit/repository/capistrano-scm-fossil
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.7.6
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Capistrano 3.x plugin to deploy fossil repositories
44
+ test_files: []