Skip to content
Snippets Groups Projects
Commit 84e99363 authored by MADELA Patrick's avatar MADELA Patrick
Browse files

The boostrap build is too long for a job and you can build Cmake with Cmake...

The boostrap build is too long for a job and you can build Cmake with Cmake but latest version requires at least Cmake 3.13. Therefore we add job to prebuild a previous compatible Cmake with legacy system cmake to build after the final cmake
parent 6808a034
Branches
Tags
No related merge requests found
Pipeline #1077 passed
variables: variables:
PREBUILD_CMAKE_VERSION: 3.18.2
CMAKE_VERSION: 3.24.2 CMAKE_VERSION: 3.24.2
stages: stages:
- prebuild
- build - build
- test - test
- package - package
# The boostrap build is too long for a job and you can build Cmake with Cmake but latest version requires at least Cmake 3.13
# Therefore we add job to prebuild a previous compatible Cmake with legacy system cmake to build after the final cmake
.prebuild:
stage: prebuild
script:
- yum install -y openssl-devel
- curl -s -OL https://github.com/Kitware/CMake/releases/download/v${PREBUILD_CMAKE_VERSION}/cmake-${PREBUILD_CMAKE_VERSION}-SHA-256.txt
- curl -s -OL https://github.com/Kitware/CMake/releases/download/v${PREBUILD_CMAKE_VERSION}/cmake-${PREBUILD_CMAKE_VERSION}.tar.gz
- echo "$(cat cmake-${PREBUILD_CMAKE_VERSION}-SHA-256.txt | grep cmake-${PREBUILD_CMAKE_VERSION}.tar.gz)" | sha256sum --check --status
- tar -xzf cmake-${PREBUILD_CMAKE_VERSION}.tar.gz
- mkdir build && cd build
- cmake3 ../cmake-${PREBUILD_CMAKE_VERSION} -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/${NAME}
- make
- make install
artifacts:
name: ${NAME}
paths:
- ${NAME}
.build: .build:
stage: build stage: build
script: script:
...@@ -15,8 +36,8 @@ stages: ...@@ -15,8 +36,8 @@ stages:
- curl -s -OL https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz - curl -s -OL https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz
- echo "$(cat cmake-${CMAKE_VERSION}-SHA-256.txt | grep cmake-${CMAKE_VERSION}.tar.gz)" | sha256sum --check --status - echo "$(cat cmake-${CMAKE_VERSION}-SHA-256.txt | grep cmake-${CMAKE_VERSION}.tar.gz)" | sha256sum --check --status
- tar -xzf cmake-${CMAKE_VERSION}.tar.gz - tar -xzf cmake-${CMAKE_VERSION}.tar.gz
- cd cmake-${CMAKE_VERSION} - mkdir build && cd build
- ./bootstrap --prefix=${CI_PROJECT_DIR}/${NAME} --parallel=2 - ${CI_PROJECT_DIR}/${PREBUILD_NAME}/bin/cmake ../cmake-${CMAKE_VERSION} -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/${NAME}
- make - make
- make install - make install
artifacts: artifacts:
...@@ -36,11 +57,20 @@ stages: ...@@ -36,11 +57,20 @@ stages:
- zip -r --symlinks ../${NAME}.zip * - zip -r --symlinks ../${NAME}.zip *
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ../${NAME}.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/cmake/${CMAKE_VERSION}/"' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ../${NAME}.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/cmake/${CMAKE_VERSION}/"'
prebuild-el6-i686:
extends: [".prebuild"]
image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el6-gcc73-x86
variables:
NAME: "cmake-${PREBUILD_CMAKE_VERSION}-linux-el6-i686"
linux-el6-i686: linux-el6-i686:
extends: [".build"] extends: [".build"]
image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el6-gcc73-x86 image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el6-gcc73-x86
variables: variables:
PREBUILD_NAME: "cmake-${PREBUILD_CMAKE_VERSION}-linux-el6-i686"
NAME: "cmake-${CMAKE_VERSION}-linux-el6-i686" NAME: "cmake-${CMAKE_VERSION}-linux-el6-i686"
needs:
- prebuild-el6-i686
test-el6-i686: test-el6-i686:
extends: [".test"] extends: [".test"]
...@@ -59,25 +89,25 @@ package-el6-i686: ...@@ -59,25 +89,25 @@ package-el6-i686:
- linux-el6-i686 - linux-el6-i686
- test-el6-i686 - test-el6-i686
linux-el7-i686: # linux-el7-i686:
extends: [".build"] # extends: [".build"]
image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el7-gcc73-x86 # image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el7-gcc73-x86
variables: # variables:
NAME: "cmake-${CMAKE_VERSION}-linux-el7-i686" # NAME: "cmake-${CMAKE_VERSION}-linux-el7-i686"
test-el7-i686: # test-el7-i686:
extends: [".test"] # extends: [".test"]
image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el7-gcc73-x86 # image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el7-gcc73-x86
variables: # variables:
NAME: "cmake-${CMAKE_VERSION}-linux-el7-i686" # NAME: "cmake-${CMAKE_VERSION}-linux-el7-i686"
needs: # needs:
- linux-el7-i686 # - linux-el7-i686
package-el7-i686: # package-el7-i686:
extends: [".package"] # extends: [".package"]
image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el7-gcc73-x86 # image: gitlab-registry.synchrotron-soleil.fr/software-control-system/containers/dev-el7-gcc73-x86
variables: # variables:
NAME: "cmake-${CMAKE_VERSION}-linux-el7-i686" # NAME: "cmake-${CMAKE_VERSION}-linux-el7-i686"
needs: # needs:
- linux-el7-i686 # - linux-el7-i686
- test-el7-i686 # - test-el7-i686
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment