Skip to content

Commit 6063a70

Browse files
committed
SCANPY-175 Unify jfrog configuration command lines
1 parent d6326d3 commit 6063a70

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.cirrus.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ win_ssd_and_clone:
5858
git reset --hard $CIRRUS_CHANGE_IN_REPO
5959
fi
6060
61+
.jfrog__config_template: &JFROG_CONFIG_TEMPLATE
62+
jfrog_config_script:
63+
- $JF_ALIAS config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PRIVATE_ACCESS_TOKEN"
64+
- $JF_ALIAS poetry-config --server-id-resolve repox --repo-resolve sonarsource-pypi
65+
- $JF_ALIAS poetry install --build-name="$CIRRUS_REPO_NAME" --build-number="$CI_BUILD_NUMBER"
66+
67+
.jfrog_windows_config_template: &JFROG_WIN_CONFIG_TEMPLATE
68+
env:
69+
JF_ALIAS: "jf"
70+
<<: *JFROG_CONFIG_TEMPLATE
71+
72+
.jfrog_MAC_LINUX_config_template: &JFROG_MAC_LINUX_CONFIG_TEMPLATE
73+
env:
74+
JF_ALIAS: "jfrog"
75+
<<: *JFROG_CONFIG_TEMPLATE
76+
6177
poetry_win_install: &POETRY_WIN_INSTALL
6278
<<: *WINDOWS_VM_DEFINITION
6379
<<: *WIN_SSD_AND_CLONE
@@ -71,9 +87,7 @@ poetry_win_install: &POETRY_WIN_INSTALL
7187
- source cirrus-env QA
7288
- pip install poetry=="$POETRY_VERSION"
7389
- source set_poetry_build_version "$CI_BUILD_NUMBER"
74-
- jf config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PRIVATE_ACCESS_TOKEN"
75-
- jf poetry-config --server-id-resolve repox --repo-resolve sonarsource-pypi
76-
- jf poetry install --build-name="$CIRRUS_REPO_NAME" --build-number="$CI_BUILD_NUMBER"
90+
<<: *JFROG_WIN_CONFIG_TEMPLATE
7791

7892
poetry_cache_template: &POETRY_CACHE
7993
poetry_cache:
@@ -85,9 +99,7 @@ poetry_cache_template: &POETRY_CACHE
8599
poetry_install_script:
86100
- source set_poetry_build_version "$CI_BUILD_NUMBER"
87101
- echo "PROJECT_VERSION=$PROJECT_VERSION" >> $CIRRUS_ENV
88-
- jfrog config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PRIVATE_ACCESS_TOKEN"
89-
- jfrog poetry-config --server-id-resolve repox --repo-resolve sonarsource-pypi
90-
- jfrog poetry install --build-name="$CIRRUS_REPO_NAME" --build-number="$CI_BUILD_NUMBER"
102+
<<: *JFROG_MAC_LINUX_CONFIG_TEMPLATE
91103

92104
.poetry_linux_template: &POETRY_LINUX_TEMPLATE
93105
<<: *POETRY_TEMPLATE
@@ -102,9 +114,7 @@ poetry_cache_template: &POETRY_CACHE
102114
poetry_install_script:
103115
- brew install poetry
104116
- poetry config keyring.enabled false # Keyring is locked in macOS VM and not needed for downloading dependencies
105-
- jfrog config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PRIVATE_ACCESS_TOKEN"
106-
- jfrog poetry-config --server-id-resolve repox --repo-resolve sonarsource-pypi
107-
- jfrog poetry install --build-name="$CIRRUS_REPO_NAME" --build-number="$CI_BUILD_NUMBER"
117+
<<: *JFROG_MAC_LINUX_CONFIG_TEMPLATE
108118

109119
macos_worker_template: &MACOS_WORKER_DEFINITION
110120
persistent_worker:
@@ -159,13 +169,14 @@ documentation_task:
159169
- poetry run python tools/generate_cli_documentation.py
160170
- git diff --exit-code CLI_ARGS.md
161171

162-
# For NEXT analysis we don't need to set the build versions
163172
analysis_linux_task:
164173
<<: *POETRY_CACHE
165174
eks_container:
166175
<<: *LINUX_CONTAINER_DEFINITION
167176
alias: analysis
168177
name: "NEXT Analysis"
178+
# For NEXT analysis we don't need to set the build versions, but we still need to access jfrog to recover the dependencies
179+
<<: *JFROG_MAC_LINUX_CONFIG_TEMPLATE
169180
analysis_script:
170181
- poetry install
171182
- poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests

0 commit comments

Comments
 (0)