Parcourir la source

[photoview] Fix deploys

Colin Powell il y a 3 ans
Parent
commit
126386f29d

+ 16 - 4
ansible/roles/photoview/tasks/main.yml

@@ -1,7 +1,7 @@
 ---
 - name: Dependencies installed
   community.general.pkgng:
-    name: git,go,blas,dlib-cpp,lapacke,libjpeg-turbo,npm-node10,darktable,ffmpeg
+    name: git,go,openblas,cblas,dlib-cpp,lapacke,libjpeg-turbo,npm-node14,darktable,ffmpeg,p5-Image-ExifTool,pkgconf,libheif,bash
     state: latest
 
 - name: Source folder exists
@@ -35,6 +35,9 @@
 - name: Library for dlib linked
   file: src=/usr/local/lib/libdlib.so dest=/usr/lib/libdlib.so state=link
 
+- name: Libraries for cblas linked
+  file: src=/usr/local/include/cblas.h dest=/usr/include/cblas.h state=link
+
 - name: Link lapack libraries
   shell: "ln -s /usr/local/lib/liblapack* /usr/lib/"
   ignore_errors: true
@@ -43,8 +46,8 @@
   shell: "ln -s /usr/local/lib/libjpeg* /usr/lib/"
   ignore_errors: true
 
-- name: Link blas libraries
-  shell: "ln -s /usr/local/lib/libblas* /usr/lib/"
+- name: Link cblas libraries
+  shell: "ln -s /usr/local/lib/libcblas* /usr/lib/"
   ignore_errors: true
 
 - name: Photoview source @ master
@@ -70,7 +73,7 @@
 
 - name: Photoview UI installed
   shell:
-    cmd: npm install
+    cmd: npm install && npm run build
     chdir: /usr/local/src/photoview/ui
 
 - name: Photoview API built
@@ -78,6 +81,15 @@
     cmd: go build .
     chdir: /usr/local/src/photoview/api
 
+- name: Nginx location file installed
+  ansible.builtin.copy:
+    src: nginx.conf
+    dest: /usr/local/etc/nginx/locations/photoview.conf
+  notify: Nginx restarted
+
+# TODO We have to comment out:
+#    vi ~/go/pkg/mod/github.com/strukturag/libheif@v1.12.0/go/heif/heif.go
+#    line 269
 - name: Photoview supervisor file installed
   template:
     src: supervisor.conf.j2

+ 1 - 1
ansible/roles/photoview/templates/api.env.j2

@@ -1,5 +1,5 @@
 PHOTOVIEW_DATABASE_DRIVER=postgres
-PHOTOVIEW_POSTGRES_URL=postgres://photoview:{{photoview_db_pass}}@localhost:5432/photoview
+PHOTOVIEW_POSTGRES_URL=postgres://photoview:{{photoview_db_pass}}@db.service:5432/photoview
 PHOTOVIEW_LISTEN_IP=0.0.0.0
 PHOTOVIEW_LISTEN_PORT=4001
 

+ 2 - 12
ansible/roles/photoview/templates/supervisor.conf.j2

@@ -1,15 +1,5 @@
-[program:photoview-ui]
-environment=PHOTOVIEW_API_ENDPOINT=http://{{ansible_hostname}}.local:4001/
-command=/usr/local/bin/bash -lc "cd /usr/local/src/photoview/ui && npm start"
-directory=/usr/local/src/photoview/ui
-autostart=true
-autorestart=true
-stdout_logfile=/var/log/photoview-ui.log
-stderr_logfile=/var/log/photoview-ui.err.log
-stopsignal=QUIT
-
-[program:photoview-api]
-environment=PHOTOVIEW_DATABASE_DRIVER=postgres,PHOTOVIEW_POSTGRES_URL='postgres://photoview:{{photoview_db_pass}}@db.local:5432/photoview',PHOTOVIEW_LISTEN_IP=0.0.0.0,PHOTOVIEW_LISTEN_PORT=4001,PHOTOVIEW_API_ENDPOINT=http://{{ansible_hostname}}.local:4001/,PHOTOVIEW_UI_ENDPOINT=http://{{ansible_hostname}}.local:1234/,MAPBOX_TOKEN={{mapbox_api_key}},PHOTOVIEW_DEVELOPMENT_MODE=0
+[program:photoview]
+environment=PHOTOVIEW_DATABASE_DRIVER=postgres,PHOTOVIEW_POSTGRES_URL='postgres://photoview:{{photoview_db_pass}}@db.service:5432/photoview',PHOTOVIEW_LISTEN_IP=0.0.0.0,PHOTOVIEW_LISTEN_PORT=4001,PHOTOVIEW_API_ENDPOINT=https://photos.unbl.ink/api/,PHOTOVIEW_UI_ENDPOINT=https://photos.unbl.ink/,MAPBOX_TOKEN={{mapbox_api_key}},PHOTOVIEW_DEVELOPMENT_MODE=0
 command=/usr/local/bin/bash -lc "/usr/local/src/photoview/api/api"
 directory=/usr/local/src/photoview/api
 autostart=true