Andrea Fazzi 5 vuotta sitten
vanhempi
commit
3c4be08dc9
4 muutettua tiedostoa jossa 19 lisäystä ja 15 poistoa
  1. 6 13
      Dockerfile
  2. 11 0
      Makefile
  3. 1 1
      generator/generators/list/list.go
  4. 1 1
      watch.sh

+ 6 - 13
Dockerfile

@@ -1,25 +1,18 @@
 FROM golang
 
 RUN apt-get update -qq && apt-get install -y netcat
-
-# RUN apt-get install -y -q pandoc
+RUN apt-get install -y -q libsm6 libcups2 libcairo2 libdbus-1-3 libxinerama1
 
 WORKDIR /tmp
 RUN wget https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb
-
 RUN wget https://download.documentfoundation.org/libreoffice/stable/6.2.7/deb/x86_64/LibreOffice_6.2.7_Linux_x86-64_deb.tar.gz
-RUN cd LibreOffice_6.2.7_Linux_x86-64_deb
-RUN dpkg -i *.deb
-
-# RUN mkdir -p /pandoc
-# COPY pandoc/pandoc-2.7.3-1-amd64.deb /pandoc
-# RUN ls -l
 
+RUN tar xvzf LibreOffice_6.2.7_Linux_x86-64_deb.tar.gz
+WORKDIR LibreOffice_6.2.7.1_Linux_x86-64_deb/DEBS
+RUN dpkg -i *.deb
+RUN ln -s /usr/local/bin/libreoffice6.2 /usr/local/bin/libreoffice
+WORKDIR /tmp
 RUN dpkg -i ./pandoc-2.7.3-1-amd64.deb
-
-# Install latest stable LibreOffice
-RUN apt-get install -y -q libreoffice \
-    && apt-get remove -q -y libreoffice-gnome
     
 ENV PATH=$GOPATH/bin:$PATH
 RUN mkdir -p $GOPATH/src/gogs.carducci-dante.gov.it/karmen

+ 11 - 0
Makefile

@@ -0,0 +1,11 @@
+PHONY: all
+
+run:
+	docker-compose -f compose/karmen/docker-compose.yml down
+	docker-compose -f compose/karmen/docker-compose.yml up --build -d
+	echo "Uploading files to the cloud..."
+	sleep 15
+	curl -u admin:password http://localhost:8080/remote.php/webdav/Documents/list.tpl.md -X PUT --data-binary @"./generator/generators/list/list.tpl.md"
+	curl -u admin:password http://localhost:8080/remote.php/webdav/Documents/reference.docx -X PUT --data-binary @"./generator/generators/list/reference.docx"
+
+all: run

+ 1 - 1
generator/generators/list/list.go

@@ -202,7 +202,7 @@ func (generator *ListGenerator) Run() {
 		cloudPath = job.Document.CloudPath
 	} else {
 		outputPath = "output"
-		cloudPath = generator.CloudPath
+		cloudPath = "Documents"
 	}
 
 	if err := os.MkdirAll(outputPath, 0777); err != nil {

+ 1 - 1
watch.sh

@@ -4,7 +4,7 @@ while inotifywait -r -e modify ./; do
     docker-compose -f compose/karmen/docker-compose.yml down
     docker-compose -f compose/karmen/docker-compose.yml up --build -d
     echo "Uploading files to the cloud..."
-    sleep 10
+    sleep 15
     curl -u admin:password http://localhost:8080/remote.php/webdav/Documents/list.tpl.md -X PUT --data-binary @"./generator/generators/list/list.tpl.md"
     curl -u admin:password http://localhost:8080/remote.php/webdav/Documents/reference.odt -X PUT --data-binary @"./generator/generators/list/reference.odt"
 done