conjur-debify 0.2.2 → 0.3.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/.gitignore +1 -0
- data/README.md +49 -0
- data/lib/conjur/debify.rb +60 -0
- data/lib/conjur/debify/version.rb +1 -1
- data/lib/conjur/publish/Dockerfile +8 -0
- data/secrets.yml +3 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b09163b1b3fd1d4cbf3e0c9a7960581bac62d3bf
|
4
|
+
data.tar.gz: 1542b78f84637ac4abb479d1f4f3bdfbf17e3313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cff5d82b37638d470e81c87d11a1dd96934a4101b63e4c59c6f6717b5a09134be54723b3aa01eed6207ef48b71ef6e7a24274a29baa25a4605376114a2a56e50
|
7
|
+
data.tar.gz: 4f99702117b608961ddb17c3393d6d892fe7738c3839a4a7288d51cab4ecd5bd1a71190ef3a4a781609e513b4a70606ef61549db660560c971ec3a90d4e474e3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -83,6 +83,55 @@ COMMAND OPTIONS
|
|
83
83
|
$ debify test -i conjur-appliance-cuke-master --image-tag 4.6-dev --no-pull -d example example test.sh
|
84
84
|
```
|
85
85
|
|
86
|
+
## Publish a package
|
87
|
+
|
88
|
+
```
|
89
|
+
$ debify help publish
|
90
|
+
NAME
|
91
|
+
publish - Publish a debian package to apt repository
|
92
|
+
|
93
|
+
SYNOPSIS
|
94
|
+
debify [global options] publish [command options] package
|
95
|
+
|
96
|
+
DESCRIPTION
|
97
|
+
Publishes a deb created with `debify package` to our private apt
|
98
|
+
repository.
|
99
|
+
|
100
|
+
You can use wildcards to select packages to publish, e.g., debify
|
101
|
+
publish *.deb.
|
102
|
+
|
103
|
+
--distribution should match the major/minor version of the Conjur
|
104
|
+
appliance you want to install to.
|
105
|
+
|
106
|
+
--component should be 'stable' if run after package tests pass or
|
107
|
+
'testing' if the package is not yet ready for release.
|
108
|
+
|
109
|
+
ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD must be available
|
110
|
+
in the environment for upload to succeed.
|
111
|
+
|
112
|
+
COMMAND OPTIONS
|
113
|
+
-c, --component=arg - Maturity stage of the package, 'testing'
|
114
|
+
or 'stable' (default: testing)
|
115
|
+
-d, --distribution=arg - Lock packages to a Conjur appliance
|
116
|
+
version (default: 4.6)
|
117
|
+
```
|
118
|
+
|
119
|
+
### Example usage
|
120
|
+
|
121
|
+
Assuming a `secrets.yml` like this exists in the source directory:
|
122
|
+
|
123
|
+
```yaml
|
124
|
+
ARTIFACTORY_USERNAME: !var artifactory/users/jenkins/username
|
125
|
+
ARTIFACTORY_PASSWORD: !var artifactory/users/jenkins/password
|
126
|
+
```
|
127
|
+
|
128
|
+
```sh-session
|
129
|
+
$ summon debify publish -c stable conjur-example_0.0.1_amd64.deb
|
130
|
+
[Thread 0] Uploading artifact: https://conjurinc.artifactoryonline.com/conjurinc/debian-local/test.deb;deb.distribution=4.6;deb.component=stable;deb.architecture=amd64
|
131
|
+
[Thread 0] Artifactory response: 201 Created
|
132
|
+
Uploaded 1 artifacts to Artifactory.
|
133
|
+
```
|
134
|
+
|
86
135
|
## Installation
|
87
136
|
|
88
137
|
Add this line to your application's Gemfile:
|
data/lib/conjur/debify.rb
CHANGED
@@ -303,6 +303,65 @@ command "test" do |c|
|
|
303
303
|
end
|
304
304
|
end
|
305
305
|
end
|
306
|
+
|
307
|
+
desc "Publish a debian package to apt repository"
|
308
|
+
long_desc <<DESC
|
309
|
+
Publishes a deb created with `debify package` to our private apt repository.
|
310
|
+
|
311
|
+
You can use wildcards to select packages to publish, e.g., debify publish *.deb.
|
312
|
+
|
313
|
+
--distribution should match the major/minor version of the Conjur appliance you want to install to.
|
314
|
+
|
315
|
+
--component should be 'stable' if run after package tests pass or 'testing' if the package is not yet ready for release.
|
316
|
+
|
317
|
+
ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD must be available in the environment for upload to succeed.
|
318
|
+
DESC
|
319
|
+
arg_name "package"
|
320
|
+
command "publish" do |c|
|
321
|
+
c.desc "Lock packages to a Conjur appliance version"
|
322
|
+
c.default_value "4.6"
|
323
|
+
c.flag [ :d, :distribution ]
|
324
|
+
|
325
|
+
c.desc "Maturity stage of the package, 'testing' or 'stable'"
|
326
|
+
c.default_value "testing"
|
327
|
+
c.flag [ :c, :component ]
|
328
|
+
|
329
|
+
c.action do |global_options,cmd_options,args|
|
330
|
+
raise "package is required" unless package = args.shift
|
331
|
+
|
332
|
+
distribution = cmd_options[:distribution]
|
333
|
+
component = cmd_options[:component]
|
334
|
+
dir = '.'
|
335
|
+
dir = File.expand_path(dir)
|
336
|
+
|
337
|
+
publish_image = Docker::Image.build_from_dir File.expand_path('publish', File.dirname(__FILE__)), tag: "debify-publish", &DebugMixin::DOCKER
|
338
|
+
DebugMixin.debug_write "Built base publish image '#{publish_image.id}'\n"
|
339
|
+
|
340
|
+
options = {
|
341
|
+
'Image' => publish_image.id,
|
342
|
+
'Cmd' => [
|
343
|
+
"art", "upload",
|
344
|
+
"--url", "https://conjurinc.artifactoryonline.com/conjurinc",
|
345
|
+
"--user", ENV['ARTIFACTORY_USERNAME'],
|
346
|
+
"--password", ENV['ARTIFACTORY_PASSWORD'],
|
347
|
+
"--deb", "#{distribution}/#{component}/amd64",
|
348
|
+
package, "debian-local/"
|
349
|
+
],
|
350
|
+
'Binds' => [
|
351
|
+
[ dir, "/src" ].join(':')
|
352
|
+
]
|
353
|
+
}
|
354
|
+
|
355
|
+
container = Docker::Container.create(options)
|
356
|
+
begin
|
357
|
+
container.tap(&:start).streaming_logs(follow: true, stdout: true, stderr: true) { |stream, chunk| puts "#{chunk}" }
|
358
|
+
status = container.wait
|
359
|
+
raise "Failed to publish #{package}" unless status['StatusCode'] == 0
|
360
|
+
ensure
|
361
|
+
container.delete(force: true)
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
306
365
|
|
307
366
|
pre do |global,command,options,args|
|
308
367
|
# Pre logic here
|
@@ -324,3 +383,4 @@ on_error do |exception|
|
|
324
383
|
# return false to skip default error handling
|
325
384
|
true
|
326
385
|
end
|
386
|
+
|
data/secrets.yml
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-debify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
@@ -125,6 +125,8 @@ files:
|
|
125
125
|
- lib/conjur/fpm/Dockerfile
|
126
126
|
- lib/conjur/fpm/debify_utils.sh
|
127
127
|
- lib/conjur/fpm/package.sh
|
128
|
+
- lib/conjur/publish/Dockerfile
|
129
|
+
- secrets.yml
|
128
130
|
homepage: https://github.com/conjurinc/debify
|
129
131
|
licenses:
|
130
132
|
- MIT
|