From fb2d01d2c8c42d57f22c29599a2b4e8a7b447eff Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 28 Feb 2018 10:04:24 +0100 Subject: [PATCH] Improved docker configuration --- .travis.yml | 2 +- Dockerfile | 7 ++++++- README.md | 2 ++ config_test.go | 2 +- importer_test.go | 2 +- thumbnails.go | 3 ++- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c449b77c..0a2ac4c2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_script: - docker-compose up --build -d script: - - docker-compose exec photoprism 'go test' + - docker-compose exec photoprism /usr/local/go/bin/go test after_script: - docker-compose down \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bc300a230..3cfa283c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,10 @@ RUN ldconfig # Hide some warnings ENV TF_CPP_MIN_LOG_LEVEL 2 -# Install Go (https://github.com/docker-library/golang/blob/221ee92559f2963c1fe55646d3516f5b8f4c91a4/1.9/stretch/Dockerfile) +RUN curl -L "https://download.opensuse.org/repositories/graphics:darktable:stable/xUbuntu_16.04/Release.key" | apt-key add - +RUN sh -c "echo 'deb http://download.opensuse.org/repositories/graphics:/darktable:/stable/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/darktable.list" + +# Install Go RUN apt-get update && apt-get install -y --no-install-recommends \ g++ \ gcc \ @@ -20,6 +23,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* +RUN apt-get upgrade -y + ENV GOLANG_VERSION 1.10 RUN set -eux; \ \ diff --git a/README.md b/README.md index f23503dd8..49d1ccd9b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ Our goal is to provide the following features (tested as a proof-of-concept): - Image search with powerful filters - Easy backup and export +![](https://www.dropbox.com/s/m1cnl8mn4s4ub8h/concept.jpg?dl=1) + Unit Tests ---------- diff --git a/config_test.go b/config_test.go index 8bc4bac56..78283ad3f 100644 --- a/config_test.go +++ b/config_test.go @@ -11,7 +11,7 @@ const testDataPath = "testdata" const testDataUrl = "https://www.dropbox.com/s/na9p9wwt98l7m5b/import.zip?dl=1" const testDataHash = "ed3bdb2fe86ea662bc863b63e219b47b8d9a74024757007f7979887d" -var darktableCli = "/Applications/darktable.app/Contents/MacOS/darktable-cli" +var darktableCli = "/usr/bin/darktable-cli" var testDataZip = GetExpandedFilename(testDataPath + "/import.zip") var originalsPath = GetExpandedFilename(testDataPath + "/originals") var thumbnailsPath = GetExpandedFilename(testDataPath + "/thumbnails") diff --git a/importer_test.go b/importer_test.go index db83cf2c8..402a4aed1 100644 --- a/importer_test.go +++ b/importer_test.go @@ -34,5 +34,5 @@ func TestImporter_GetDestinationFilename(t *testing.T) { assert.Empty(t, err) - assert.Equal(t, conf.OriginalsPath + "/2018/02/20180204_170813_B0770443A5F7.cr2", filename) + assert.Equal(t, conf.OriginalsPath + "/2018/02/20180204_180813_B0770443A5F7.cr2", filename) } \ No newline at end of file diff --git a/thumbnails.go b/thumbnails.go index f13604ca5..f9cc3a0c4 100644 --- a/thumbnails.go +++ b/thumbnails.go @@ -7,8 +7,9 @@ import ( func CreateThumbnail () { src, err := imaging.Open("testdata/lena_512.png") + if err != nil { - log.Print("Open failed: %v", err) + log.Printf("Open failed: %s", err.Error()) } // Crop the original image to 350x350px size using the center anchor.