Skip to content

Commit 5dbf501

Browse files
.
1 parent 3fdf97c commit 5dbf501

3 files changed

Lines changed: 43 additions & 9 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
build/
1+
build*/
22
__pycache__/
33
.env
44
/public
55
*.cpython*
66
.github/*.md
7+
.gitlab-ci-local

ci/gitlab/normal.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ Compile on Linux:
2626
- build/
2727
when: always
2828

29+
Compile on Linux (local ANAGATE archive):
30+
stage: unstagged
31+
image: $ALMA_LATEST_IMAGE
32+
script:
33+
- 'curl --fail --location --header "PRIVATE-TOKEN: ${ICS_REPO_DEPS_TOKEN}" -o /tmp/anagate.zip "https://ics-deps-repo.web.cern.ch/canmodule/anagate/20241023/AnaGateAPI-CAN-2.5-BETA-3.zip"'
34+
- cmake -B build-anagate-local -DANAGATE_LIBRARY=/tmp/anagate.zip
35+
- cmake --build build-anagate-local --config Release
36+
37+
Compile on Windows (local ANAGATE archive):
38+
stage: unstagged
39+
image: $WINDOWS_LATEST_IMAGE
40+
tags:
41+
- win2025-container
42+
script:
43+
- $anagateZip = Join-Path $env:TEMP 'anagate.zip'
44+
- Invoke-WebRequest -Headers @{ 'PRIVATE-TOKEN' = $env:ICS_REPO_DEPS_TOKEN } -OutFile $anagateZip -Uri 'https://ics-deps-repo.web.cern.ch/canmodule/anagate/20241023/AnaGateAPI-CAN-2.5-BETA-3.zip'
45+
- cmake -B build-anagate-local "-DANAGATE_LIBRARY=$anagateZip"
46+
- cmake --build build-anagate-local --config Release
47+
2948
Google Tests on Windows:
3049
stage: unstagged
3150
image: $WINDOWS_LATEST_IMAGE

cmake/anagate.cmake

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
include(FetchContent)
22

3-
set(ANAGATE_LIBRARY "https://ics-deps-repo.web.cern.ch/canmodule/anagate/20241023/AnaGateAPI-CAN-2.5-BETA-3.zip")
4-
5-
if(NOT DEFINED ENV{ICS_REPO_DEPS_TOKEN})
6-
message(FATAL_ERROR "Environment variable ICS_REPO_DEPS_TOKEN is not set. Please set this variable to proceed.")
3+
if(NOT DEFINED ANAGATE_LIBRARY)
4+
set(ANAGATE_LIBRARY "https://ics-deps-repo.web.cern.ch/canmodule/anagate/20241023/AnaGateAPI-CAN-2.5-BETA-3.zip")
75
endif()
86

9-
message(STATUS "Download URL: ${ANAGATE_LIBRARY}")
7+
set(ANAGATE_FETCHCONTENT_ARGS
8+
URL "${ANAGATE_LIBRARY}"
9+
DOWNLOAD_EXTRACT_TIMESTAMP True
10+
)
11+
12+
if(EXISTS "${ANAGATE_LIBRARY}")
13+
message(STATUS "Using local Anagate archive: ${ANAGATE_LIBRARY}")
14+
elseif(ANAGATE_LIBRARY MATCHES "^https?://")
15+
if(DEFINED ENV{ICS_REPO_DEPS_TOKEN} AND NOT "$ENV{ICS_REPO_DEPS_TOKEN}" STREQUAL "")
16+
message(STATUS "Downloading Anagate archive with authentication: ${ANAGATE_LIBRARY}")
17+
list(APPEND ANAGATE_FETCHCONTENT_ARGS
18+
HTTP_HEADER "PRIVATE-TOKEN: $ENV{ICS_REPO_DEPS_TOKEN}"
19+
)
20+
else()
21+
message(STATUS "Downloading Anagate archive without authentication: ${ANAGATE_LIBRARY}")
22+
endif()
23+
else()
24+
message(FATAL_ERROR "ANAGATE_LIBRARY must be an existing local archive or an http(s) URL. Got: ${ANAGATE_LIBRARY}")
25+
endif()
1026

1127
FetchContent_Declare(
1228
Anagate
13-
URL ${ANAGATE_LIBRARY}
14-
HTTP_HEADER "PRIVATE-TOKEN: $ENV{ICS_REPO_DEPS_TOKEN}"
15-
DOWNLOAD_EXTRACT_TIMESTAMP True
29+
${ANAGATE_FETCHCONTENT_ARGS}
1630
)
1731

1832
FetchContent_MakeAvailable(Anagate)

0 commit comments

Comments
 (0)