capistrano-apt 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0350fce29435d8e6e4c06c5d40001de3132db6e7085606464cd28e14004facf0
4
+ data.tar.gz: e2048b105982d65871ef3bbbd53d465f68e0f6aa934db6f149299600dfae3735
5
+ SHA512:
6
+ metadata.gz: b42ff593f5acb3c99a3bda4b2e62de70ec6ab6eb65eadd9e962877b73112ae8cb9d5d0f8a3308629d3c3782dee21af1d000dedea6fbd1ae6110723d073e55bf5
7
+ data.tar.gz: 0c0a1f2c69d396930556b2d069f4913950fac6df642c0cc6d06d986a3dde31711bb8d95f2efa0b52eaf1e21fd0ecd88972360cda9138f634569ffeb4bc5ed17c
data/.gitignore ADDED
@@ -0,0 +1,50 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-rvm.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License (MIT)
2
+
3
+ Copyright (c) 2012-2018 Tom Clements, Lee Hambley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # capistrano-apt
2
+ Aptitude utilities for Capistrano
3
+
4
+ ## Tasks
5
+
6
+ ```
7
+ ➤ cap --tasks
8
+ cap apt:autoclean # Clears out the local repository of retrieved package files only removing package files that can no...
9
+ cap apt:check_reboot # Check if a reboot is required
10
+ cap apt:check_upgradable # Check for upgradable packages
11
+ cap apt:distupgrade # In addition to performing the function of upgrade, also intelligently handles changing dependencie...
12
+ cap apt:update # Download package information from all configured sources
13
+ cap apt:upgrade # Install the newest versions of all packages currently installed on the system
14
+ ```
15
+
16
+ ## Sudo without password
17
+
18
+ Add the following to the sudoers file using `sudo visudo` on the server replacing `rails` with the user used to deploy the application.
19
+
20
+ ```
21
+ # Allow rails user to install and upgrade packages without a password
22
+ rails ALL=NOPASSWD: /usr/bin/apt-get autoclean
23
+ rails ALL=NOPASSWD: /usr/bin/apt-get dist-upgrade
24
+ rails ALL=NOPASSWD: /usr/bin/apt-get install
25
+ rails ALL=NOPASSWD: /usr/bin/apt-get update
26
+ rails ALL=NOPASSWD: /usr/bin/apt-get upgrade
27
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,16 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'capistrano-apt'
3
+ s.version = '0.0.1'
4
+ s.date = '2018-10-17'
5
+ s.summary = "Aptitude utilities for Capistrano"
6
+ s.description = "Aptitude utilities for Capistrano"
7
+ s.authors = ["Kevin McCormack"]
8
+ s.email = 'harlemsquirrel@gmail.com'
9
+ s.files = `git ls-files`.split($/)
10
+ s.homepage =
11
+ 'https://github.com/HarlemSquirrel/capistrano-apt'
12
+ s.license = 'MIT'
13
+
14
+ s.add_dependency 'capistrano', '~> 3.0'
15
+ s.add_dependency 'sshkit', '~> 1.2'
16
+ end
File without changes
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/rvm.rake", __FILE__)
@@ -0,0 +1,49 @@
1
+ namespace :apt do
2
+ desc 'Clears out the local repository of retrieved package files only removing package files '\
3
+ 'that can no longer be downloaded'
4
+ task :autoclean do
5
+ on release_roles :app do |role|
6
+ execute :sudo, 'apt-get', 'autoclean'
7
+ end
8
+ end
9
+
10
+ desc 'Check if a reboot is required'
11
+ task :check_reboot do
12
+ on release_roles :app do |role|
13
+ if test('ls /var/run/ | grep reboot-required')
14
+ pkgs = capture(:cat, '/var/run/reboot-required.pkgs').split(/\s/)
15
+ warn "Reboot is required for #{role} to update #{pkgs.join(' ')}"
16
+ end
17
+ end
18
+ end
19
+
20
+ desc 'Check for upgradable packages'
21
+ task :check_upgradable do
22
+ on release_roles :app do |role|
23
+ info 'Upgradable packages:'
24
+ execute :apt, 'list', '-qq', '--upgradable'
25
+ end
26
+ end
27
+
28
+ desc 'In addition to performing the function of upgrade, also intelligently handles changing '\
29
+ 'dependencies with new versions of packages'
30
+ task :distupgrade do
31
+ on release_roles :app do |role|
32
+ execute :sudo, 'apt-get', 'dist-upgrade'
33
+ end
34
+ end
35
+
36
+ desc 'Install the newest versions of all packages currently installed on the system'
37
+ task :upgrade do
38
+ on release_roles :app do |role|
39
+ execute :sudo, 'apt-get', 'upgrade'
40
+ end
41
+ end
42
+
43
+ desc 'Download package information from all configured sources'
44
+ task :update do
45
+ on release_roles :app do |role|
46
+ execute :sudo, 'apt-get', 'update'
47
+ end
48
+ end
49
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-apt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevin McCormack
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sshkit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.2'
41
+ description: Aptitude utilities for Capistrano
42
+ email: harlemsquirrel@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".gitignore"
48
+ - Gemfile
49
+ - LICENSE
50
+ - README.md
51
+ - Rakefile
52
+ - capistrano-apt.gemspec
53
+ - lib/capistrano-apt.rb
54
+ - lib/capistrano/apt.rb
55
+ - lib/capistrano/tasks/apt.rake
56
+ homepage: https://github.com/HarlemSquirrel/capistrano-apt
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.7.6
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: Aptitude utilities for Capistrano
80
+ test_files: []