conjur-debify 0.0.1.pre.47 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -4
  3. data/LICENSE.txt +1 -1
  4. data/README.md +15 -210
  5. data/Rakefile +7 -14
  6. data/debify.gemspec +9 -18
  7. data/example/Gemfile +0 -8
  8. data/example/Gemfile.lock +0 -24
  9. data/example/test.sh +0 -1
  10. data/features/debify.feature +15 -0
  11. data/features/step_definitions/debify_steps.rb +0 -23
  12. data/features/support/env.rb +12 -5
  13. data/jenkins.sh +6 -0
  14. data/lib/conjur/debify/Dockerfile.fpm +4 -0
  15. data/lib/conjur/debify/version.rb +2 -2
  16. data/lib/conjur/debify.rb +154 -681
  17. data/lib/conjur/fpm/Dockerfile +5 -19
  18. data/lib/conjur/fpm/debify_utils.sh +8 -28
  19. data/lib/conjur/fpm/package.sh +23 -79
  20. metadata +36 -152
  21. data/.dockerignore +0 -1
  22. data/.rvmrc +0 -60
  23. data/CHANGELOG.md +0 -246
  24. data/CONTRIBUTING.md +0 -16
  25. data/Dockerfile +0 -33
  26. data/Jenkinsfile +0 -116
  27. data/VERSION +0 -1
  28. data/build.sh +0 -4
  29. data/ci/test.sh +0 -8
  30. data/distrib/conjur_creds.rb +0 -7
  31. data/distrib/docker-debify +0 -50
  32. data/distrib/entrypoint.sh +0 -19
  33. data/distrib/script +0 -1
  34. data/distrib/secrets +0 -1
  35. data/distrib/secrets.yml +0 -2
  36. data/example/docker-compose.yml +0 -11
  37. data/example/net-test.sh +0 -7
  38. data/features/detect_version.feature +0 -7
  39. data/features/package.feature +0 -23
  40. data/features/sandbox.feature +0 -23
  41. data/features/support/hooks.rb +0 -29
  42. data/features/support/world.rb +0 -10
  43. data/features/test.feature +0 -24
  44. data/image-tags +0 -23
  45. data/lib/conjur/debify/action/publish.rb +0 -136
  46. data/lib/conjur/debify/utils.rb +0 -16
  47. data/lib/conjur/publish/Dockerfile +0 -5
  48. data/publish-rubygem.sh +0 -10
  49. data/push-image.sh +0 -6
  50. data/secrets.yml +0 -3
  51. data/spec/action/publish_spec.rb +0 -54
  52. data/spec/data/Makefile +0 -5
  53. data/spec/data/test.tar +0 -0
  54. data/spec/debify_utils_spec.rb +0 -55
  55. data/spec/spec_helper.rb +0 -1
  56. data/spec/utils_spec.rb +0 -22
  57. data/tag-image.sh +0 -6
  58. data/test.sh +0 -6
@@ -1,26 +1,12 @@
1
- # Build from the same version of ubuntu as phusion/baseimage
2
- FROM registry.tld/cyberark/phusion-ruby-fips:0.11-9c1da20
1
+ FROM ruby:2.0
3
2
 
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
3
+ RUN apt-get update -y && apt-get install -y build-essential
10
4
 
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"
5
+ RUN gem install --no-rdoc --no-ri bundler fpm
20
6
 
21
7
  RUN mkdir /src
22
8
 
23
- ENTRYPOINT [ "/package.sh" ]
24
-
25
9
  COPY debify_utils.sh /
26
10
  COPY package.sh /
