aboutsummaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2021-10-04 18:27:57 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2021-10-19 16:56:07 +0200
commitdc017a0cab40cb2f33a01b420bb1b04038abb875 (patch)
tree239b6a9245b842a4daaceead93b71d8ddbeab498 /script
parent1acf7e4c66aab0a0b5bcce8eb2965b35d587dd2a (diff)
downloadgarage-dc017a0cab40cb2f33a01b420bb1b04038abb875.tar.gz
garage-dc017a0cab40cb2f33a01b420bb1b04038abb875.zip
Build Garage with Nixfeature/static
Diffstat (limited to 'script')
-rw-r--r--script/builder_image/Dockerfile7
-rw-r--r--script/builder_image/Makefile8
-rwxr-xr-xscript/dev-bucket.sh3
-rwxr-xr-xscript/dev-cluster.sh9
-rwxr-xr-xscript/dev-configure.sh9
-rwxr-xr-xscript/test-smoke.sh4
6 files changed, 20 insertions, 20 deletions
diff --git a/script/builder_image/Dockerfile b/script/builder_image/Dockerfile
deleted file mode 100644
index 908c7e3c..00000000
--- a/script/builder_image/Dockerfile
+++ /dev/null
@@ -1,7 +0,0 @@
-FROM rust:buster
-RUN apt-get update && \
- apt-get install --yes libsodium-dev awscli python-pip wget rclone openssl socat && \
- rm -rf /var/lib/apt/lists/*
-RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/local/bin/mc && chmod +x /usr/local/bin/mc
-RUN rustup component add rustfmt clippy
-RUN pip install s3cmd
diff --git a/script/builder_image/Makefile b/script/builder_image/Makefile
deleted file mode 100644
index 00b0f6c7..00000000
--- a/script/builder_image/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-DOCKER=lxpz/garage_builder_amd64
-
-docker:
- docker build -t $(DOCKER):$(TAG) .
- docker push $(DOCKER):$(TAG)
- docker tag $(DOCKER):$(TAG) $(DOCKER):latest
- docker push $(DOCKER):latest
-
diff --git a/script/dev-bucket.sh b/script/dev-bucket.sh
index 8a3587be..05d8c105 100755
--- a/script/dev-bucket.sh
+++ b/script/dev-bucket.sh
@@ -6,7 +6,8 @@ SCRIPT_FOLDER="`dirname \"$0\"`"
REPO_FOLDER="${SCRIPT_FOLDER}/../"
GARAGE_DEBUG="${REPO_FOLDER}/target/debug/"
GARAGE_RELEASE="${REPO_FOLDER}/target/release/"
-PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH"
+NIX_RELEASE="${REPO_FOLDER}/result/bin/"
+PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:${NIX_RELEASE}:$PATH"
garage bucket create eprouvette
KEY_INFO=`garage key new --name opérateur`
diff --git a/script/dev-cluster.sh b/script/dev-cluster.sh
index bb5f9a08..0afdd97c 100755
--- a/script/dev-cluster.sh
+++ b/script/dev-cluster.sh
@@ -6,7 +6,8 @@ SCRIPT_FOLDER="`dirname \"$0\"`"
REPO_FOLDER="${SCRIPT_FOLDER}/../"
GARAGE_DEBUG="${REPO_FOLDER}/target/debug/"
GARAGE_RELEASE="${REPO_FOLDER}/target/release/"
-PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH"
+NIX_RELEASE="${REPO_FOLDER}/result/bin/"
+PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:${NIX_RELEASE}:$PATH"
FANCYCOLORS=("41m" "42m" "44m" "45m" "100m" "104m")
export RUST_BACKTRACE=1
@@ -63,7 +64,13 @@ fi
(garage server -c /tmp/config.$count.toml 2>&1|while read r; do echo -en "$LABEL $r\n"; done) &
done
+RETRY=120
until garage status 2>&1|grep -q Healthy ; do
+ (( RETRY-- ))
+ if (( RETRY <= 0 )); then
+ echo -en "${MAIN_LABEL} Garage did not start"
+ exit 1
+ fi
echo -en "${MAIN_LABEL} cluster starting...\n"
sleep 1
done
diff --git a/script/dev-configure.sh b/script/dev-configure.sh
index bc8352d8..fdae959b 100755
--- a/script/dev-configure.sh
+++ b/script/dev-configure.sh
@@ -6,10 +6,17 @@ SCRIPT_FOLDER="`dirname \"$0\"`"
REPO_FOLDER="${SCRIPT_FOLDER}/../"
GARAGE_DEBUG="${REPO_FOLDER}/target/debug/"
GARAGE_RELEASE="${REPO_FOLDER}/target/release/"
-PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH"
+NIX_RELEASE="${REPO_FOLDER}/result/bin/"
+PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:${NIX_RELEASE}:$PATH"
sleep 5
+RETRY=120
until garage status 2>&1|grep -q Healthy ; do
+ (( RETRY-- ))
+ if (( RETRY <= 0 )); then
+ echo "garage did not start in time, failing."
+ exit 1
+ fi
echo "cluster starting..."
sleep 1
done
diff --git a/script/test-smoke.sh b/script/test-smoke.sh
index 0417b2af..335d55e9 100755
--- a/script/test-smoke.sh
+++ b/script/test-smoke.sh
@@ -8,13 +8,13 @@ SCRIPT_FOLDER="`dirname \"$0\"`"
REPO_FOLDER="${SCRIPT_FOLDER}/../"
GARAGE_DEBUG="${REPO_FOLDER}/target/debug/"
GARAGE_RELEASE="${REPO_FOLDER}/target/release/"
-PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH"
+NIX_RELEASE="${REPO_FOLDER}/result/bin/"
+PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:${NIX_RELEASE}:$PATH"
# @FIXME Duck is not ready for testing, we have a bug
SKIP_DUCK=1
echo "⏳ Setup"
-cargo build
${SCRIPT_FOLDER}/dev-clean.sh
${SCRIPT_FOLDER}/dev-cluster.sh > /tmp/garage.log 2>&1 &
${SCRIPT_FOLDER}/dev-configure.sh