conjur-debify 3.0.0.pre.1043 → 3.0.0.pre.1118

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. metadata +5 -78
  4. data/.dockerignore +0 -1
  5. data/.gitignore +0 -22
  6. data/.project +0 -18
  7. data/.rvmrc +0 -60
  8. data/CHANGELOG.md +0 -246
  9. data/CONTRIBUTING.md +0 -16
  10. data/Dockerfile +0 -33
  11. data/Gemfile +0 -2
  12. data/Jenkinsfile +0 -116
  13. data/LICENSE.txt +0 -22
  14. data/README.md +0 -303
  15. data/Rakefile +0 -75
  16. data/bin/debify +0 -5
  17. data/build.sh +0 -8
  18. data/ci/test.sh +0 -8
  19. data/debify.gemspec +0 -36
  20. data/distrib/conjur_creds.rb +0 -7
  21. data/distrib/docker-debify +0 -50
  22. data/distrib/entrypoint.sh +0 -19
  23. data/distrib/script +0 -1
  24. data/distrib/secrets +0 -1
  25. data/distrib/secrets.yml +0 -2
  26. data/example/Gemfile +0 -9
  27. data/example/Gemfile.lock +0 -32
  28. data/example/debify.sh +0 -3
  29. data/example/distrib/postinstall.sh +0 -8
  30. data/example/docker-compose.yml +0 -11
  31. data/example/net-test.sh +0 -7
  32. data/example/test.sh +0 -4
  33. data/features/detect_version.feature +0 -12
  34. data/features/package.feature +0 -23
  35. data/features/sandbox.feature +0 -23
  36. data/features/step_definitions/debify_steps.rb +0 -29
  37. data/features/support/env.rb +0 -12
  38. data/features/support/hooks.rb +0 -29
  39. data/features/support/world.rb +0 -10
  40. data/features/test.feature +0 -24
  41. data/image-tags +0 -23
  42. data/lib/conjur/debify/Dockerfile.fpm +0 -13
  43. data/lib/conjur/debify/action/publish.rb +0 -136
  44. data/lib/conjur/debify/utils.rb +0 -16
  45. data/lib/conjur/debify/version.rb +0 -5
  46. data/lib/conjur/debify.rb +0 -850
  47. data/lib/conjur/fpm/Dockerfile +0 -26
  48. data/lib/conjur/fpm/debify_utils.sh +0 -32
  49. data/lib/conjur/fpm/package.sh +0 -107
  50. data/lib/conjur/publish/Dockerfile +0 -5
  51. data/publish-rubygem.sh +0 -10
  52. data/push-image.sh +0 -6
  53. data/secrets.yml +0 -3
  54. data/spec/action/publish_spec.rb +0 -54
  55. data/spec/data/Makefile +0 -5
  56. data/spec/data/test.tar +0 -0
  57. data/spec/debify_utils_spec.rb +0 -55
  58. data/spec/spec_helper.rb +0 -1
  59. data/spec/utils_spec.rb +0 -22
  60. data/tag-image.sh +0 -6
  61. data/test.sh +0 -6