11
+
12
+ ENTRYPOINT [ "/package.sh" ]
@@ -1,32 +1,12 @@
1
1
  function bundle_clean() {
2
- ruby_version="$(ruby -v | grep -o '[0-9]\.[0-9]\.[0-9]')"
2
+ chmod og+r -R vendor/bundle # some gems have broken perms
3
3
 
4
- if [ -d vendor/bundle ]; then
5
- chmod og+r -R vendor/bundle # some gems have broken perms
4
+ gem install bundler --no-rdoc --no-ri --install-dir ./vendor/bundle/ruby/2.0.0
6
5
 
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
6
+ # some cleanup
7
+ rm -rf vendor/bundle/ruby/2.0.0/cache
8
+ rm -rf vendor/bundle/ruby/2.0.0/gems/*/{test,spec,examples,example,contrib,doc,ext,sample}
9
+
10
+ # Ruby 2.0 is ruby2.0 in ubuntu, fix shebangs
11
+ sed -i -e '1 c #!/usr/bin/env ruby2.0' vendor/bundle/ruby/2.0.0/bin/*
32
12
  }
@@ -1,80 +1,28 @@
1
1
  #!/bin/bash -ex
2
2
 
3
- source /debify_utils.sh
4
-
5
3
  project_name=$1
6
4
  shift
7
5
  version=$1
8
6
  shift
9
7
 
10
8
  if [ -z "$project_name" ]; then
11
- echo Project name argument is required
12
- exit 1
9
+ echo Project name argument is required
10
+ exit 1
13
11
  fi
14
12
  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
13
+ echo Version argument is required
14
+ exit 1
31
15
  fi
32
16
 
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"
17
+ package_name=conjur-"$project_name"_"$version"_amd64.deb
55
18
 
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
19
+ echo Building $package_name
73
20
 
74
21
  mv /src/opt/conjur/project /src/opt/conjur/$project_name
75
22
 
76
23
  cd /src/opt/conjur/$project_name
77
24
 
25
+ source /debify_utils.sh
78
26
  bundle_clean
79
27
 
80
28
  cd /src
@@ -85,23 +33,19 @@ mkdir -p opt/conjur/etc
85
33
 
86
34
  [ -d opt/conjur/"$project_name"/distrib ] && mv opt/conjur/"$project_name"/distrib /
87
35
 
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
36
+ fpm -s dir -t deb -n conjur-$project_name -v $version -C . \
37
+ --maintainer "Conjur Inc." \
38
+ --vendor "Conjur Inc." \
39
+ --license "Proprietary" \
40
+ --url "https://www.conjur.net" \
41
+ --deb-no-default-config-files \
42
+ --config-files opt/conjur/etc \
43
+ --deb-user conjur \
44
+ --deb-group conjur \
45
+ --depends ruby2.0 \
46
+ --description "Conjur $project_name service" \
47
+ "$@"
48
+
49
+ ls -al *.deb
50
+
51
+ cp *.deb /dist/
metadata CHANGED
@@ -1,236 +1,130 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-debify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.47
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - CyberArk Software, Inc.
7
+ - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-03 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: docker-api
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: conjur-cli
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '6'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '6'
55
- - !ruby/object:Gem::Dependency
56
- name: conjur-api
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '5.3'
33
+ version: '0'
62
34
  type: :runtime
63
35
  prerelease: false
64
36
  version_requirements: !ruby/object:Gem::Requirement
65
37
  requirements:
66
- - - "~>"
38
+ - - '>='
67
39
  - !ruby/object:Gem::Version
68
- version: '5.3'
40
+ version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: bundler
71
43
  requirement: !ruby/object:Gem::Requirement
72
44
  requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 2.2.30
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 2.2.30
83
- - !ruby/object:Gem::Dependency
84
- name: fakefs
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
45
+ - - ~>
88
46
  - !ruby/object:Gem::Version
89
- version: '0'
47
+ version: '1.7'
90
48
  type: :development
91
49
  prerelease: false
92
50
  version_requirements: !ruby/object:Gem::Requirement
93
51
  requirements:
94
- - - "~>"
52
+ - - ~>
95
53
  - !ruby/object:Gem::Version
96
- version: '0'
54
+ version: '1.7'
97
55
  - !ruby/object:Gem::Dependency
98
56
  name: rake
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
- - - "~>"
59
+ - - ~>
102
60
  - !ruby/object:Gem::Version
103
- version: '13.0'
61
+ version: '10.0'
104
62
  type: :development
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
108
- - - "~>"
66
+ - - ~>
109
67
  - !ruby/object:Gem::Version
110
- version: '13.0'
68
+ version: '10.0'
111
69
  - !ruby/object:Gem::Dependency
112
70
  name: cucumber
113
71
  requirement: !ruby/object:Gem::Requirement
114
72
  requirements:
115
- - - "~>"
73
+ - - '>='
116
74
  - !ruby/object:Gem::Version
117
- version: '7.1'
75
+ version: '0'
118
76
  type: :development
119
77
  prerelease: false
120
78
  version_requirements: !ruby/object:Gem::Requirement
121
79
  requirements:
122
- - - "~>"
80
+ - - '>='
123
81
  - !ruby/object:Gem::Version
124
- version: '7.1'
82
+ version: '0'
125
83
  - !ruby/object:Gem::Dependency
126
84
  name: aruba
127
85
  requirement: !ruby/object:Gem::Requirement
128
86
  requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '2.0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
87
+ - - '>='
137
88
  - !ruby/object:Gem::Version
138
- version: '2.0'
139
- - !ruby/object:Gem::Dependency
140
- name: rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '3.10'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '3.10'
153
- - !ruby/object:Gem::Dependency
154
- name: ci_reporter_rspec
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '1.0'
89
+ version: '0'
160
90
  type: :development
161
91
  prerelease: false
162
92
  version_requirements: !ruby/object:Gem::Requirement
163
93
  requirements:
164
- - - "~>"
94
+ - - '>='
165
95
  - !ruby/object:Gem::Version
166
- version: '1.0'
96
+ version: '0'
167
97
  description:
168
98
  email:
169
- - conj_maintainers@cyberark.com
99
+ - kgilpin@conjur.net
170
100
  executables:
171
101
  - debify
172
102
  extensions: []
173
103
  extra_rdoc_files: []
174
104
  files:
175
- - ".dockerignore"
176
- - ".gitignore"
177
- - ".project"
178
- - ".rvmrc"
179
- - CHANGELOG.md
180
- - CONTRIBUTING.md
181
- - Dockerfile
105
+ - .gitignore
106
+ - .project
182
107
  - Gemfile
183
- - Jenkinsfile
184
108
  - LICENSE.txt
185
109
  - README.md
186
110
  - Rakefile
187
- - VERSION
188
111
  - bin/debify
189
- - build.sh
190
- - ci/test.sh
191
112
  - debify.gemspec
192
- - distrib/conjur_creds.rb
193
- - distrib/docker-debify
194
- - distrib/entrypoint.sh
195
- - distrib/script
196
- - distrib/secrets
197
- - distrib/secrets.yml
198
113
  - example/Gemfile
199
114
  - example/Gemfile.lock
200
115
  - example/debify.sh
201
116
  - example/distrib/postinstall.sh
202
- - example/docker-compose.yml
203
- - example/net-test.sh
204
117
  - example/test.sh
205
- - features/detect_version.feature
206
- - features/package.feature
207
- - features/sandbox.feature
118
+ - features/debify.feature
208
119
  - features/step_definitions/debify_steps.rb
209
120
  - features/support/env.rb
210
- - features/support/hooks.rb
211
- - features/support/world.rb
212
- - features/test.feature
213
- - image-tags
121
+ - jenkins.sh
214
122
  - lib/conjur/debify.rb
215
123
  - lib/conjur/debify/Dockerfile.fpm
216
- - lib/conjur/debify/action/publish.rb
217
- - lib/conjur/debify/utils.rb
218
124
  - lib/conjur/debify/version.rb
219
125
  - lib/conjur/fpm/Dockerfile
220
126
  - lib/conjur/fpm/debify_utils.sh
221
127
  - lib/conjur/fpm/package.sh
222
- - lib/conjur/publish/Dockerfile
223
- - publish-rubygem.sh
224
- - push-image.sh
225
- - secrets.yml
226
- - spec/action/publish_spec.rb
227
- - spec/data/Makefile
228
- - spec/data/test.tar
229
- - spec/debify_utils_spec.rb
230
- - spec/spec_helper.rb
231
- - spec/utils_spec.rb
232
- - tag-image.sh
233
- - test.sh
234
128
  homepage: https://github.com/conjurinc/debify
235
129
  licenses:
236
130
  - MIT
@@ -241,32 +135,22 @@ require_paths:
241
135
  - lib
242
136
  required_ruby_version: !ruby/object:Gem::Requirement
243
137
  requirements:
244
- - - ">="
138
+ - - '>='
245
139
  - !ruby/object:Gem::Version
246
140
  version: '0'
247
141
  required_rubygems_version: !ruby/object:Gem::Requirement
248
142
  requirements:
249
- - - ">"
143
+ - - '>='
250
144
  - !ruby/object:Gem::Version
251
- version: 1.3.1
145
+ version: '0'
252
146
  requirements: []
253
147
  rubyforge_project:
254
- rubygems_version: 2.7.6.2
148
+ rubygems_version: 2.0.14.1
255
149
  signing_key:
256
150
  specification_version: 4
257
151
  summary: Utility commands to build and package Conjur services as Debian packages
258
152
  test_files:
259
- - features/detect_version.feature
260
- - features/package.feature
261
- - features/sandbox.feature
153
+ - features/debify.feature
262
154
  - features/step_definitions/debify_steps.rb
263
155
  - features/support/env.rb
264
- - features/support/hooks.rb
265
- - features/support/world.rb
266
- - features/test.feature
267
- - spec/action/publish_spec.rb
268
- - spec/data/Makefile
269
- - spec/data/test.tar
270
- - spec/debify_utils_spec.rb
271
- - spec/spec_helper.rb
272
- - spec/utils_spec.rb
156
+ has_rdoc:
data/.dockerignore DELETED
@@ -1 +0,0 @@
1
- Gemfile.lock
data/.rvmrc DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
- # development environment upon cd'ing into the directory
5
-
6
- # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
7
- # Only full ruby name is supported here, for short names use:
8
- # echo "rvm use 2.2.4@debify" > .rvmrc
9
- environment_id="ruby-2.2.4@debify"
10
-
11
- # Uncomment the following lines if you want to verify rvm version per project
12
- # rvmrc_rvm_version="1.26.11 (latest)" # 1.10.1 seems like a safe start
13
- # eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | __rvm_awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
14
- # echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
15
- # return 1
16
- # }
17
-
18
- # First we attempt to load the desired environment directly from the environment
19
- # file. This is very fast and efficient compared to running through the entire
20
- # CLI and selector. If you want feedback on which environment was used then
21
- # insert the word 'use' after --create as this triggers verbose mode.
22
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
23
- && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
24
- then
25
- \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
26
- for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
27
- do
28
- if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
29
- then \. "${__hook}" || true
30
- fi
31
- done
32
- unset __hook
33
- if (( ${rvm_use_flag:=1} >= 2 )) # display only when forced
34
- then
35
- if [[ $- == *i* ]] # check for interactive shells
36
- then printf "%b" "Using: $(tput setaf 2 2>/dev/null)$GEM_HOME$(tput sgr0 2>/dev/null)\n" # show the user the ruby and gemset they are using in green
37
- else printf "%b" "Using: $GEM_HOME\n" # don't use colors in non-interactive shells
38
- fi
39
- fi
40
- else
41
- # If the environment file has not yet been created, use the RVM CLI to select.
42
- rvm --create "$environment_id" || {
43
- echo "Failed to create RVM environment '${environment_id}'."
44
- return 1
45
- }
46
- fi
47
-
48
- # If you use bundler, this might be useful to you:
49
- # if [[ -s Gemfile ]] && {
50
- # ! builtin command -v bundle >/dev/null ||
51
- # builtin command -v bundle | GREP_OPTIONS="" \command \grep $rvm_path/bin/bundle >/dev/null
52
- # }
53
- # then
54
- # printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
55
- # gem install bundler
56
- # fi
57
- # if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
58
- # then
59
- # bundle install | GREP_OPTIONS="" \command \grep -vE '^Using|Your bundle is complete'
60
- # fi