diff options
author | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-10-20 17:04:44 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-10-20 17:04:44 +0200 |
commit | 1950387f0b222d9ca51b573a4b287f139e5248c5 (patch) | |
tree | a57f221e43fc7896288b9ff497c24e7d05c366fa /dotfiles/fretlink | |
download | dotdrop-1950387f0b222d9ca51b573a4b287f139e5248c5.tar.gz dotdrop-1950387f0b222d9ca51b573a4b287f139e5248c5.tar.zst dotdrop-1950387f0b222d9ca51b573a4b287f139e5248c5.zip |
Validation initiale
Diffstat (limited to 'dotfiles/fretlink')
-rw-r--r-- | dotfiles/fretlink/config_files/autostart/zeal.desktop | 10 | ||||
-rwxr-xr-x | dotfiles/fretlink/workdir/start | 53 |
2 files changed, 63 insertions, 0 deletions
diff --git a/dotfiles/fretlink/config_files/autostart/zeal.desktop b/dotfiles/fretlink/config_files/autostart/zeal.desktop new file mode 100644 index 0000000..27f53b7 --- /dev/null +++ b/dotfiles/fretlink/config_files/autostart/zeal.desktop | |||
@@ -0,0 +1,10 @@ | |||
1 | [Desktop Entry] | ||
2 | Version=1.0 | ||
3 | Name=Zeal | ||
4 | GenericName=Documentation Browser | ||
5 | Comment=Simple API documentation browser | ||
6 | Exec=/usr/bin/zeal | ||
7 | Icon=zeal | ||
8 | Terminal=false | ||
9 | Type=Application | ||
10 | Categories=Development; | ||
diff --git a/dotfiles/fretlink/workdir/start b/dotfiles/fretlink/workdir/start new file mode 100755 index 0000000..911c28d --- /dev/null +++ b/dotfiles/fretlink/workdir/start | |||
@@ -0,0 +1,53 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | APP="$1" | ||
4 | |||
5 | if [ -z "$APP" ]; then | ||
6 | if [ $(dirname $(pwd)) = "$HOME/workdir" ]; then | ||
7 | APP=$(basename $(pwd)) | ||
8 | else | ||
9 | echo "need an app to start" | ||
10 | exit 1 | ||
11 | fi | ||
12 | fi | ||
13 | |||
14 | if [ "$APP" != "psql" ]; then | ||
15 | cd $HOME/workdir/$APP | ||
16 | source ../environment | ||
17 | else | ||
18 | source ../environment | ||
19 | APP=psql | ||
20 | fi | ||
21 | |||
22 | function start_stack() { | ||
23 | stack exec $1; | ||
24 | } | ||
25 | |||
26 | function start_app() { | ||
27 | trap 'make stop' EXIT | ||
28 | |||
29 | if ! docker top mongo_container 2>/dev/null; then | ||
30 | docker run -d --name mongo_container -p 27017:27017 --rm -v $(pwd)/appdata:/data/db mongo:3.6 | ||
31 | echo "Waiting until mongo is started" | ||
32 | sleep 10 | ||
33 | fi | ||
34 | |||
35 | make start | ||
36 | make --directory=frontend/ start | ||
37 | } | ||
38 | |||
39 | function start_psql() { | ||
40 | export PGPASSWORD=$POSTGRESQL_ADDON_PASSWORD | ||
41 | psql -h $POSTGRESQL_ADDON_HOST -p $POSTGRESQL_ADDON_PORT -U $POSTGRESQL_ADDON_USER -d $POSTGRESQL_ADDON_DB | ||
42 | } | ||
43 | |||
44 | case "$APP" in | ||
45 | "psql") start_psql;; | ||
46 | "app") start_app;; | ||
47 | "admin-root") start_stack server;; | ||
48 | "carrier-directory") start_stack server;; | ||
49 | "freight") start_stack freight-server;; | ||
50 | "notifier") start_stack notifier-exe;; | ||
51 | "pricer") start_stack pricer;; | ||
52 | "toolbox") start_stack toolbox-api;; | ||
53 | esac | ||