aboutsummaryrefslogtreecommitdiff
path: root/app/plume/build
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2021-01-18 08:18:21 +0100
committerQuentin <quentin@dufour.io>2021-01-18 08:18:21 +0100
commitad6017eea058f7cb6fdf078783f992a4f45a3e15 (patch)
tree6620bcc9e1ea61a5689b763b9ad8280275e35e76 /app/plume/build
parent79b7273ff2a487d6721d393682c8ad3927467a75 (diff)
parentc642370def01f09d966b3b9c643cfe416ea115cf (diff)
downloadinfrastructure-ad6017eea058f7cb6fdf078783f992a4f45a3e15.tar.gz
infrastructure-ad6017eea058f7cb6fdf078783f992a4f45a3e15.zip
Merge pull request 'Reorganize app/ and add script for secret management' (#29) from test_reorganize into master
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/infrastructure/pulls/29
Diffstat (limited to 'app/plume/build')
-rw-r--r--app/plume/build/plume/Dockerfile54
-rw-r--r--app/plume/build/plume/README.md3
-rwxr-xr-xapp/plume/build/plume/plm-start9
3 files changed, 66 insertions, 0 deletions
diff --git a/app/plume/build/plume/Dockerfile b/app/plume/build/plume/Dockerfile
new file mode 100644
index 0000000..4e05424
--- /dev/null
+++ b/app/plume/build/plume/Dockerfile
@@ -0,0 +1,54 @@
+FROM rust:1.47.0-slim-buster as builder
+
+RUN apt-get update && \
+ apt-get install -y \
+ pkg-config \
+ git \
+ curl \
+ postgresql \
+ postgresql-contrib \
+ libpq-dev \
+ gettext \
+ git \
+ curl \
+ gcc \
+ make \
+ openssl \
+ libssl-dev \
+ libclang-dev
+
+ARG VERSION
+WORKDIR /opt
+RUN git clone -n https://git.joinplu.me/Plume/Plume.git plume
+
+WORKDIR /opt/plume
+RUN git checkout ${VERSION}
+
+RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
+
+# frontend
+RUN cargo install cargo-web
+RUN cargo web deploy -p plume-front --release
+# backend
+RUN cargo install --no-default-features --features postgres -f --path .
+# cli
+RUN cargo install --no-default-features --features postgres --path plume-cli
+RUN cargo clean
+
+#-----------------------------
+FROM debian:bullseye-slim
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ ca-certificates \
+ libpq5 \
+ libssl1.1
+
+WORKDIR /app
+
+COPY --from=builder /opt/plume /app
+COPY --from=builder /usr/local/cargo/bin/diesel /usr/local/bin/
+COPY --from=builder /usr/local/cargo/bin/plm /usr/local/bin/
+COPY --from=builder /usr/local/cargo/bin/plume /usr/local/bin/
+COPY plm-start /usr/local/bin/
+
+CMD ["plm-start"]
diff --git a/app/plume/build/plume/README.md b/app/plume/build/plume/README.md
new file mode 100644
index 0000000..6d86d81
--- /dev/null
+++ b/app/plume/build/plume/README.md
@@ -0,0 +1,3 @@
+Try build:
+
+sudo docker build -t superboum/plume:v1 --build-arg VERSION=003dcf861a9f55720b03d52f2f95f5f59e338809 .
diff --git a/app/plume/build/plume/plm-start b/app/plume/build/plume/plm-start
new file mode 100755
index 0000000..da9d288
--- /dev/null
+++ b/app/plume/build/plume/plm-start
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+until plm migration run;
+ do sleep 2;
+done
+plm search init
+plm instance new --domain "$DOMAIN_NAME" --name "$INSTANCE_NAME" --private
+
+plume