Fix deploy scripts

main
Eric Ihli 4 years ago
parent 9b6f26ba0b
commit be67fcc9ec

@ -17,8 +17,6 @@ build: FORCE
FORCE: FORCE:
push: FORCE push: FORCE
rsync -aP web/LottoEmail.jar root@165.227.27.168:/root rsync -aP web/darklimericks.jar root@165.227.16.47:/root/darklimericks/web/
deploy: LottoEmail.jar
ssh root@165.227.27.168 java -jar /root/LottoEmail.jar
# end # end

@ -1,5 +1,6 @@
#+TITLE: Database setup #+TITLE: Database setup
This directory contains necessities for initializing and running a database This directory contains necessities for initializing and running a database
locally inside a docker container. locally inside a docker container.
@ -23,7 +24,7 @@ Running requires the following environment variables.
#+BEGIN_SRC sh #+BEGIN_SRC sh
docker build -t db . docker build -t darklimericks-db .
#+END_SRC #+END_SRC
#+BEGIN_SRC sh :tangle run.sh :tangle-mode (identity #o755) #+BEGIN_SRC sh :tangle run.sh :tangle-mode (identity #o755)
@ -40,7 +41,7 @@ docker run \
-e POSTGRES_USER=$POSTGRES_USER \ -e POSTGRES_USER=$POSTGRES_USER \
-v $PGDATA:/var/lib/postgresql/data \ -v $PGDATA:/var/lib/postgresql/data \
-p 5432:5432 \ -p 5432:5432 \
db darklimericks-db
#+END_SRC #+END_SRC
#+BEGIN_SRC sh #+BEGIN_SRC sh

@ -1,14 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env sh
set -euo pipefail
PGDATA=${PGDATA:-"$(pwd)/data/dev"} PGDATA=${PGDATA:-"$(pwd)/data/dev"}
POSTGRES_USER=${POSTGRES_USER:-"dev"} POSTGRES_USER=${POSTGRES_USER:-"dev"}
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-"dev"} POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-"dev"}
docker run \ docker run \
--name darklimericks-db \ --name db \
-e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \ -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
-e POSTGRES_USER=$POSTGRES_USER \ -e POSTGRES_USER=$POSTGRES_USER \
-v $PGDATA:/var/lib/postgresql/data \ -v $PGDATA:/var/lib/postgresql/data \
-p 127.0.0.1:5432:5432 \ -p 5432:5432 \
darklimericks-db darklimericks-db

@ -11,8 +11,8 @@ KVDATA=${KVDATA:-"$(pwd)/data/dev"}
docker run \ docker run \
-p 127.0.0.1:6379:6379 \ -p 127.0.0.1:6379:6379 \
-v $KVDATA:/data \ -v $KVDATA:/data \
--name darklimericks-kv \ --name kv \
redis --appendonly yes darklimericks-kv --appendonly yes
#+END_SRC #+END_SRC
#+BEGIN_SRC sh :tangle start.sh :tangle-mode (identity #o755) #+BEGIN_SRC sh :tangle start.sh :tangle-mode (identity #o755)

@ -6,5 +6,5 @@ KVDATA=${KVDATA:-"$(pwd)/data/dev"}
docker run \ docker run \
-p 127.0.0.1:6379:6379 \ -p 127.0.0.1:6379:6379 \
-v $KVDATA:/data \ -v $KVDATA:/data \
--name darklimericks-kv \ --name kv \
redis --appendonly yes darklimericks-kv --appendonly yes

@ -18,15 +18,26 @@
(defn -main [] (defn -main []
(try (try
(let [system (->> "server/config.edn" (let [config (->> "server/config.edn"
io/resource io/resource
slurp slurp
ig/read-string ig/read-string)
ig/prep _ (ig/load-namespaces config)
ig/init)] system (-> config
ig/prep
ig/init)]
(timbre/info "Running with config: server/config.edn" ) (timbre/info "Running with config: server/config.edn" )
system) system)
(catch Throwable e (catch Throwable e
(.printStackTrace e) (.printStackTrace e)
(System/exit 1)))) (System/exit 1))))
(comment
(def m (-main))
(->> "server/config.edn"
io/resource
slurp
ig/read-string
ig/load-namespaces
)
)

@ -1,6 +1,5 @@
(ns com.darklimericks.server.limericks (ns com.darklimericks.server.limericks
(:require [clojure.string :as string] (:require [clojure.string :as string]
[clojure.core.async :as async]
[reitit.core :as reitit] [reitit.core :as reitit]
[com.darklimericks.db.artists :as artists] [com.darklimericks.db.artists :as artists]
[com.darklimericks.db.albums :as albums] [com.darklimericks.db.albums :as albums]

Loading…
Cancel
Save