forked from Rewindding/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-aci
executable file
·66 lines (46 loc) · 1.47 KB
/
build-aci
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
#!/usr/bin/env bash
set -e
BINARYDIR=${BINARYDIR:-bin}
BUILDDIR=${BUILDDIR:-bin}
# A non-installed acbuild can be used, for example:
# ACBUILD=../../appc/acbuild/bin/acbuild
ACBUILD=${ACBUILD:-acbuild}
VERSION=$1
if ! command -v $ACBUILD >/dev/null; then
echo "acbuild ($ACBUILD) is not executable"
exit 1
fi
if [ ! -x $BINARYDIR/etcd ] ; then
echo "$BINARYDIR/etcd not found. Is it compiled?"
exit 1
fi
if [ -z "$VERSION" ] ; then
echo "Usage: scripts/build-aci VERSION"
exit 1
fi
acbuild --debug begin
TMPHOSTS="$(mktemp)"
acbuildEnd() {
rm "$TMPHOSTS"
export EXIT=$?
acbuild --debug end && exit $EXIT
}
trap acbuildEnd EXIT
cat <<DF > $TMPHOSTS
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
DF
acbuild --debug set-name coreos.com/etcd
acbuild --debug copy --to-dir $BINARYDIR/etcd $BINARYDIR/etcdctl /
acbuild --debug copy README.md /README.md
acbuild --debug copy etcdctl/README.md /README-etcdctl.md
acbuild --debug copy --to-dir Documentation /
acbuild --debug environment add ETCD_DATA_DIR /data-dir
acbuild --debug label add version "$VERSION"
acbuild --debug set-exec -- /etcd
acbuild --debug mount add data-dir /data-dir
acbuild --debug port add legacy-client tcp 4001
acbuild --debug port add legacy-peer tcp 7001
acbuild --debug port add client tcp 2379
acbuild --debug port add peer tcp 2380
acbuild --debug copy "$TMPHOSTS" /etc/hosts
acbuild --debug write --overwrite $BUILDDIR/etcd-${1}-linux-amd64.aci