pleaserun 0.0.14 → 0.0.15
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/please-manage-user +48 -0
- data/lib/pleaserun/namespace.rb +4 -3
- data/lib/pleaserun/user/base.rb +2 -0
- data/pleaserun.gemspec +3 -2
- data/templates/user/linux/default/installer.sh +2 -0
- data/templates/user/linux/default/remover.sh +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c29e0d279d9fef769d2e5f2a9fe7eedecf49c040
|
4
|
+
data.tar.gz: 9ae82dbc342d7420006fbc5b4b3dd20dea878058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff95f6b8fe980982108526a02b2d9137a94838bc368841814a1a05db03fbdd8ab81108e35c570d7d709d3ae26ad69c03b2b728b4ccd040dd1301059f85dfa32a
|
7
|
+
data.tar.gz: 208c373ec9d7bda71130c93734668cb2ec70b4787ec3e2d5205885d1d8b2da8c91931424f45e7a03bcdc691f23d1514c51554772edb6b1446f5ba6e010f8815c
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
libdir = File.expand_path("../lib", File.dirname(__FILE__))
|
4
|
+
$LOAD_PATH << libdir if File.exist?(File.join(libdir, "pleaserun", "user", "base.rb"))
|
5
|
+
|
6
|
+
require "pleaserun/user/base"
|
7
|
+
require "fileutils"
|
8
|
+
require "clamp"
|
9
|
+
|
10
|
+
# A PoC to do user management scripting
|
11
|
+
#
|
12
|
+
# This is targeted at fpm's `--after-install` and friends, but it is certainly
|
13
|
+
# not limited to that.
|
14
|
+
class PleaseRun::ManageUserCLI < Clamp::Command
|
15
|
+
class ConfigurationError < StandardError; end
|
16
|
+
option "--platform", "PLATFORM", "The platform to target ('linux', etc)", :default => "linux"
|
17
|
+
option "--version", "VERSION", "The version of the platform to target"
|
18
|
+
option "--output", "PATH", "The destination directory to write the management scripts", :required => true
|
19
|
+
|
20
|
+
parameter "USERNAME", "The username to manage"
|
21
|
+
|
22
|
+
def execute
|
23
|
+
validate
|
24
|
+
File.write(File.join(output, "installer.sh"), user.render_installer)
|
25
|
+
File.write(File.join(output, "remover.sh"), user.render_remover)
|
26
|
+
end
|
27
|
+
|
28
|
+
def user
|
29
|
+
return @user if @user
|
30
|
+
@user = PleaseRun::User::Base.new
|
31
|
+
@user.name = username
|
32
|
+
@user.platform = platform
|
33
|
+
@user.version = version
|
34
|
+
return @user
|
35
|
+
end
|
36
|
+
|
37
|
+
def validate
|
38
|
+
if File.exist?(output)
|
39
|
+
if !File.directory?(output)
|
40
|
+
raise ConfigurationError, "The output path exists but is not a directory. I cannot continue. Path is #{output}"
|
41
|
+
end
|
42
|
+
else
|
43
|
+
FileUtils.mkdir_p(output)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
PleaseRun::ManageUserCLI.run
|
data/lib/pleaserun/namespace.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
PleaseRun
|
2
|
-
|
3
|
-
|
1
|
+
module PleaseRun
|
2
|
+
module Platform; end
|
3
|
+
module User; end
|
4
|
+
end
|
data/lib/pleaserun/user/base.rb
CHANGED
data/pleaserun.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |spec|
|
|
2
2
|
files = File.read(__FILE__)[/^__END__$.*/m].split("\n")[1..-1]
|
3
3
|
|
4
4
|
spec.name = "pleaserun"
|
5
|
-
spec.version = "0.0.
|
5
|
+
spec.version = "0.0.15"
|
6
6
|
spec.summary = "pleaserun"
|
7
7
|
spec.description = "pleaserun"
|
8
8
|
spec.license = "Apache 2.0"
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.homepage = "https://github.com/jordansissel/pleaserun"
|
25
25
|
end
|
26
26
|
|
27
|
-
# Files list, populate it with
|
27
|
+
# Files list, populate it with this: :.,$!git ls-files | grep -v gitignore
|
28
28
|
__END__
|
29
29
|
.rubocop.yml
|
30
30
|
CHANGELOG.asciidoc
|
@@ -34,6 +34,7 @@ Guardfile
|
|
34
34
|
LICENSE
|
35
35
|
Makefile
|
36
36
|
README.md
|
37
|
+
bin/please-manage-user
|
37
38
|
bin/pleaserun
|
38
39
|
examples/runit.rb
|
39
40
|
lib/pleaserun/cli.rb
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pleaserun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Sissel
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- LICENSE
|
97
97
|
- Makefile
|
98
98
|
- README.md
|
99
|
+
- bin/please-manage-user
|
99
100
|
- bin/pleaserun
|
100
101
|
- examples/runit.rb
|
101
102
|
- lib/pleaserun/cli.rb
|