forked from shinesolutions/aem-aws-stack-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (72 loc) · 2.87 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
version ?= 7.2.3-pre.0
ci: clean deps lint package
clean:
rm -rf .tmp Puppetfile.lock Gemfile.lock modules stage vendor files/test
################################################################################
# Dependencies resolution targets.
# For deps-local target, the local dependencies must be
# available on the same directory level where aem-aws-stack-provisioner is at.
# The idea is that you can package AEM AWS Stack Provisioner for AEM AWS stack
# Builder testing while also developing those dependencies locally.
################################################################################
# resolve dependencies from remote artifact registries
deps:
gem install bundler --version=2.3.21
rm -rf .bundle
bundle install --binstubs
bundle exec r10k puppetfile install --verbose --moduledir modules
bundle exec inspec vendor --overwrite
cd vendor && find . -name "*.tar.gz" -exec tar -xzvf '{}' \; -exec rm '{}' \;
cd vendor && mv inspec-aem-aws-*.*.* inspec-aem-aws
rm -rf files/test/inspec/ && mkdir -p files/test/inspec/ && cp -R vendor/* files/test/inspec/
# resolve AEM OpenCloud's Puppet module dependencies from local directories
# TODO: include local InSpec modules
deps-local:
rm -rf modules/aem_orchestrator/*
rm -rf modules/aem_resources/*
rm -rf modules/aem_curator/*
rm -rf modules/simianarmy/*
cp -R ../puppet-aem-orchestrator/* modules/aem_orchestrator/
cp -R ../puppet-aem-resources/* modules/aem_resources/
cp -R ../puppet-aem-curator/* modules/aem_curator/
cp -R ../puppet-simianarmy/* modules/simianarmy/
lint:
bundle exec puppet-lint \
--fail-on-warnings \
--no-140chars-check \
--no-autoloader_layout-check \
--no-documentation-check \
--no-only_variable_string-check \
--no-selector_inside_resource-check \
--no-variable_scope-check \
--log-format "%{path} (%{check}) L%{line} %{message}" \
manifests/*.pp
shellcheck files/*/*.sh
bundle exec puppet parser validate manifests/*.pp
bundle exec puppet epp validate templates/**/*.epp
bundle exec rubocop test/inspec/*.rb
bundle exec yaml-lint .*.yml conf/*.yaml data/*.yaml data/*/*.yaml
package:
rm -rf stage
mkdir -p stage
tar \
--exclude='.git*' \
--exclude='.tmp*' \
--exclude='stage*' \
--exclude='.idea*' \
--exclude='.DS_Store*' \
--exclude='*.tar' \
-cvf \
stage/aem-aws-stack-provisioner-$(version).tar ./
gzip stage/aem-aws-stack-provisioner-$(version).tar
release-major:
rtk release --release-increment-type major
release-minor:
rtk release --release-increment-type minor
release-patch:
rtk release --release-increment-type patch
release: release-minor
publish:
gh release create $(version) --title $(version) --notes "" || echo "Release $(version) has been created on GitHub"
gh release upload $(version) stage/aem-aws-stack-provisioner-$(version).tar.gz
.PHONY: ci clean deps deps-local lint package release release-major release-minor release-patch publish