Skip to content

Commit

Permalink
(maint) Update Makefile and .travis.yml to use ruby 2.5.5 for contain…
Browse files Browse the repository at this point in the history
…er tests
  • Loading branch information
Morgan Rhodes committed May 29, 2019
1 parent 0f49d87 commit 01c11da
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ matrix:
rvm: 2.1.7
env: "CHECK='rake commits'"
- stage: puppet-agent container tests
language: generic
language: ruby
rvm: 2.5.5
env:
- DOCKER_COMPOSE_VERSION=1.24.0
script:
- cd docker && make lint && make build && make test
- |
set -ex
sudo rm /usr/local/bin/docker-compose
curl --location https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname --kernel-name`-`uname --machine` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
cd docker
make lint
make build
make test
set +x
13 changes: 10 additions & 3 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ hadolint_command := hadolint --ignore DL3008 --ignore DL3018 --ignore DL4000 --i
hadolint_container := hadolint/hadolint:latest
makefile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
makefile_dir := $(dir $(makefile_path))
pwd := $(shell pwd)
export BUNDLE_PATH = $(pwd)/.bundle/gems
export BUNDLE_BIN = $(pwd)/.bundle/bin
export GEMFILE = $(pwd)/Gemfile

version = $(shell echo $(git_describe) | sed 's/-.*//')
dockerfile := Dockerfile

Expand Down Expand Up @@ -35,9 +40,11 @@ ifeq ($(IS_LATEST),true)
endif

test: prep
@bundle install --path .bundle/gems
@PUPPET_TEST_DOCKER_IMAGE=$(NAMESPACE)/puppet-agent-ubuntu:$(version) bundle exec rspec spec
@PUPPET_TEST_DOCKER_IMAGE=$(NAMESPACE)/puppet-agent-alpine:$(version) bundle exec rspec spec
@bundle install --path $$BUNDLE_PATH --gemfile $$GEMFILE
@PUPPET_TEST_DOCKER_IMAGE=$(NAMESPACE)/puppet-agent-ubuntu:$(version) \
bundle exec --gemfile $$GEMFILE rspec spec
@PUPPET_TEST_DOCKER_IMAGE=$(NAMESPACE)/puppet-agent-alpine:$(version) \
bundle exec --gemfile $$GEMFILE rspec spec

publish: prep
@docker push $(NAMESPACE)/puppet-agent-ubuntu:$(version)
Expand Down

0 comments on commit 01c11da

Please sign in to comment.