From bf26d9fa6e1b29c01541b3e46b38340365f2e09e Mon Sep 17 00:00:00 2001
From: Magnus Jacobsson <Magnus.Jacobsson@berotec.se>
Date: Thu, 2 Apr 2020 08:10:16 +0200
Subject: [PATCH] Use ${HOME} to access rpm build directory

The absolute path on GitLab runners is different from our private
runners.

rpmbuild produces the build in the home directory, not in the current
directory. At least in Docker containers on GitLab runners these are
not the same.
---
 .gitlab-ci.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b59ebc516..687a70752 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,7 +22,7 @@ portable-source:
 .build_template: &rpm_build_definition
     stage: build
     script:
-        - rm -rf /home/gitlab-runner/rpmbuild
+        - rm -rf ${HOME}/rpmbuild
         - GV_VERSION=$( cat VERSION )
         - COLLECTION=$( cat COLLECTION )
         - rpmbuild -ta graphviz-${GV_VERSION}.tar.gz
@@ -34,9 +34,9 @@ portable-source:
         - mkdir -p ${DIR}/os/${ARCH}
         - mkdir -p ${DIR}/debug/${ARCH}
         - mkdir -p ${DIR}/source
-        - mv /home/gitlab-runner/rpmbuild/SRPMS/*.src.rpm ${DIR}/source/
-        - mv /home/gitlab-runner/rpmbuild/RPMS/*/*debuginfo*rpm ${DIR}/debug/${ARCH}/
-        - mv /home/gitlab-runner/rpmbuild/RPMS/*/*.rpm ${DIR}/os/${ARCH}/
+        - mv ${HOME}/rpmbuild/SRPMS/*.src.rpm ${DIR}/source/
+        - mv ${HOME}/rpmbuild/RPMS/*/*debuginfo*rpm ${DIR}/debug/${ARCH}/
+        - mv ${HOME}/rpmbuild/RPMS/*/*.rpm ${DIR}/os/${ARCH}/
     artifacts:
         when: on_success
         expire_in: 1 week
-- 
2.40.0