mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-29 09:31:06 +02:00
feat(dev-db/etcd): add new raft based etcd
This commit is contained in:
parent
08bb509fe5
commit
f2640f0d8f
@ -1,8 +0,0 @@
|
||||
[Service]
|
||||
ExecStartPre=/usr/lib/etcd/host/doozerd/configure.sh
|
||||
ExecStart=/usr/lib/etcd/host/riak/configure.sh
|
||||
Before=etcd.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -1,7 +0,0 @@
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/etcd -a doozer:?ca=${DOOZERD_MASTER}:8046
|
||||
EnvironmentFile=/var/run/etcd/doozerd/EnvironmentFile
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -74,6 +74,7 @@ RDEPEND="${RDEPEND}
|
||||
sys-process/psmisc
|
||||
sys-process/time
|
||||
virtual/perf
|
||||
coreos-base/coreos-experimental
|
||||
"
|
||||
|
||||
# TODO: sys-apps/iotools
|
||||
|
@ -15,7 +15,5 @@ IUSE=""
|
||||
DEPEND=""
|
||||
RDEPEND="
|
||||
app-admin/systemd-rest
|
||||
app-admin/etcd
|
||||
app-admin/etcd-client
|
||||
app-admin/etcd-lib
|
||||
dev-db/etcd
|
||||
"
|
||||
|
@ -5,37 +5,32 @@
|
||||
# $Header:$
|
||||
#
|
||||
|
||||
EAPI=2
|
||||
EAPI=4
|
||||
CROS_WORKON_PROJECT="coreos/etcd"
|
||||
CROS_WORKON_LOCALNAME="etcd"
|
||||
CROS_WORKON_REPO="git://github.com"
|
||||
CROS_WORKON_COMMIT="f4301f994c995d7e91214e082fa18312899b4131"
|
||||
CROS_WORKON_COMMIT="01e5d41f91da0251a8ed9dbba79df70a9dd6a237"
|
||||
inherit toolchain-funcs cros-workon systemd
|
||||
|
||||
DESCRIPTION="etcd"
|
||||
HOMEPAGE="https://github.com/xiangli-cmu/etcd"
|
||||
HOMEPAGE="https://github.com/coreos/etcd"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="MIT"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 arm x86"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=">=dev-lang/go-1.0.2"
|
||||
GOROOT="${ED}usr/$(get_libdir)/go"
|
||||
GOPKG="${PN}"
|
||||
DEPEND=">=dev-lang/go-1.1"
|
||||
|
||||
ETCD_PACKAGE="github.com/coreos/etcd"
|
||||
|
||||
src_compile() {
|
||||
export GOPATH="${S}"
|
||||
go get
|
||||
go build -o ${PN}
|
||||
./build
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dosbin ${S}/${PN}
|
||||
dobin ${S}/${PN}
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
systemd_enable_service multi-user.target ${PN}.service
|
||||
|
||||
systemd_dounit "${FILESDIR}"/${PN}-bootstrap.service
|
||||
systemd_enable_service multi-user.target ${PN}-bootstrap.service
|
||||
}
|
@ -5,29 +5,27 @@
|
||||
# $Header:$
|
||||
#
|
||||
|
||||
EAPI=2
|
||||
EAPI=4
|
||||
CROS_WORKON_PROJECT="coreos/etcd"
|
||||
CROS_WORKON_LOCALNAME="etcd"
|
||||
CROS_WORKON_REPO="git://github.com"
|
||||
inherit toolchain-funcs cros-workon systemd
|
||||
|
||||
DESCRIPTION="etcd"
|
||||
HOMEPAGE="https://github.com/xiangli-cmu/etcd"
|
||||
HOMEPAGE="https://github.com/coreos/etcd"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="MIT"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=">=dev-lang/go-1.0.2"
|
||||
DEPEND=">=dev-lang/go-1.1"
|
||||
GOROOT="${ED}usr/$(get_libdir)/go"
|
||||
GOPKG="${PN}"
|
||||
|
||||
src_compile() {
|
||||
export GOPATH="${S}"
|
||||
go get
|
||||
go build -o ${PN}
|
||||
./build
|
||||
}
|
||||
|
||||
src_install() {
|
35
sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n.sh
vendored
Normal file
35
sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/coreos-c10n.sh
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
C10N_ENDPOINT=https://core-api.appspot.com/v1/c10n/group
|
||||
META_URL="http://169.254.169.254/latest"
|
||||
|
||||
USER_DATA=$(curl -s $META_URL/user-data)
|
||||
|
||||
URL=$USER_DATA
|
||||
|
||||
echo $URL | grep -q '^https://' || (echo Coordination URL requires valid SSL; exit 1)
|
||||
|
||||
TMP=`mktemp`
|
||||
|
||||
curl -s "$USER_DATA/raw" > $TMP
|
||||
|
||||
# validate ssh key
|
||||
ssh-keygen -l -f $TMP > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
cat $TMP >> $HOME/.ssh/authorized_keys
|
||||
echo "SSH key updated"
|
||||
else
|
||||
echo "Not a valid ssh key"
|
||||
fi
|
||||
|
||||
IP_LIST=""
|
||||
for IP4 in `curl -s $META_URL/meta-data/ | grep ipv4`; do
|
||||
IP=$(curl -s $META_URL/meta-data/$IP4)
|
||||
if [ "$IP_LIST" != "" ]; then
|
||||
IP_LIST="$IP_LIST,$IP"
|
||||
else
|
||||
IP_LIST="$IP"
|
||||
fi
|
||||
done
|
||||
|
||||
curl $C10N_ENDPOINT -d "c10n_url=$URL" -d"ip_list=$IP_LIST"
|
5
sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/etcd.service
vendored
Normal file
5
sdk_container/src/third_party/coreos-overlay/dev-db/etcd/files/etcd.service
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
[Service]
|
||||
ExecStart=/usr/bin/etcd-bootstrap
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user