From 595fc095712974f0467b71639b61b47c8ed63e7a Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Fri, 10 Apr 2020 15:14:33 +0200 Subject: [PATCH] moved the build files outside the repository In order to prevent pollution of repository with temporary files, the build files can now be where the user wants via BUILD_ROOT_PATH makefile variable. --- Jenkinsfile | 7 ++++--- Makefile | 15 +++++++-------- scripts/release_lipase_package.bash | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 29e36a9..66af9e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ pipeline { // GRAFFY_OWNCLOUD_JENKINS_PWD's value has been obtained from https://cloud.ipr.univ-rennes1.fr as an app password and is defined in gitlab as a CI secret variable, // then this app password has been declared to jenkins's credentials as a secret text with the name graffy-cloudipr-for-jenkinsipr GRAFFY_OWNCLOUD_JENKINS_PWD = credentials('graffy-cloudipr-for-jenkinsipr') + BUILD_ROOT_PATH = $WORKSPACE/build } stages { stage('Initial setup...') { @@ -12,18 +13,18 @@ pipeline { // erase old builds if anything is left sh './scripts/cleanup.bash' sh './scripts/install_fiji.bash' - sh 'make FIJI_ROOT_PATH=$(pwd)/Fiji.app install' + sh 'make BUILD_ROOT_PATH=$BUILD_ROOT_PATH FIJI_ROOT_PATH=$(pwd)/Fiji.app install' } } stage('Testing the package...') { steps { - sh 'make FIJI_ROOT_PATH=$(pwd)/Fiji.app RAW_IMAGES_ROOT_PATH=/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images TESTS_OUTPUT_DATA_PATH=$TMP/$(whoami)/$JOB_NAME test' + sh 'make BUILD_ROOT_PATH=$BUILD_ROOT_PATH FIJI_ROOT_PATH=$(pwd)/Fiji.app RAW_IMAGES_ROOT_PATH=/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images TESTS_OUTPUT_DATA_PATH=$TMP/$(whoami)/$JOB_NAME test' } } stage('Building documentation...') { steps { echo 'Building documentation...' - sh 'make FIJI_ROOT_PATH=$(pwd)/Fiji.app RAW_IMAGES_ROOT_PATH=/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images doc' + sh 'make BUILD_ROOT_PATH=$BUILD_ROOT_PATH FIJI_ROOT_PATH=$(pwd)/Fiji.app RAW_IMAGES_ROOT_PATH=/opt/ipr/cluster/work.global/graffy/jenkins-store/lipase/raw-images doc' } } stage('Releasing package...') { diff --git a/Makefile b/Makefile index f76b2f5..42b8336 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ LIB_SRC_FILES=$(shell find ./src/lipase -name "*.py") PLUGINS_SRC_FILES=$(shell find ./src/ij-plugins -name "*.py") LIPASE_VERSION=1.01 -BUILD_ROOT_PATH=$(shell pwd)/build -PACKAGE_FILE_PATH=$(shell pwd)/lipase-$(LIPASE_VERSION).zip +BUILD_ROOT_PATH:=$(shell pwd)/build +PACKAGE_FILE_PATH=$(BUILD_ROOT_PATH)/lipase-$(LIPASE_VERSION).zip .PHONY: all all: test doc @@ -23,7 +23,7 @@ clean_doc: cd doc; make clean -$(BUILD_ROOT_PATH)/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar: $(LIB_SRC_FILES) +$(BUILD_ROOT_PATH)/ij_zip_source/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar: $(LIB_SRC_FILES) pushd ./src; \ mkdir -p $(BUILD_ROOT_PATH)/jars/Lib ; \ find ./lipase -name "*.py" > /tmp/files.txt ; \ @@ -71,10 +71,10 @@ install_ij_opencv: $(FIJI_ROOT_PATH)/ImageJ-linux64 --update update; \ fi -$(PACKAGE_FILE_PATH): $(BUILD_ROOT_PATH)/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar $(PLUGINS_SRC_FILES) - mkdir -p $(BUILD_ROOT_PATH)/plugins/Ipr ; \ - rsync -a ./src/ij-plugins/Ipr/ $(BUILD_ROOT_PATH)/plugins/Ipr/ ; \ - pushd $(BUILD_ROOT_PATH) ; \ +$(PACKAGE_FILE_PATH): $(BUILD_ROOT_PATH)/ij_zip_source/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar $(PLUGINS_SRC_FILES) + mkdir -p $(BUILD_ROOT_PATH)/ij_zip_source/plugins/Ipr ; \ + rsync -a ./src/ij-plugins/Ipr/ $(BUILD_ROOT_PATH)/ij_zip_source/plugins/Ipr/ ; \ + pushd $(BUILD_ROOT_PATH)/ij_zip_source ; \ zip -r $(PACKAGE_FILE_PATH) * ; \ popd @@ -127,4 +127,3 @@ test: test0001 imgproc_tests .PHONY: clean clean: clean_doc rm -Rf $(BUILD_ROOT_PATH) - rm -Rf $(PACKAGE_FILE_PATH) diff --git a/scripts/release_lipase_package.bash b/scripts/release_lipase_package.bash index b1ddda1..2e49b35 100755 --- a/scripts/release_lipase_package.bash +++ b/scripts/release_lipase_package.bash @@ -1,5 +1,5 @@ #!/bin/bash -LIPASE_PACKAGE_FILE_PATH=$(ls lipase*.zip) +LIPASE_PACKAGE_FILE_PATH=$(ls build/lipase*.zip) LIPASE_USER_MANUAL_PATH=$(pwd)/doc/lipase.pdf echo "LIPASE_PACKAGE_FILE_PATH=$LIPASE_PACKAGE_FILE_PATH" if [ "$GRAFFY_OWNCLOUD_JENKINS_PWD" = '' ]