From 9a7cf588295bb46d7cf44569195924d27a16cb04 Mon Sep 17 00:00:00 2001 From: Alopez <alopez@iri.upc.edu> Date: Tue, 20 Sep 2022 14:41:04 +0200 Subject: [PATCH] Updated to latest version of package generation --- .gitlab-ci_template.yml | 42 +++++++---------------------------------- CMakeLists_template.txt | 1 + new_project.sh | 28 +++++++++++++-------------- 3 files changed, 22 insertions(+), 49 deletions(-) diff --git a/.gitlab-ci_template.yml b/.gitlab-ci_template.yml index 1118540..0c97535 100644 --- a/.gitlab-ci_template.yml +++ b/.gitlab-ci_template.yml @@ -1,38 +1,10 @@ - image: docker.io/labrobotica/labrobotica:latest + image: docker.io/labrobotica/labrobotica:18.04 variables: GIT_SUBMODULE_STRATEGY: recursive - - stages: - - build - - test - - deploy - - build-package: - stage: build - script: - #- git submodule sync --recursive - #- git submodule update --init --recursive - - apt update || apt -y install ca-certificates && apt update - ##Install dependencies - #- apt -y install iri-dep1-dev iri-dep2-dev - - mkdir -pv build - - cd build - - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG .. - - make package -j $(nproc) - - artifacts: - paths: - - build/*.deb - expire_in: 2 weeks - only: - - tags - - update_repo: - stage: deploy - script: - - cd build - - "scp -i /root/.ssh/iriLabKeyNopwd -r *library-name*.deb irilabo@labrepo.iri.upc.edu:packages/" - - "ssh irilabo@labrepo.iri.upc.edu -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh library-name $(lsb_release -cs)" - only: - - tags \ No newline at end of file + FROM_RDEPENDS_CI: "false" + TAG_VERSION: $CI_COMMIT_TAG + PACKAGE_NAME: "library-name" + + include: + remote: 'https://gitlab.iri.upc.edu/labrobotica/packaging_ci/-/raw/master/packaging-ci.yml' diff --git a/CMakeLists_template.txt b/CMakeLists_template.txt index bd8284c..e33cb99 100755 --- a/CMakeLists_template.txt +++ b/CMakeLists_template.txt @@ -75,6 +75,7 @@ IF (UNIX) SET(CPACK_PACKAGING_INSTALL_PREFIX /usr) SET(CPACK_GENERATOR "DEB") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu") + SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gitlab.iri.upc.edu/<package_repo_url>") #Uncomment to add the necessary mantainer scripts SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm") diff --git a/new_project.sh b/new_project.sh index e78c24e..cc9ee79 100755 --- a/new_project.sh +++ b/new_project.sh @@ -379,20 +379,20 @@ fi sed 's/library-name/'$NAME_WITH_DASHES'/g' <.gitlab-ci_template.yml >./.gitlab-ci.yml -#Add to .gitlab-ci.yml apt install dependencies like - apt -y install iri-dep1-dev iri-dep2-dev -if [ -n "$arr" ] -then - apt_deps="" - for x in $arr - do - dep_line="iri-$x-dev" - apt_deps="$apt_deps$dep_line " - done - line_to_add="\ \ \ \ \ \ - apt -y install $apt_deps" - file=./.gitlab-ci.yml - comment="##Install dependencies" - sed -i "/${comment}/ a ${line_to_add}" ${file} -fi +# #Add to .gitlab-ci.yml apt install dependencies like - apt -y install iri-dep1-dev iri-dep2-dev +# if [ -n "$arr" ] +# then +# apt_deps="" +# for x in $arr +# do +# dep_line="iri-$x-dev" +# apt_deps="$apt_deps$dep_line " +# done +# line_to_add="\ \ \ \ \ \ - apt -y install $apt_deps" +# file=./.gitlab-ci.yml +# comment="##Install dependencies" +# sed -i "/${comment}/ a ${line_to_add}" ${file} +# fi sed 's/project_name/'$NAME'/g' <postinst_template >./scripts/debian/postinst sed 's/project_name/'$NAME'/g' <prerm_template >./scripts/debian/prerm -- GitLab