@@ -1,26 +0,0 @@
1
- # Build from the same version of ubuntu as phusion/baseimage
2
- FROM cyberark/phusion-ruby-fips:latest
3
-
4
- RUN apt-get update -y && \
5
- apt-get dist-upgrade -y && \
6
- apt-get install -y build-essential \
7
- git \
8
- libffi-dev \
9
- rpm
10
-
11
- RUN gem install --no-document fpm
12
-
13
- ENV GEM_HOME /usr/local/bundle
14
- ENV BUNDLE_PATH="$GEM_HOME" \
15
- BUNDLE_BIN="$GEM_HOME/bin" \
16
- BUNDLE_SILENCE_ROOT_WARNING=1
17
- ENV PATH $BUNDLE_BIN:$PATH
18
- RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" && \
19
- chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
20
-
21
- RUN mkdir /src
22
-
23
- ENTRYPOINT [ "/package.sh" ]
24
-
25
- COPY debify_utils.sh /
26
- COPY package.sh /
@@ -1,32 +0,0 @@
1
- function bundle_clean() {
2
- ruby_version="$(ruby -v | grep -o '[0-9]\.[0-9]\.[0-9]')"
3
-
4
- if [ -d vendor/bundle ]; then
5
- chmod og+r -R vendor/bundle # some gems have broken perms
6
-
7
- # some cleanup
8
- rm -rf vendor/bundle/ruby/${ruby_version}/cache
9
- rm -rf vendor/bundle/ruby/${ruby_version}/gems/*/{test,spec,examples,example,contrib,doc,ext,sample}
10
- fi
11
- }
12
-
13
- # Remove files from the current directory that also exist in another given
14
- # directory. For example, say in the current directory there is:
15
- # foo
16
- # bar/baz
17
- # bar/xyzzy
18
- # bacon
19
- # people/phlebas
20
- # and in dir2 there is
21
- # bacon
22
- # alice
23
- # people/phlebas
24
- # bar/xyzzy
25
- # then after running `remove_matching dir2` current directory will be left with only:
26
- # foo
27
- # bar/baz
28
- # Note it probably isn't 100% fool-proof, so don't launch it out to space or something.
29
- function remove_matching() {
30
- find "$1" -type f -print0 | sed -ze "s@^$1@.@" | xargs -0 rm -f
31
- find . -type d -empty -delete
32
- }
@@ -1,107 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- source /debify_utils.sh
4
-
5
- project_name=$1
6
- shift
7
- version=$1
8
- shift
9
-
10
- if [ -z "$project_name" ]; then
11
- echo Project name argument is required
12
- exit 1
13
- fi
14
- if [ -z "$version" ]; then
15
- echo Version argument is required
16
- exit 1
17
- fi
18
-
19
- for i in "$@"; do
20
- case $i in
21
- -ft=* | --file-type=*)
22
- file_type="${i#*=}"
23
- shift
24
- ;;
25
- esac
26
- done
27
-
28
- if [ -z "$file_type" ]; then
29
- echo "No file type given. Using deb"
30
- file_type=deb
31
- fi
32
-
33
- echo Project Name is $project_name
34
- echo Version is $version
35
- echo file_type is $file_type
36
- echo params at the end are $@
37
-
38
- # Build dev package first
39
- prefix=/src/opt/conjur/project
40
- cd $prefix
41
- bundle config set --local deployment 'true' && \
42
- bundle config set --local path 'vendor/bundle' && \
43
- bundle
44
- cp -al $prefix /dev-pkg
45
- bundle config set --local without 'development test'
46
- bundle clean
47
- cd /dev-pkg
48
- remove_matching $prefix
49
- bundle_clean
50
-
51
- if [ $(ls | wc -l) -eq 0 ]; then
52
- echo No dev dependencies, skipping dev package
53
- else
54
- echo "Building conjur-$project_name-dev $file_type package"
55
-
56
- fpm \
57
- -s dir \
58
- -t $file_type \
59
- -n conjur-$project_name-dev \
60
- -v $version \
61
- -C . \
62
- --maintainer "CyberArk Software, Inc." \
63
- --vendor "CyberArk Software, Inc." \
64
- --license "Proprietary" \
65
- --url "https://www.cyberark.com" \
66
- --deb-no-default-config-files \
67
- --$file_type-user conjur \
68
- --$file_type-group conjur \
69
- --depends "conjur-$project_name = $version" \
70
- --prefix /opt/conjur/$project_name \
71
- --description "Conjur $project_name service - development files"
72
- fi
73
-
74
- mv /src/opt/conjur/project /src/opt/conjur/$project_name
75
-
76
- cd /src/opt/conjur/$project_name
77
-
78
- bundle_clean
79
-
80
- cd /src
81
-
82
- mkdir -p opt/conjur/etc
83
-
84
- /debify.sh
85
-
86
- [ -d opt/conjur/"$project_name"/distrib ] && mv opt/conjur/"$project_name"/distrib /
87
-
88
- echo "Building conjur-$project_name $file_type package"
89
-
90
- fpm \
91
- -s dir \
92
- -t $file_type \
93
- -n conjur-$project_name \
94
- -v $version \
95
- -C . \
96
- --maintainer "CyberArk Software, Inc." \
97
- --vendor "CyberArk Software, Inc." \
98
- --license "Proprietary" \
99
- --url "https://www.cyberark.com" \
100
- --config-files opt/conjur/etc \
101
- --deb-no-default-config-files \
102
- --$file_type-user conjur \
103
- --$file_type-group conjur \
104
- --description "Conjur $project_name service" \
105
- "$@"
106
-
107
- ls -l
@@ -1,5 +0,0 @@
1
- FROM releases-docker.jfrog.io/jfrog/jfrog-cli:latest
2
-
3
- ENV JFROG_CLI_OFFER_CONFIG=false
4
-
5
- WORKDIR /src
data/publish-rubygem.sh DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd \
5
- -e VERSION \
6
- -e bom-assets/ \
7
- -e release-assets/
8
-
9
- summon --yaml "RUBYGEMS_API_KEY: !var rubygems/api-key" \
10
- publish-rubygem debify
data/push-image.sh DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- for t in $(./image-tags); do
4
- docker push registry.tld/conjurinc/debify:$t
5
- done
6
-
data/secrets.yml DELETED
@@ -1,3 +0,0 @@
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
@@ -1,54 +0,0 @@
1
- require 'spec_helper'
2
- require 'conjur/debify/action/publish'
3
-
4
- describe Conjur::Debify::Action::Publish do
5
-
6
- let (:cmd_options) {
7
- {
8
- :version => '1.0.0',
9
- :component => 'stable'
10
- }
11
- }
12
-
13
- let (:action) { Conjur::Debify::Action::Publish.new('dist', 'proj', cmd_options) }
14
-
15
- before do
16
- allow(DebugMixin).to receive(:debug_write)
17
-
18
- allow(action).to receive(:create_image).and_return(double('publish_image', :id => 'a1b2c3d4'))
19
- end
20
-
21
- context 'with artifactory creds in the environment' do
22
-
23
- before do
24
- ENV['ARTIFACTORY_USER'] = 'art_user'
25
- ENV['ARTIFACTORY_PASSWORD'] = 'art_password'
26
- end
27
-
28
- after do
29
- ENV.delete('ARTIFACTORY_USER')
30
- ENV.delete('ARTIFACTORY_PASSWORD')
31
- end
32
-
33
- it 'runs' do
34
- expect(action).to receive(:publish).twice
35
-
36
- action.run
37
- end
38
-
39
- end
40
-
41
- context 'without artifactory creds in the environment' do
42
-
43
- it 'runs' do
44
- expect(action).to receive(:fetch_art_creds)
45
- expect(action).to receive(:publish).twice
46
-
47
- action.run
48
- end
49
- end
50
-
51
- end
52
-
53
-
54
-
data/spec/data/Makefile DELETED
@@ -1,5 +0,0 @@
1
- test.tar:
2
- echo "this is a test" > test.txt
3
- tar cf test.tar test.txt
4
- rm test.txt
5
-
data/spec/data/test.tar DELETED
Binary file
@@ -1,55 +0,0 @@
1
- require 'spec_helper'
2
- require 'aruba/rspec'
3
-
4
- Aruba.configure do |c|
5
- c.activate_announcer_on_command_failure = %i(stderr stdout)
6
- end
7
-
8
- describe "remove_matching()", type: :aruba do
9
- it "removes matching files" do
10
- here %w(foo bar/baz bar/xyzzy zork)
11
- there %w(foo bar/baz not)
12
- remove_matching
13
- expect(contents_of herepath).to match_array %w(zork bar bar/xyzzy)
14
- end
15
-
16
- it "also handles files with spaces in names" do
17
- here ['foo', 'bar/baz', 'with space', 'with', 'bar/another space']
18
- there ['with space', 'bar/another space here']
19
- remove_matching
20
- expect(contents_of herepath).to match_array ['foo', 'bar', 'bar/baz', 'with', 'bar/another space']
21
- end
22
-
23
- # auxiliary methods and setup
24
- let(:herepath) { Pathname.new Dir.mktmpdir }
25
- let(:therepath) { Pathname.new Dir.mktmpdir }
26
- after { [herepath, therepath].each &FileUtils.method(:remove_entry) }
27
-
28
- def contents_of dir
29
- Dir.chdir(dir) { Dir['**/*'] }
30
- end
31
-
32
- def remove_matching
33
- run_command_and_stop "bash -c 'source #{DEBIFY_UTILS_PATH}; cd #{herepath}; remove_matching #{therepath}'"
34
- end
35
-
36
- def here files
37
- mkfiles herepath, files
38
- end
39
-
40
- def there files
41
- mkfiles therepath, files
42
- end
43
-
44
- def mkfiles dir, files
45
- return dir if files.empty?
46
- files.each do |path|
47
- fullpath = dir + path
48
- FileUtils.makedirs fullpath.dirname
49
- FileUtils.touch fullpath
50
- end
51
- end
52
-
53
- DEBIFY_UTILS_PATH = File.expand_path '../../lib/conjur/fpm/debify_utils.sh', __FILE__
54
- end
55
-
data/spec/spec_helper.rb DELETED
@@ -1 +0,0 @@
1
- require 'conjur/debify'
data/spec/utils_spec.rb DELETED
@@ -1,22 +0,0 @@
1
- require 'fakefs/safe'
2
-
3
- require 'conjur/debify/utils'
4
-
5
- describe 'Conjur::Debify::Utils.copy_from_container' do
6
- it "copies a file from the container to the current directory" do
7
- tar = File.read "#{__dir__}/data/test.tar"
8
- container = instance_double Docker::Container
9
- allow(container).to receive(:archive_out).with "/tmp/test.tar" do |&b|
10
- StringIO.new(tar).each(nil, 512) do |c|
11
- # docker api sends three arguments, so emulate that
12
- b[c, nil, nil]
13
- end
14
- end
15
-
16
- FakeFS do
17
- Conjur::Debify::Utils.copy_from_container container, "/tmp/test.tar"
18
- expect(File.read 'test.txt').to eq "this is a test\n"
19
- end
20
- end
21
- end
22
-
data/tag-image.sh DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- TAG=$(< VERSION)
4
- for t in $(./image-tags); do
5
- docker tag debify:$TAG registry.tld/conjurinc/debify:$t
6
- done
data/test.sh DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- VERSION=$(< VERSION)
4
- docker run --rm debify:$VERSION config script > docker-debify
5
- chmod +x docker-debify
6
- DEBIFY_IMAGE=debify:$VERSION DEBIFY_ENTRYPOINT=ci/test.sh ./docker-debify