-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
112 lines (86 loc) · 4.88 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
BUILD_ID := $(shell date +%Y%m%d%H%M%S)
VERSION := $(shell cat .version)
RELEASE_DATE := $(shell date +%Y-%m-%d)
build:
$(MAKE) -C os build
qemu:
$(MAKE) -C os qemu
toplevel:
$(MAKE) -C os toplevel
gems: libosctl osctl-repo osctl osctld osup osctl-image osctl-exporter osctl-exportfs converter svctl test-runner osvm
echo "$(VERSION).build$(BUILD_ID)" > .build_id
commit-gems:
git commit -e -m "os: update gems to $(shell cat .build_id)" .build_id os/packages/*/{Gemfile,Gemfile.lock,gemset.nix}
build-commit-gems: gems
$(MAKE) commit-gems
amend-gems:
git commit --amend -e -m "os: update gems to $(shell cat .build_id)" --date=now .build_id os/packages/*/{Gemfile,Gemfile.lock,gemset.nix}
build-amend-gems: gems
$(MAKE) amend-gems
libosctl:
./tools/update_gem.sh _nopkg libosctl $(BUILD_ID)
osctl: libosctl
./tools/update_gem.sh os/packages osctl $(BUILD_ID)
osctld: libosctl osctl-repo osup
./tools/update_gem.sh os/packages osctld $(BUILD_ID)
osctl-repo: libosctl
./tools/update_gem.sh os/packages osctl-repo $(BUILD_ID)
osctl-image: libosctl osctl osctl-repo
./tools/update_gem.sh os/packages osctl-image $(BUILD_ID)
osctl-exporter: libosctl osctl osctl-exportfs
./tools/update_gem.sh os/packages osctl-exporter $(BUILD_ID)
osctl-exportfs: libosctl
./tools/update_gem.sh os/packages osctl-exportfs $(BUILD_ID)
osup: libosctl
./tools/update_gem.sh os/packages osup $(BUILD_ID)
converter: libosctl
./tools/update_gem.sh _nopkg converter $(BUILD_ID)
svctl: libosctl
./tools/update_gem.sh os/packages svctl $(BUILD_ID)
test-runner: libosctl osvm
./tools/update_gem.sh os/packages test-runner $(BUILD_ID)
osvm: libosctl
./tools/update_gem.sh os/packages osvm $(BUILD_ID)
osctl-env-exec:
./tools/update_gem.sh os/packages tools/osctl-env-exec $(BUILD_ID)
doc:
mkdocs build
doc_serve:
mkdocs serve
version:
@echo "$(VERSION)" > .version
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osctld/lib/osctld/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osctl/lib/osctl/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" libosctl/lib/libosctl/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" converter/lib/vpsadminos-converter/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osctl-exporter/lib/osctl/exporter/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osctl-exportfs/lib/osctl/exportfs/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osctl-repo/lib/osctl/repo/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osctl-image/lib/osctl/image/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osup/lib/osup/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" svctl/lib/svctl/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" test-runner/lib/test-runner/version.rb
@sed -ri "s/ VERSION = '[^']+'/ VERSION = '$(VERSION)'/" osvm/lib/osvm/version.rb
@sed -ri "s/VERSION = '[^']+'/VERSION = '$(VERSION)'/" tools/osctl-env-exec/osctl-env-exec.gemspec
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' osctl/man/man8/osctl.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' osctl-exportfs/man/man8/osctl-exportfs.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' osctl-image/man/man8/osctl-image.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' osctl-repo/man/man8/osctl-repo.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' osup/man/man8/osup.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' osvm/man/man1/osvm.1.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' converter/man/man8/vpsadminos-convert.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' svctl/man/man8/svctl.8.md
@sed -ri '1!b;s/[0-9]+\.[0-9]+\.[0-9]+$\/$(VERSION)/' test-runner/man/man1/test-runner.1.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' osctl/man/man8/osctl.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' osctl-exportfs/man/man8/osctl-exportfs.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' osctl-image/man/man8/osctl-image.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' osctl-repo/man/man8/osctl-repo.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' osup/man/man8/osup.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' converter/man/man8/vpsadminos-convert.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' svctl/man/man8/svctl.8.md
@sed -ri '1!b;s/ [0-9]{4}-[0-9]{1,2}-[0-9]{1,2} / $(RELEASE_DATE) /' test-runner/man/man1/test-runner.1.md
migration:
$(MAKE) -C osup migration
.PHONY: build converter doc doc_serve qemu gems libosctl osctl osctld osctl-repo osctl-exporter osup svctl test-runner osvm osctl-env-exec
.PHONY: commit-gems build-commit-gems amend-gems build-amend-gems
.PHONY: version migration