hashipack 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/devcontainer.json +34 -0
- data/Gemfile.lock +5 -3
- data/README.md +11 -2
- data/lib/hashipack/client.rb +2 -5
- data/lib/hashipack/message.rb +2 -0
- data/lib/hashipack/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bad7a4163d44985247790a4318629ceef091c75741cb92dd222d9cc34841ea45
|
4
|
+
data.tar.gz: 612a8f92ff96680ec3e92c48ef1e9c5183203811191d8367f146533db2c52f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d89c910f7daac9f11748ecd0fd6d8e8dc847a84806059373371e37aa5ca1e0f1eba9a334904bd0f44b483f18494758e3ec2bd980c86e2e5d3b74d23ae06e422
|
7
|
+
data.tar.gz: 2b947c3a9fe0508320f3bc6c64ab571d9b2f1df9ceeef1fd982460927c439912b787ea92d84ca2160175fdb9c256386fb537a2e342e008825062da22114a9e7c
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
2
|
+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
3
|
+
{
|
4
|
+
"name": "Ruby",
|
5
|
+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
6
|
+
"image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye",
|
7
|
+
|
8
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
9
|
+
// "features": {},
|
10
|
+
|
11
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
12
|
+
// "forwardPorts": [],
|
13
|
+
|
14
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
15
|
+
// "postCreateCommand": "ruby --version",
|
16
|
+
|
17
|
+
// Configure tool-specific properties.
|
18
|
+
"customizations": {
|
19
|
+
"vscode": {
|
20
|
+
"extensions": [
|
21
|
+
"shardulm94.trailing-spaces"
|
22
|
+
],
|
23
|
+
"settings": {
|
24
|
+
"rubyLsp.rubyVersionManager": {
|
25
|
+
"identifier": "none"
|
26
|
+
},
|
27
|
+
"editor.formatOnSaveMode": "file"
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
33
|
+
// "remoteUser": "root"
|
34
|
+
}
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hashipack (0.1.
|
4
|
+
hashipack (0.1.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -20,7 +20,8 @@ GEM
|
|
20
20
|
rainbow (3.1.1)
|
21
21
|
rake (13.0.6)
|
22
22
|
regexp_parser (2.8.2)
|
23
|
-
rexml (3.
|
23
|
+
rexml (3.3.3)
|
24
|
+
strscan
|
24
25
|
rspec (3.12.0)
|
25
26
|
rspec-core (~> 3.12.0)
|
26
27
|
rspec-expectations (~> 3.12.0)
|
@@ -64,6 +65,7 @@ GEM
|
|
64
65
|
standard-performance (1.2.1)
|
65
66
|
lint_roller (~> 1.1)
|
66
67
|
rubocop-performance (~> 1.19.1)
|
68
|
+
strscan (3.1.0)
|
67
69
|
unicode-display_width (2.5.0)
|
68
70
|
|
69
71
|
PLATFORMS
|
@@ -76,4 +78,4 @@ DEPENDENCIES
|
|
76
78
|
standard (~> 1.3)
|
77
79
|
|
78
80
|
BUNDLED WITH
|
79
|
-
2.
|
81
|
+
2.5.11
|
data/README.md
CHANGED
@@ -35,13 +35,22 @@ Create a client:
|
|
35
35
|
client = Hashipack::Client.new
|
36
36
|
```
|
37
37
|
|
38
|
-
Build an image by providing the template:
|
38
|
+
Build an image by providing the filename of the template:
|
39
39
|
|
40
40
|
```ruby
|
41
|
-
template =
|
41
|
+
template = 'myimage.pkr.hcl'
|
42
42
|
result = client.build(template)
|
43
43
|
```
|
44
44
|
|
45
|
+
If the template and the assets are in a different folder:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
Dir.chdir('./app/templates') do
|
49
|
+
template = 'myimage.pkr.hcl'
|
50
|
+
result = client.build(template)
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
45
54
|
Subscribe to log messages and print them as they arrive:
|
46
55
|
|
47
56
|
```ruby
|
data/lib/hashipack/client.rb
CHANGED
@@ -2,11 +2,8 @@ require 'tempfile'
|
|
2
2
|
|
3
3
|
module Hashipack
|
4
4
|
class Client
|
5
|
-
def build(
|
6
|
-
|
7
|
-
template.write(content)
|
8
|
-
template.close
|
9
|
-
command = "packer -machine-readable build #{template.path}"
|
5
|
+
def build(filename, on_output: lambda {}, on_progress: lambda {}, estimated_duration: 300)
|
6
|
+
command = "packer -machine-readable build #{filename}"
|
10
7
|
|
11
8
|
initial_timestamp = 99999999999
|
12
9
|
last_timestamp = 0
|
data/lib/hashipack/message.rb
CHANGED
data/lib/hashipack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashipack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas_Skywalker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: None.
|
14
14
|
email:
|
@@ -17,6 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".devcontainer/devcontainer.json"
|
20
21
|
- ".rspec"
|
21
22
|
- ".standard.yml"
|
22
23
|
- CHANGELOG.md
|
@@ -52,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
53
|
- !ruby/object:Gem::Version
|
53
54
|
version: '0'
|
54
55
|
requirements: []
|
55
|
-
rubygems_version: 3.
|
56
|
+
rubygems_version: 3.5.11
|
56
57
|
signing_key:
|
57
58
|
specification_version: 4
|
58
59
|
summary: Ruby client for Hashicorps Packer
|