conjur-debify 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9e3361963d306c2c15ab66de60ca17cf6bd5685
4
- data.tar.gz: d16f73386a8bf36bfbf41ce5fbcdff65f7bbe641
3
+ metadata.gz: b09163b1b3fd1d4cbf3e0c9a7960581bac62d3bf
4
+ data.tar.gz: 1542b78f84637ac4abb479d1f4f3bdfbf17e3313
5
5
  SHA512:
6
- metadata.gz: 1a59b7d288d9dd214e6d4e95c06c6fdf5620bb4eda3da1aab92477a5c5c1f6f3b486e41fc88ad02e9d6b88e67d22ab6709e6787c8410cbbdb8a3d99b7307c771
7
- data.tar.gz: 323e2581dea5d8d42fe1ce918c3100778e5f98814ff85687a95ac80962a59d99904b5eb11d59d11a6adfc506c0158fa67a447eebcf73d4fe260575cc28fd0940
6
+ metadata.gz: cff5d82b37638d470e81c87d11a1dd96934a4101b63e4c59c6f6717b5a09134be54723b3aa01eed6207ef48b71ef6e7a24274a29baa25a4605376114a2a56e50
7
+ data.tar.gz: 4f99702117b608961ddb17c3393d6d892fe7738c3839a4a7288d51cab4ecd5bd1a71190ef3a4a781609e513b4a70606ef61549db660560c971ec3a90d4e474e3
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .idea
1
2
  features/reports
2
3
  /.bundle/
3
4
  /.yardoc
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:
@@ -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
+
@@ -1,5 +1,5 @@
1
1
  module Conjur
2
2
  module Debify
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ FROM ruby:2.0
2
+
3
+ RUN curl -kL \
4
+ -o /usr/bin/art \
5
+ https://bintray.com/artifact/download/jfrog/artifactory-cli-go/1.2.1/artifactory-cli-linux-amd64/art && \
6
+ chmod +x /usr/bin/art
7
+
8
+ WORKDIR /src
@@ -0,0 +1,3 @@
1
+ # Example of secrets.yml file needed for debify publish
2
+ ARTIFACTORY_USERNAME: !var artifactory/users/jenkins/username
3
+ ARTIFACTORY_PASSWORD: !var artifactory/users/jenkins/password
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.2.2
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