cyclid-lxd-plugin 0.1.1 → 0.2.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/lib/cyclid/plugins/builder/lxd.rb +3 -2
- data/lib/cyclid/plugins/transport/lxdapi.rb +12 -6
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7aedf3aba54742b5b8bc41a4b0273f9cfe6e5a58
|
|
4
|
+
data.tar.gz: 090f443460169555421d913004bec49ac821ce04
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b31ecd9e7b5f8fd9e0de9e5233923d26ce47d3d3c869351e8a5a50ce401e5fc4f4962e4d737d9b32416aeea02b08c042655919601dc9ca44ccbc801c272f698
|
|
7
|
+
data.tar.gz: 3de1a041fc55f6e7182d107507905737b3060d22bea95cdd66916927bf044a1f1c6393e1455a9f26f964182626a2c433617a8413c5b480141376da6a79b4980b
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
# Copyright 2016 Liqwyd Ltd.
|
|
3
4
|
#
|
|
4
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -109,9 +110,9 @@ module Cyclid
|
|
|
109
110
|
raise 'the LXD API URL must be provided' \
|
|
110
111
|
unless lxd_config.key? :api
|
|
111
112
|
|
|
112
|
-
lxd_config[:client_cert] = File.join(%w
|
|
113
|
+
lxd_config[:client_cert] = File.join(%w[/ etc cyclid lxd_client.crt]) \
|
|
113
114
|
unless lxd_config.key? :client_cert
|
|
114
|
-
lxd_config[:client_key] = File.join(%w
|
|
115
|
+
lxd_config[:client_key] = File.join(%w[/ etc cyclid lxd_client.key]) \
|
|
115
116
|
unless lxd_config.key? :client_key
|
|
116
117
|
|
|
117
118
|
lxd_config[:verify_ssl] = false \
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
# Copyright 2016 Liqwyd Ltd.
|
|
3
4
|
#
|
|
4
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -55,8 +56,11 @@ module Cyclid
|
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
# Execute a command via. the LXD API
|
|
58
|
-
def exec(cmd,
|
|
59
|
-
|
|
59
|
+
def exec(cmd, args = {})
|
|
60
|
+
sudo = args[:sudo] || false
|
|
61
|
+
path = args[:path]
|
|
62
|
+
|
|
63
|
+
command = build_command(cmd, sudo, path)
|
|
60
64
|
Cyclid.logger.debug "command=#{command}"
|
|
61
65
|
|
|
62
66
|
# Ensure some important variables are set, like HOME & TERM
|
|
@@ -145,9 +149,9 @@ module Cyclid
|
|
|
145
149
|
raise 'the LXD API URL must be provided' \
|
|
146
150
|
unless lxd_config.key? :api
|
|
147
151
|
|
|
148
|
-
lxd_config[:client_cert] = File.join(%w
|
|
152
|
+
lxd_config[:client_cert] = File.join(%w[/ etc cyclid lxd_client.crt]) \
|
|
149
153
|
unless lxd_config.key? :client_cert
|
|
150
|
-
lxd_config[:client_key] = File.join(%w
|
|
154
|
+
lxd_config[:client_key] = File.join(%w[/ etc cyclid lxd_client.key]) \
|
|
151
155
|
unless lxd_config.key? :client_key
|
|
152
156
|
|
|
153
157
|
lxd_config[:verify_ssl] = false \
|
|
@@ -156,13 +160,15 @@ module Cyclid
|
|
|
156
160
|
lxd_config
|
|
157
161
|
end
|
|
158
162
|
|
|
159
|
-
def build_command(cmd, path = nil)
|
|
163
|
+
def build_command(cmd, sudo, path = nil)
|
|
160
164
|
command = []
|
|
161
165
|
command << "cd #{path}" if path
|
|
162
166
|
command << if @username == 'root'
|
|
163
167
|
cmd
|
|
168
|
+
elsif sudo
|
|
169
|
+
"sudo -E -n $SHELL -l -c '#{cmd}'"
|
|
164
170
|
else
|
|
165
|
-
|
|
171
|
+
cmd
|
|
166
172
|
end
|
|
167
173
|
"sh -l -c '#{command.join(';')}'"
|
|
168
174
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cyclid-lxd-plugin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kristian Van Der Vliet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hyperkit
|
|
@@ -44,15 +44,15 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0.
|
|
47
|
+
version: '0.4'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0.
|
|
55
|
-
description: Creates LXD container
|
|
54
|
+
version: '0.4'
|
|
55
|
+
description: Creates LXD container based build hosts
|
|
56
56
|
email: contact@cyclid.io
|
|
57
57
|
executables: []
|
|
58
58
|
extensions: []
|