Skip to content

Commit

Permalink
Merge pull request #333 from vroldanbet/fix-ci-build
Browse files Browse the repository at this point in the history
Fix CI build
  • Loading branch information
mtodd authored Nov 16, 2019
2 parents 9daa954 + 693b210 commit 585ec7a
Show file tree
Hide file tree
Showing 26 changed files with 495 additions and 1,064 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ publish/
Gemfile.lock
.bundle
bin/
.idea
24 changes: 23 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,42 @@ rvm:
- 2.0.0
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
# optional
- ruby-head
- jruby-19mode
- jruby-head
- rbx-2

addons:
hosts:
- ldap.example.org # needed for TLS verification

services:
- docker

env:
- INTEGRATION=openldap

before_install:
- gem update bundler

install:
- if [ "$INTEGRATION" = "openldap" ]; then sudo script/install-openldap; fi
- >
docker run \
--hostname ldap.example.org \
--env LDAP_TLS_VERIFY_CLIENT=try \
-p 389:389 \
-p 636:636 \
-v "$(pwd)"/test/fixtures/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom \
--name openldap \
--detach \
osixia/openldap:1.3.0 \
--copy-service \
--loglevel debug \
- bundle install

script: bundle exec rake ci
Expand Down
11 changes: 8 additions & 3 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ This task will run the test suite and the
rake rubotest

CI takes too long? If your local box supports
{Vagrant}[https://www.vagrantup.com/], you can run most of the tests
in a VM on your local box. For more details and setup instructions, see
{test/support/vm/openldap/README.md}[https://github.com/ruby-ldap/ruby-net-ldap/tree/master/test/support/vm/openldap/README.md]
{Docker}[https://www.docker.com/], you can also run integration tests locally.
Simply run:

script/ldap-docker
INTEGRATION=openldap rake test

CAVEAT: you need to add the following line to /etc/hosts
127.0.0.1 ldap.example.org

== Release

Expand Down
48 changes: 0 additions & 48 deletions script/generate-fixture-ca

This file was deleted.

134 changes: 0 additions & 134 deletions script/install-openldap

This file was deleted.

12 changes: 12 additions & 0 deletions script/ldap-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Usage: script/ldap-docker
#
# Starts a openldap docker container ready for integration tests

docker run --rm -ti \
--hostname ldap.example.org \
--env LDAP_TLS_VERIFY_CLIENT=try \
-p 389:389 -p 636:636 \
-v "$(pwd)"/test/fixtures/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom \
--name my-openldap-container \
osixia/openldap:1.3.0 --copy-service --loglevel debug
4 changes: 0 additions & 4 deletions test/fixtures/ca/ca.info

This file was deleted.

24 changes: 0 additions & 24 deletions test/fixtures/ca/cacert.pem

This file was deleted.

Loading

0 comments on commit 585ec7a

Please sign in to comment.