-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
87 lines (70 loc) · 2.36 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
87
.PHONY: build clean test update-version
build:
dune build @install
test:
dune runtest
install:
dune install
uninstall:
dune uninstall
clean:
rm -rf _build *.install
fmt:
dune build @fmt --auto-promote || echo "format has errors, ignoring"
.PHONY: endpoints
endpoints:
dune exec endpoint-gen -- -i input/endpoints.json -o lib
aws-ec2:
dune exec aws-gen -- --is-ec2 -i input/ec2/latest/service-2.json -r input/ec2/overrides.json -e input/errors.json -o libraries
aws-autoscaling:
dune exec aws-gen -- -i input/autoscaling/latest/service-2.json -r input/autoscaling/overrides.json -e input/errors.json -o libraries --optional-libs=aws-ec2
# NOTE: This does not include aws-ec2, which is special-cased.
LIBRARIES := \
aws-cloudformation \
aws-cloudtrail \
aws-cloudwatch \
aws-elasticache \
aws-elasticloadbalancing \
aws-kms \
aws-rds \
aws-sdb \
aws-ssm \
aws-sts \
aws-route53 \
aws-sqs \
.PHONY: $(LIBRARIES)
$(LIBRARIES): aws-%:
dune exec aws-gen -- -i input/$*/latest/service-2.json -r input/$*/overrides.json -e input/errors.json -o libraries
gen: build aws-ec2 aws-autoscaling $(LIBRARIES) fmt
update-version: VERSION=$(shell cat CHANGES.md | grep -E '^[0-9]' | head -n 1 | cut -f1 -d':' )
update-version:
@echo "Set version to $(VERSION)"
@gsed -i 's/^version: .*/version: "$(VERSION)"/' *.opam
# @gsed -i 's/"\(aws-s3[-a-z]*\)"[ ]*{= .*}/"\1" {= "$(VERSION)" }/' *.opam
@gsed -i 's/"\(aws-[-a-z]*\)"[ ]*{= .*}/"\1" {= "$(VERSION)" }/' *.opam
@gsed -i 's/"\(aws[-a-z]*\)"[ ]*{= .*}/"\1" {= "$(VERSION)" }/' *.opam
update-version: VERSION=$(shell cat CHANGES.md | grep -E '^[0-9]' | head -n 1 | cut -f1 -d':' )
release: update-version
opam publish
#
#
# Before this run `dune-release tag <VERSION>`
# opam-release:
# dune-release distrib --skip-build --skip-lint --skip-tests
# dune-release publish distrib --verbose
# dune-release opam pkg
# dune-release opam submit
# TODO Test doc generation and publish to GH Pages
doc:
dune build @doc
gh-pages: doc
git clone `git config --get remote.upstream.url` .gh-pages --reference .
git -C .gh-pages checkout --orphan gh-pages
git -C .gh-pages reset
git -C .gh-pages clean -dxf
cp -r _build/default/_doc/_html/* .gh-pages
git -C .gh-pages add .
git -C .gh-pages config user.email 'docs@ocaml-aws'
git -C .gh-pages commit -m "Update documentation"
git -C .gh-pages push origin gh-pages -f
rm -rf .gh-pages