forked from voxpupuli/puppet-nfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (68 loc) · 2.5 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
ifneq ($(origin PUPPET_VERSION), undefined)
puppet_version := ${PUPPET_VERSION}
else
puppet_version := 7.0
endif
ifneq ($(origin STRICT_VARIABLES), undefined)
export strict_variables := ${STRICT_VARIABLES}
else
export strict_variables := yes
endif
ifneq ($(origin RVM), undefined)
rvm := ${RVM}
else
rvm := 2.5.0
endif
ifneq ($(origin BEAKER_set), undefined)
beaker_set := ${BEAKER_set}
else
beaker_set := ubuntu-20.04
endif
ifneq ($(origin PUPPET_collection), undefined)
puppet_collection := ${PUPPET_collection}
else
puppet_collection := puppet7
endif
DOCKER_CMD := docker run -it --rm -v $$(pwd):/puppet/module derdanne/rvm:$(rvm) /bin/bash -l -c
PREPARE := rm -f Gemfile.lock && $(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) bundle install --quiet --without system_tests development --path=vendor/bundle"
DOCKER_CMD_BEAKER := docker run --privileged -it --rm -v $$(pwd):/puppet/module -v /var/run/docker.sock:/var/run/docker.sock derdanne/rvm:$(rvm) /bin/bash -l -c
PREPARE_BEAKER := rm -f Gemfile.lock && $(DOCKER_CMD) "bundle install --quiet --without system_tests development --path=vendor/bundle"
VARIABLES := echo "PUPPET_VERSION=$(puppet_version), STRICT_VARIABLES=$(strict_variables), RVM=$(rvm)"
build:
@cd spec/local-testing && docker build --squash --build-arg RUBY_VERSION=$(rvm) -t derdanne/rvm:$(rvm) .
pull:
@docker pull derdanne/rvm:$(rvm)
install-gems:
@$(VARIABLES)
@$(PREPARE)
test-metadata-lint:
@$(VARIABLES)
@$(PREPARE)
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) bundle exec rake metadata_lint"
test-lint:
@$(VARIABLES)
@$(PREPARE)
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) bundle exec rake lint"
test-syntax:
@$(VARIABLES)
@$(PREPARE)
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) bundle exec rake syntax"
test-rspec:
@$(VARIABLES)
@$(PREPARE)
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) STRICT_VARIABLES=$(strict_variables) bundle exec rake spec"
test-rubocop:
@$(VARIABLES)
@$(PREPARE)
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) bundle exec rake rubocop"
test-all:
@$(VARIABLES)
@$(PREPARE)
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) STRICT_VARIABLES=$(strict_variables) bundle exec rake test"
@$(DOCKER_CMD) "PUPPET_VERSION=$(puppet_version) bundle exec rake rubocop"
test-beaker:
@$(VARIABLES)
@$(PREPARE_BEAKER)
@$(DOCKER_CMD_BEAKER) "BEAKER_PUPPET_COLLECTION=$(puppet_collection) PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=$(beaker_set) BEAKER_destroy=onpass bundle exec rspec spec/acceptance"
pkg-build:
@pdk build --force