forked from nishanthvasudevan/kubernetes-distro-packages
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_etcd.sh
executable file
·82 lines (72 loc) · 2.75 KB
/
build_etcd.sh
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
#!/bin/bash
# deb
# /etc/init.d/
# --deb-init FILEPATH (deb only) Add FILEPATH as an init script
# --deb-default FILEPATH (deb only) Add FILEPATH as /etc/default configuration
# --deb-upstart FILEPATH (deb only) Add FILEPATH as an upstart script
ETCD_VERSION=2.2.2
rm -rf etcd/source
mkdir etcd/source
rm -f etcd/builds/etcd-$ETCD_VERSION-1.x86_64.rpm
rm -f etcd/builds/etcd-$ETCD_VERSION-1.x86_64.rpm
rm -f etcd/builds/etcd-$ETCD_VERSION-1.x86_64.rpm
rm -f etcd/builds/etcd-$ETCD_VERSION-1.x86_64.rpm
curl -L https://github.com/coreos/etcd/releases/download/v$ETCD_VERSION/etcd-v$ETCD_VERSION-linux-amd64.tar.gz | tar xvz -C etcd/source --strip-components 1
fpm -s dir -n "etcd" \
-p etcd/builds \
-C ./etcd -v "$ETCD_VERSION" \
-t deb \
-a amd64 \
-d "dpkg (>= 1.17)" \
--after-install etcd/scripts/deb/after-install.sh \
--before-install etcd/scripts/deb/before-install.sh \
--after-remove etcd/scripts/deb/after-remove.sh \
--before-remove etcd/scripts/deb/before-remove.sh \
--deb-init etcd/services/initd/etcd \
--license "Apache Software License 2.0" \
--maintainer "Kismatic, Inc. <[email protected]>" \
--vendor "Kismatic, Inc." \
--description "Etcd binaries and services" \
source/etcd=/usr/bin/etcd \
source/etcdctl=/usr/bin/etcdctl
# systemd version - add a .0 to the version
fpm -s dir -n "etcd" \
-p etcd/builds/systemd \
-C ./etcd -v "$ETCD_VERSION~systemd" \
-t deb \
-a amd64 \
-d "dpkg (>= 1.17)" \
--after-install etcd/scripts/deb/systemd/after-install.sh \
--before-install etcd/scripts/deb/systemd/before-install.sh \
--after-remove etcd/scripts/deb/systemd/after-remove.sh \
--before-remove etcd/scripts/deb/systemd/before-remove.sh \
--config-files etc/etcd \
--license "Apache Software License 2.0" \
--maintainer "Kismatic, Inc. <[email protected]>" \
--vendor "Kismatic, Inc." \
--description "Etcd binaries and services" \
source/etcd=/usr/bin/etcd \
source/etcdctl=/usr/bin/etcdctl \
services/systemd/etcd.service=/lib/systemd/system/etcd.service \
config/systemd/etcd.conf=/etc/etcd/etcd.conf
# build_rpm_master
# rpm
# /lib/systemd/system
fpm -s dir -n "etcd" \
-p etcd/builds \
-C ./etcd -v "$ETCD_VERSION" \
-t rpm --rpm-os linux \
-a x86_64 \
--after-install etcd/scripts/rpm/after-install.sh \
--before-install etcd/scripts/rpm/before-install.sh \
--after-remove etcd/scripts/rpm/after-remove.sh \
--before-remove etcd/scripts/rpm/before-remove.sh \
--config-files etc/etcd \
--license "Apache Software License 2.0" \
--maintainer "Kismatic, Inc. <[email protected]>" \
--vendor "Kismatic, Inc." \
--description "Etcd binaries and services" \
source/etcd=/usr/bin/etcd \
source/etcdctl=/usr/bin/etcdctl \
services/systemd/etcd.service=/lib/systemd/system/etcd.service \
config/systemd/etcd.conf=/etc/etcd/etcd.conf