From be67fcc9ecefe8d54be80d0f054e64ee591d3112 Mon Sep 17 00:00:00 2001 From: Eric Ihli Date: Tue, 15 Dec 2020 11:15:21 -0800 Subject: [PATCH] Fix deploy scripts --- Makefile | 4 +--- db/README.org | 5 +++-- db/run.sh | 7 +++---- kv/README.org | 4 ++-- kv/run.sh | 4 ++-- web/src/com/darklimericks/server/core.clj | 19 +++++++++++++++---- .../com/darklimericks/server/limericks.clj | 1 - 7 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 3410a0a..1471848 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,6 @@ build: FORCE 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 diff --git a/db/README.org b/db/README.org index 4459e06..4aa4075 100644 --- a/db/README.org +++ b/db/README.org @@ -1,5 +1,6 @@ #+TITLE: Database setup + This directory contains necessities for initializing and running a database locally inside a docker container. @@ -23,7 +24,7 @@ Running requires the following environment variables. #+BEGIN_SRC sh -docker build -t db . +docker build -t darklimericks-db . #+END_SRC #+BEGIN_SRC sh :tangle run.sh :tangle-mode (identity #o755) @@ -40,7 +41,7 @@ docker run \ -e POSTGRES_USER=$POSTGRES_USER \ -v $PGDATA:/var/lib/postgresql/data \ -p 5432:5432 \ - db + darklimericks-db #+END_SRC #+BEGIN_SRC sh diff --git a/db/run.sh b/db/run.sh index 87ce107..8269e54 100755 --- a/db/run.sh +++ b/db/run.sh @@ -1,14 +1,13 @@ -#!/usr/bin/env bash -set -euo pipefail +#!/usr/bin/env sh PGDATA=${PGDATA:-"$(pwd)/data/dev"} POSTGRES_USER=${POSTGRES_USER:-"dev"} POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-"dev"} docker run \ - --name darklimericks-db \ + --name db \ -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \ -e POSTGRES_USER=$POSTGRES_USER \ -v $PGDATA:/var/lib/postgresql/data \ - -p 127.0.0.1:5432:5432 \ + -p 5432:5432 \ darklimericks-db diff --git a/kv/README.org b/kv/README.org index ad65c74..ef61e7b 100644 --- a/kv/README.org +++ b/kv/README.org @@ -11,8 +11,8 @@ KVDATA=${KVDATA:-"$(pwd)/data/dev"} docker run \ -p 127.0.0.1:6379:6379 \ -v $KVDATA:/data \ - --name darklimericks-kv \ - redis --appendonly yes + --name kv \ + darklimericks-kv --appendonly yes #+END_SRC #+BEGIN_SRC sh :tangle start.sh :tangle-mode (identity #o755) diff --git a/kv/run.sh b/kv/run.sh index d73d54d..6490a88 100755 --- a/kv/run.sh +++ b/kv/run.sh @@ -6,5 +6,5 @@ KVDATA=${KVDATA:-"$(pwd)/data/dev"} docker run \ -p 127.0.0.1:6379:6379 \ -v $KVDATA:/data \ - --name darklimericks-kv \ - redis --appendonly yes + --name kv \ + darklimericks-kv --appendonly yes diff --git a/web/src/com/darklimericks/server/core.clj b/web/src/com/darklimericks/server/core.clj index 4329db3..c384600 100644 --- a/web/src/com/darklimericks/server/core.clj +++ b/web/src/com/darklimericks/server/core.clj @@ -18,15 +18,26 @@ (defn -main [] (try - (let [system (->> "server/config.edn" + (let [config (->> "server/config.edn" io/resource slurp - ig/read-string - ig/prep - ig/init)] + ig/read-string) + _ (ig/load-namespaces config) + system (-> config + ig/prep + ig/init)] (timbre/info "Running with config: server/config.edn" ) system) (catch Throwable e (.printStackTrace e) (System/exit 1)))) +(comment + (def m (-main)) + (->> "server/config.edn" + io/resource + slurp + ig/read-string + ig/load-namespaces + ) + ) diff --git a/web/src/com/darklimericks/server/limericks.clj b/web/src/com/darklimericks/server/limericks.clj index 3273365..5ac9e34 100644 --- a/web/src/com/darklimericks/server/limericks.clj +++ b/web/src/com/darklimericks/server/limericks.clj @@ -1,6 +1,5 @@ (ns com.darklimericks.server.limericks (:require [clojure.string :as string] - [clojure.core.async :as async] [reitit.core :as reitit] [com.darklimericks.db.artists :as artists] [com.darklimericks.db.albums :as albums]