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
data/CHANGELOG.md DELETED
@@ -1,246 +0,0 @@
1
- ## [0.0.1]
2
- ### Changed
3
-
4
- - Upgrade ruby version to 3.0.
5
- - Bump `cucumber` gem to 7.1.
6
- - Bump `conjur-api` gem to 5.3.7.
7
- - Bump `conjur-cli` gem to 6.2.6.
8
- - Bump `aruba` gem to 2.0.
9
- - Bump `jfrog-cli` to :latest.
10
-
11
- ## [2.1.1]
12
- ### Changed
13
-
14
- - Update to use automated release process
15
-
16
- # 2.1.0
17
- ### Changed
18
-
19
- - Refine bundler related steps in `debify package` flow: only `package.sh` file configures
20
- and invokes bundler. `Dockerfile.fpm` only copies files and adjusts folder structure.
21
- - Remove bundler 1.* support
22
-
23
- # 2.0.0
24
- ### Changed
25
- - Debify now receives the flag `--output` as input to indicate the file type that it should package (e.g `rpm`). If this
26
- flag is not given, the default value is `deb`.
27
- [conjurinc/debify#56](https://github.com/conjurinc/debify/issues/56)
28
-
29
- # 1.12.0
30
-
31
- ### Added
32
- - Debify now packages and publishes an RPM file, alongside a debian file.
33
- [conjurinc/debify#49](https://github.com/conjurinc/debify/pull/49)
34
- - `debify package` now offers an `--additional-files` flag to provide a comma
35
- separated list of files to include in the FPM build that are not provided
36
- automatically by `git ls-files`.
37
- [conjurinc/debify#52](https://github.com/conjurinc/debify/pull/52)
38
-
39
- ### Fixed
40
- - Bug causing `all` files in the git repo to be added to the debian file.
41
- [conjurinc/debify#50](https://github.com/conjurinc/debify/pull/50)
42
-
43
- # 1.11.5
44
-
45
- ### Changed
46
- * Updated FPM and Test images to use a base image with FIPS-compliant Ruby and OpenSSL.
47
-
48
- # 1.11.4
49
-
50
- * Updated sandbox password to match Conjur password complexity requirements.
51
-
52
- # 1.11.3
53
-
54
- * Reverted to `bundler` v1. `bundler` v2 was creating incompatible paths for downstream
55
- packages.
56
- * Made FPM Ruby version use `ruby2.5` instead of `ruby2.6` since that is what
57
- our appliance image uses otherwise the gems bundled in the packages are unusable.
58
-
59
- # 1.11.2
60
-
61
- * Upgraded to use Ruby 2.6 and latest version of FPM
62
- * Update Conjur Dockerfile from Ubuntu 14.04 --> 18.04 as 14.04 repos
63
- are now behind a [pay wall](https://ubuntu.com/blog/ubuntu-14-04-esm-support)
64
- Ruby is installed from `ppa:brightbox/ruby-ng` however that PPA
65
- [doesn't currently supply ruby2.2 for Ubuntu 18.04](https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng?field.series_filter=bionic). [The documentation](https://www.brightbox.com/docs/ruby/ubuntu/)
66
- suggests this combination is available, so it may be a temporary problem.
67
- To work around the problem, ruby is bumped from 2.2 to 2.3 as 2.3 is the oldest
68
- version available for Ubuntu 18.04.
69
-
70
- # 1.11.1
71
-
72
- * Upgrade `docker-debify` to use Ruby 2.6.
73
-
74
- # 1.11.0
75
-
76
- * Use a Docker env-file (docker.env, by default) to pass environment
77
- variables to the debify container.
78
-
79
- * Make sure `--env` variables get passed along to the Conjur container when testing, too.
80
-
81
- # 1.10.3
82
-
83
- * Fix a bug causing duplicate files between normal and dev packages when a file name contained a space.
84
-
85
- # 1.10.2
86
-
87
- * Pin `ruby-xz` gem in fpm Dockerfile, so it works on Ruby 2.2. Upstream issue: https://github.com/jordansissel/fpm/issues/1493
88
-
89
- # 1.10.1
90
-
91
- * Update fpm container to use Ruby 2.4, fixes `ruby-xz` dependency
92
-
93
- # 1.10.0
94
-
95
- * add `--net` support to `test` and `sandbox` subcommands
96
- * Use Docker::Container.start! to start containers, to avoid
97
- swallowing important errors.
98
-
99
- # 1.9.1
100
-
101
- * Make sure .bundle/config in the 'main' package excludes test and development groups.
102
-
103
- # 1.9.0
104
-
105
- * Build -dev package with development/test dependencies and use it on `debify test`.
106
-
107
- # 1.8.2
108
-
109
- * Install fpm dependency libffi-dev
110
-
111
- # 1.8.1
112
-
113
- * Make Conjur cert available in dockerized debify container
114
- * Add a cuke for `debify publish`
115
-
116
- # 1.8.0
117
-
118
- * Added artifactory url option to `debify publish`, defaults to jfrog.io domain
119
- * Added artifactory repo option to `debify publish`, defaults to 'debian-private'
120
-
121
- # 1.7.4
122
-
123
- * Fix publishing support in docker-debify
124
-
125
- # 1.7.2
126
-
127
- * Take out a `require 'pry'` that had snuck in.
128
- * Fix `publish` subcommand, broken after factoring publish out into a separate action.
129
-
130
- # 1.7.0
131
-
132
- * Read artifactory credentials from the environment
133
- (`ARTIFACTORY_USER`, `ARTIFACTORY_PASSWORD`), only contact Conjur if
134
- they're not set.
135
-
136
- # 1.6.1
137
-
138
- * Buils a docker image to run debify, convert tests to use it, pipeline build
139
-
140
- # 1.6.0
141
-
142
- * When not on the master branch, `debify publish` uses the branch name as the component name, rather than always using
143
- `'testing'`.
144
-
145
- # 1.5.4
146
-
147
- * `debify publish` now checks env var `BRANCH_NAME` as well as `GIT_BRANCH`.
148
- Jenkins pipelines use `BRANCH_NAME`, Jenkins jobs use `GIT_BRANCH`.
149
-
150
- # 1.5.3
151
-
152
- * debify now uses `~/.docker/config` auth if pulling an image fails due to auth
153
-
154
- # 1.5.2
155
-
156
- * Use new conjurops variables in `publish` command, fall back to old conjurops
157
-
158
- # 1.5.1
159
-
160
- * Fix the description of the `--version` argument to indicate that the version now comes from the `VERSION` file.
161
-
162
- # 1.5.0
163
-
164
- * Add `detect-version` command.
165
- * Read version from VERSION file, if it exists.
166
-
167
- # 1.4.0
168
-
169
- * Add `--port` sandbox option
170
-
171
- # 1.3.1
172
-
173
- * When testing, `docker exec` into the Conjur container to run
174
- `/opt/conjur/evoke/bin/wait_for_conjur`.
175
-
176
- # 1.3.0
177
-
178
- * Add `--volumes-from`
179
-
180
- # 1.2.1
181
-
182
- * Fix typo in error message
183
-
184
- # 1.2.0
185
-
186
- * Pin bundler to 1.11.2
187
-
188
- # 1.1.0
189
-
190
- * Minor workflow tweaks, and some changes to work around Docker For Mac issues
191
-
192
- # 1.0.0
193
-
194
- * Base image used for packaging on Ubuntu 14.04
195
- * Install ruby2.2 and related packages
196
-
197
- # 0.11.1
198
-
199
- * Add `name` and `Workingdir` options to the sandbox container.
200
-
201
- # 0.11.0
202
-
203
- * Add `debify sandbox`.
204
-
205
- # 0.10.2
206
-
207
- * Fixed publish internal Dockerfile.
208
-
209
- # 0.10.1
210
-
211
- * Run internal containers as privileged if Docker >= 1.10.0.
212
-
213
- # 0.10.0
214
-
215
- * Upgrading Ruby for packaging from 2.0 to 2.2.4.
216
-
217
- # 0.9.2
218
-
219
- * Print messages to stderr instead of stdout during packaging.
220
- * Only consider tags matching v*.*.* when determining package version string.
221
-
222
- # 0.9.1
223
-
224
- * Provide the package to purge before installing the new version.
225
-
226
- # 0.9.0
227
-
228
- * Don't nuke the entire existing source install dir, there may be necessary files in there.
229
-
230
- # 0.8.0
231
-
232
- * Remove the need for a 'latest' debian.
233
- * Fix bug in the error message for 'detect_version'.
234
- * Use a more reliable way to detect the current branch.
235
- * `publish` : Remove the default value of the 'component' flag.
236
- * `clean` : Don't create a container unless deletions will actually be performed.
237
-
238
- # 0.7.0
239
-
240
- * Add `debify clean`.
241
-
242
- # 0.6.0
243
-
244
- * `package` : Add `--dockerfile` option.
245
- * `package` : Ensure that `Gemfile.lock` is in the container.
246
- * `test` : Propagate `SSH_AUTH_SOCK` to the container.
data/CONTRIBUTING.md DELETED
@@ -1,16 +0,0 @@
1
- # Contributing
2
-
3
- For general contribution and community guidelines, please see the [community repo](https://github.com/cyberark/community).
4
-
5
- ## Contributing
6
-
7
- 1. [Fork the project](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
8
- 2. [Clone your fork](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
9
- 3. Make local changes to your fork by editing files
10
- 3. [Commit your changes](https://help.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line)
11
- 4. [Push your local changes to the remote server](https://help.github.com/en/github/using-git/pushing-commits-to-a-remote-repository)
12
- 5. [Create new Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
13
-
14
- From here your pull request will be reviewed and once you've responded to all
15
- feedback it will be merged into the project. Congratulations, you're a
16
- contributor!
data/Dockerfile DELETED
@@ -1,33 +0,0 @@
1
- FROM ruby:3.0
2
-
3
- RUN apt-get update -qq && \
4
- apt-get dist-upgrade -qqy && \
5
- apt-get install -qqy \
6
- apt-transport-https \
7
- ca-certificates \
8
- curl
9
-
10
- # Install Docker client tools
11
- ENV DOCKERVERSION=20.10.0
12
- RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
13
- && tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \
14
- -C /usr/local/bin docker/docker \
15
- && rm docker-${DOCKERVERSION}.tgz
16
-
17
- RUN mkdir -p /debify
18
- WORKDIR /debify
19
-
20
- COPY . ./
21
-
22
- RUN gem install bundler:2.2.30
23
- RUN gem build debify.gemspec
24
-
25
- ARG VERSION
26
- RUN gem install -N conjur-debify-*.gem
27
-
28
- ARG CONJUR_APPLIANCE_URL
29
- ENV CONJUR_APPLIANCE_URL ${CONJUR_APPLIANCE_URL:-https://conjurops.itp.conjur.net}
30
- ENV CONJUR_ACCOUNT ${CONJUR_ACCOUNT:-conjur}
31
- ENV CONJUR_VERSION ${CONJUR_VERSION:-5}
32
-
33
- ENTRYPOINT ["/debify/distrib/entrypoint.sh"]
data/Jenkinsfile DELETED
@@ -1,116 +0,0 @@
1
- #!/usr/bin/env groovy
2
-
3
- // Automated release, promotion and dependencies
4
- properties([
5
- release.addParams(),
6
- dependencies(['cyberark/conjur-base-image'])
7
- ])
8
-
9
- if (params.MODE == "PROMOTE") {
10
- release.promote(params.VERSION_TO_PROMOTE) { sourceVersion, targetVersion, assetDirectory ->
11
- sh './publish-rubygems.sh'
12
- }
13
- return
14
- }
15
-
16
- pipeline {
17
- agent { label 'executor-v2' }
18
-
19
- options {
20
- timestamps()
21
- buildDiscarder(logRotator(daysToKeepStr: '30'))
22
- }
23
-
24
- triggers {
25
- cron(getDailyCronString())
26
- }
27
-
28
- environment {
29
- MODE = release.canonicalizeMode()
30
- }
31
-
32
- stages {
33
- stage ("Skip build if triggering job didn't create a release") {
34
- when {
35
- expression {
36
- MODE == "SKIP"
37
- }
38
- }
39
- steps {
40
- script {
41
- currentBuild.result = 'ABORTED'
42
- error("Aborting build because this build was triggered from upstream, but no release was built")
43
- }
44
- }
45
- }
46
- stage('Prepare') {
47
- steps {
48
- // Initialize VERSION file
49
- updateVersion("CHANGELOG.md", "${BUILD_NUMBER}")
50
- }
51
- }
52
- stage('Build docker image') {
53
- steps {
54
- sh './build.sh'
55
- }
56
- }
57
-
58
- stage('Scan Docker image') {
59
- parallel {
60
- stage('Scan Docker image for fixable issues') {
61
- steps{
62
- script {
63
- VERSION = sh(returnStdout: true, script: 'cat VERSION')
64
- }
65
- scanAndReport("debify:${VERSION}", "HIGH", false)
66
- }
67
- }
68
- stage('Scan Docker image for all issues') {
69
- steps{
70
- script {
71
- VERSION = sh(returnStdout: true, script: 'cat VERSION')
72
- }
73
- scanAndReport("debify:${VERSION}", "NONE", true)
74
- }
75
- }
76
- }
77
- }
78
-
79
- stage('Run feature tests') {
80
- steps {
81
- sh './test.sh'
82
- }
83
- post { always {
84
- junit 'features/reports/*.xml'
85
- }}
86
- }
87
-
88
- stage('Push Docker image') {
89
- steps {
90
- sh './tag-image.sh'
91
- sh './push-image.sh'
92
- }
93
- }
94
-
95
- stage('Publish to RubyGems') {
96
- when {
97
- expression {
98
- MODE == "RELEASE"
99
- }
100
- }
101
-
102
- steps {
103
- release {
104
- sh './publish-rubygem.sh'
105
- sh "cp conjur-debify-*.gem release-assets/."
106
- }
107
- }
108
- }
109
- }
110
-
111
- post {
112
- always {
113
- cleanupAndNotify(currentBuild.currentResult)
114
- }
115
- }
116
- }
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.1-47
data/build.sh DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- VERSION=$(< VERSION)
4
- docker build --build-arg VERSION=$VERSION -t debify:$VERSION .
data/ci/test.sh DELETED
@@ -1,8 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- bundle
4
-
5
- for target in spec cucumber; do
6
- bundle exec rake $target
7
- done
8
-
@@ -1,7 +0,0 @@
1
- require 'netrc'
2
- Netrc.configure do |c|
3
- c[:allow_permissive_netrc_file] = true
4
- end
5
-
6
- creds = Netrc.read('/root/.netrc')[ENV['CONJUR_APPLIANCE_URL'] + '/authn']
7
- print "#{creds.login} #{creds.password}" if creds
@@ -1,50 +0,0 @@
1
- #!/bin/bash -e
2
-
3
- # If we're running in jenkins, there will be a conjur.identity file
4
- # with Conjur creds in it. Otherwise, assume the user's netrc has
5
- # them.
6
- if [[ -f /etc/conjur.identity ]]; then
7
- netrc=/etc/conjur.identity
8
- else
9
- netrc=$HOME/.netrc
10
- fi
11
-
12
- : ${CONJURRC=/etc/conjur.conf}
13
-
14
- conjur_config() {
15
- local name=$1; shift
16
- grep $name $CONJURRC | awk '{print $2}' | tr -d '"'
17
- }
18
-
19
- export CONJUR_APPLIANCE_URL=$(conjur_config appliance_url)
20
- export CONJUR_SSL_CERTIFICATE="$(< $(conjur_config cert_file))"
21
-
22
- [[ -f "$HOME/.debifyrc" ]] && rc_arg="-v $HOME/.debifyrc:/root/.debifyrc:ro"
23
-
24
- : ${DEBIFY_ENVFILE=debify.env}
25
- [[ -f $DEBIFY_ENVFILE ]] && envfile_arg="--env-file $DEBIFY_ENVFILE"
26
-
27
- # Mounting docker socket is required because subcommands launch
28
- # containers.
29
- #
30
- # The environment variables can't go into an env-file, because docker
31
- # doesn't handle env-file variables the same way it handles
32
- # command-line variables. In particular, when a variable in an
33
- # env-file is unset in the calling enviroment, it gets set in the
34
- # container without a value. When such a variable is mentioned on the
35
- # command line, it doesn't get set in the container.
36
- tty=$(tty -s && echo "-t" || true)
37
- docker run -i $tty --rm \
38
- -e GLI_DEBUG -e DEBUG \
39
- -e CONJUR_APPLIANCE_URL -e CONJUR_SSL_CERTIFICATE \
40
- -e GIT_BRANCH -e BRANCH_NAME \
41
- -e ARTIFACTORY_USER -e ARTIFACTORY_PASSWORD \
42
- -e HOME \
43
- ${envfile_arg} \
44
- -v "$PWD:$PWD" -w "$PWD" \
45
- -v /var/run/docker.sock:/var/run/docker.sock \
46
- -v "${HOME}:${HOME}" \
47
- -v "${netrc}:${HOME}/.netrc:ro" \
48
- ${rc_arg} \
49
- ${DEBIFY_ENTRYPOINT+--entrypoint $DEBIFY_ENTRYPOINT} \
50
- ${DEBIFY_IMAGE-registry.tld/conjurinc/debify:@@DEBIFY_VERSION@@} "$@"
@@ -1,19 +0,0 @@
1
- #!/bin/bash -e
2
-
3
- # Make sure we don't echo commands as executed, otherwise the user's
4
- # Conjur API key will show up in the logs.
5
- set +x
6
-
7
- creds=( $(ruby /debify/distrib/conjur_creds.rb) )
8
-
9
- # If there are creds, use them to log in to the registry.
10
- #
11
- # If there are no creds, any commands that do
12
- # Docker stuff will fail, but the non-Docker commands (e.g. the config
13
- # subcommands) will work fine.
14
- if [[ ${#creds[*]} > 0 ]]; then
15
- echo -n "${creds[1]}" | docker login registry.tld -u ${creds[0]} --password-stdin >/dev/null 2>&1
16
- fi
17
-
18
- exec debify "$@"
19
-
data/distrib/script DELETED
@@ -1 +0,0 @@
1
- distrib/docker-debify
data/distrib/secrets DELETED
@@ -1 +0,0 @@
1
- distrib/secrets.yml
data/distrib/secrets.yml DELETED
@@ -1,2 +0,0 @@
1
- ARTIFACTORY_USER: !var ci/artifactory/users/jenkins/username
2
- ARTIFACTORY_PASSWORD: !var ci/artifactory/users/jenkins/password
@@ -1,11 +0,0 @@
1
- version: "2"
2
- networks:
3
- svcnet:
4
- external:
5
- name: testnet
6
- services:
7
- db:
8
- image: postgres
9
- container_name: mydb
10
- networks:
11
- - svcnet
data/example/net-test.sh DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash -ex
2
-
3
- cid=$1
4
-
5
- docker exec $cid curl -s http://other_host > /dev/null
6
-
7
- echo Test succeeded
@@ -1,7 +0,0 @@
1
- Feature: Automatic version string
2
-
3
- @announce-output
4
- Scenario: 'example' project gets a default version
5
- When I run `env DEBUG=true GLI_DEBUG=true debify detect-version -d ../../example`
6
- Then the exit status should be 0
7
- And the output should match /\d+.\d+.\d+-\d+-.*/
@@ -1,23 +0,0 @@
1
- @announce-output
2
- Feature: Packaging
3
-
4
- Background:
5
- # We use version 0.0.1-suffix to verify that RPM converts dashes to underscores
6
- # in the version as we expect
7
- Given I successfully run `env DEBUG=true GLI_DEBUG=true debify package -d ../../example -v 0.0.1-suffix example -- --post-install /distrib/postinstall.sh`
8
- And I successfully run `env DEBUG=true GLI_DEBUG=true debify package -d ../../example --output rpm -v 0.0.1-suffix example -- --post-install /distrib/postinstall.sh`
9
-
10
- Scenario: 'example' project can be packaged successfully
11
- Then the stdout should contain "conjur-example_0.0.1-suffix_amd64.deb"
12
- And the stdout should contain "conjur-example-dev_0.0.1-suffix_amd64.deb"
13
- And the stdout should contain "conjur-example-0.0.1_suffix-1.x86_64.rpm"
14
- And the stdout should contain "conjur-example-dev-0.0.1_suffix-1.x86_64.rpm"
15
-
16
- Scenario: 'clean' command will delete non-Git-managed files
17
- When I successfully run `env DEBUG=true GLI_DEBUG=true debify clean -d ../../example --force`
18
- And I successfully run `find ../../example`
19
- Then the stdout from "find ../../example" should not contain "conjur-example_0.0.1-suffix_amd64.deb"
20
- And the stdout from "find ../../example" should not contain "conjur-example-0.0.1_suffix-1.x86_64.rpm"
21
-
22
- Scenario: 'example' project can be published
23
- When I successfully run `env DEBUG=true GLI_DEBUG=true debify publish -v 0.0.1-suffix -d ../../example 5.0 example`
@@ -1,23 +0,0 @@
1
- @announce-output
2
- Feature: Running a sandbox
3
- Background:
4
- Given I successfully run `docker pull registry.tld/conjur-appliance-cuke-master:5.0-stable`
5
- # The extra containers will use the `alpine` image, so we need to pull it first on the
6
- # host to use the authenticated DockerHub connection. This avoids hitting DockerHub
7
- # rate limits.
8
- And I successfully run `docker pull nginx`
9
-
10
- Scenario: sandbox for 'example' project be started
11
- Given I successfully start a sandbox for "example" with arguments "-t 5.0-stable --no-pull"
12
-
13
- Scenario: sandbox for 'example' project be started linked to another container
14
- Given I start a container named "other_host"
15
- Then I successfully start a sandbox for "example" with arguments "-t 5.0-stable --no-pull --link other_host -c 'curl -s http://other_host > /dev/null'"
16
-
17
- Scenario: sandbox for 'example' project be started on a network other than the default
18
- Given I start a container named "other_host" on network "test-net"
19
- Then I successfully start a sandbox for "example" with arguments "-t 5.0-stable --no-pull --net test-net -c 'curl -s http://other_host > /dev/null'"
20
-
21
- Scenario: sandbox for 'example' project be started on a network other than the default with a host aliased
22
- Given I start a container named "another_host" on network "test-net"
23
- Then I successfully start a sandbox for "example" with arguments "-t 5.0-stable --no-pull --net test-net --link another_host:other_host -c 'curl -s http://other_host > /dev/null'"
@@ -1,29 +0,0 @@
1
- Before do
2
- # Using "announce" causes massive warnings on 1.9.2
3
- @puts = true
4
- @original_rubylib = ENV['RUBYLIB']
5
- ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
6
- end
7
-
8
- After do
9
- ENV['RUBYLIB'] = @original_rubylib
10
- end
11
-
12
- Around do |scenario, block|
13
- # Note that self in an Around hook is the instance of the world
14
- # (here, a DebifyWorld) for the current scenario.
15
- initialize
16
- begin
17
- block.call
18
- ensure
19
- unless ENV['KEEP_CONTAINERS']
20
- containers.each do |c|
21
- c.remove(force: true)
22
- end
23
-
24
- networks.each do |n|
25
- n.remove
26
- end
27
- end
28
- end
29
- end
@@ -1,10 +0,0 @@
1
- module DebifyWorld
2
- attr_accessor :containers, :networks
3
-
4
- def initialize
5
- @containers = []
6
- @networks = []
7
- end
8
- end
9
-
10
- World(DebifyWorld)
@@ -1,24 +0,0 @@
1
- @announce-output
2
- Feature: Testing
3
-
4
- Background:
5
- Given I successfully run `env DEBUG=true GLI_DEBUG=true debify package -d ../../example -v 0.0.1 example -- --post-install /distrib/postinstall.sh`
6
-
7
- Scenario: 'example' project can be tested successfully
8
- When I successfully run `env DEBUG=true GLI_DEBUG=true debify test -t 5.0-stable -v 0.0.1 -d ../../example --no-pull example test.sh`
9
- Then the stderr should contain "Test succeeded"
10
-
11
- Scenario: 'example' project can be tested when linked to another container
12
- Given I start a container named "other_host"
13
- When I successfully run `env DEBUG=true GLI_DEBUG=true debify test -t 5.0-stable -v 0.0.1 -d ../../example --no-pull --link other_host example net-test.sh`
14
- Then the stderr should contain "Test succeeded"
15
-
16
- Scenario: 'example' project can be tested on a network other than the default
17
- Given I start a container named "other_host" on network "test-net"
18
- When I successfully run `env DEBUG=true GLI_DEBUG=true debify test -t 5.0-stable -v 0.0.1 -d ../../example --no-pull --net test-net example net-test.sh`
19
- Then the stderr should contain "Test succeeded"
20
-
21
- Scenario: 'example' project can be tested on a network other than the default with a host aliased
22
- Given I start a container named "another_host" on network "test-net"
23
- When I successfully run `env DEBUG=true GLI_DEBUG=true debify test -t 5.0-stable -v 0.0.1 -d ../../example --no-pull --link another_host:other_host --net test-net example net-test.sh`
24
- Then the stderr should contain "Test succeeded"