From 27badcd14482aa0c3423bfb10f42a1b4d0849b38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <Joerg.Sachse@slub-dresden.de>
Date: Fri, 23 Jul 2021 12:48:39 +0200
Subject: [PATCH] fix: ND-1993 - add functioning git checkout, improve task
 naming/documentation

---
 tasks/compile_callas_binaries.yml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/tasks/compile_callas_binaries.yml b/tasks/compile_callas_binaries.yml
index 37754e2..7a31571 100644
--- a/tasks/compile_callas_binaries.yml
+++ b/tasks/compile_callas_binaries.yml
@@ -1,5 +1,5 @@
 ---
-- name: install packages for compilation
+- name: install prerequisite packages for compilation
   apt:
     name: [
       'g++',
@@ -9,12 +9,7 @@
     ]
     state: latest
 
-- name: checkout Git repo
-  copy:
-    src: "/home/sachse/src/pdfa_webservice/"
-    dest: "/opt/pdfa_webservice/"
-
-- name: set symlinks
+- name: set symlinks for Callas PDF Engine
   file:
     state: link
     src: "/usr/local/lib/callas_pdfEngine_SDK_x64/callas_pdfEngineSDK_x64_Linux_{{ vault_callas_sdk_version }}/{{ item }}"
@@ -26,5 +21,20 @@
     - "lib"
     - "var"
 
-- name: compileme
+# ATTENTION:
+#   - This is run on the controller PC, not on the target! Needs Git binary.
+#   - This task requires Git credentials to be entered in interactive mode.
+- name: checkout PDF/A-Webservice Git repo
+  git:
+    repo: "https://git.slub-dresden.de/slub-digitalpreservation/pdfa_webservice.git"
+    dest: "/tmp/pdfa_webservice/"
+    depth: 1
+  delegate_to: 127.0.0.1
+
+- name: copy PDF/A-Webservice Git repo to managed host
+  copy:
+    src: "/tmp/pdfa_webservice/"
+    dest: "/opt/pdfa_webservice/"
+
+- name: compile PDF/A-Webservice binary
   shell: 'CXXFLAGS="-std=c++11" make --directory /opt/pdfa_webservice/src/'
-- 
GitLab