Skip to content

Commit 49db41e

Browse files
committed
Default CLOUDSMITH_DOWNLOADS_DOMAIN to packages.ft.com
1 parent 5548f8f commit 49db41e

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

src/commands/set_env_vars_for_pip.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ steps:
1111
- authenticate_with_oidc:
1212
service_identifier: <<parameters.service_identifier>>
1313
- run:
14-
name: Prepare script parameters
14+
name: Configure Cloudsmith domains
15+
command: |
16+
<<include(scripts/configure_cloudsmith_domains.sh)>>
17+
- run:
18+
name: Configure Cloudsmith repository
1519
command: |
1620
echo "export CLOUDSMITH_REPOSITORY_IDENTIFIER=\"<<parameters.repository_identifier>>\"" >> $BASH_ENV
1721
- run:
1822
name: Set environment variables for pip
19-
command: <<include(scripts/set_env_vars_for_pip.sh)>>
23+
command: |
24+
<<include(scripts/set_env_vars_for_pip.sh)>>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
if [ -z "$CLOUDSMITH_DOWNLOADS_DOMAIN" ]
4+
then
5+
echo "export CLOUDSMITH_DOWNLOADS_DOMAIN=\"packages.ft.com\"" >> $BASH_ENV
6+
fi
7+

src/scripts/set_env_vars_for_pip.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set +e
77

88
if [ -z "$CLOUDSMITH_SERVICE_IDENTIFIER" ] || [ -z "$CLOUDSMITH_OIDC_TOKEN" ]
99
then
10-
echo "Unable to find an OIDC token to use. Please ensure the authenticate-with-oidc command has been run before this command."
10+
echo "Unable to find an OIDC token to use. Please ensure the authenticate_with_oidc command has been run before this command."
1111
exit 1
1212
fi
1313

@@ -17,10 +17,17 @@ then
1717
exit 1
1818
fi
1919

20-
CLOUDSMITH_PIP_INDEX_URL="https://$CLOUDSMITH_SERVICE_IDENTIFIER:$CLOUDSMITH_OIDC_TOKEN@packages.ft.com/basic/$CLOUDSMITH_REPOSITORY_IDENTIFIER/python/simple/"
20+
if [ -z "$CLOUDSMITH_DOWNLOADS_DOMAIN" ]
21+
then
22+
echo "Unable to set environment variables for pip. Env var CLOUDSMITH_DOWNLOADS_DOMAIN is not defined."
23+
exit 1
24+
fi
25+
26+
27+
CLOUDSMITH_PIP_INDEX_URL="https://$CLOUDSMITH_SERVICE_IDENTIFIER:$CLOUDSMITH_OIDC_TOKEN@$CLOUDSMITH_DOWNLOADS_DOMAIN/basic/$CLOUDSMITH_REPOSITORY_IDENTIFIER/python/simple/"
2128

2229
echo "export CLOUDSMITH_PIP_INDEX_URL=\"$CLOUDSMITH_PIP_INDEX_URL\"" >> "$BASH_ENV"
2330

2431
echo "The following environment variables have been exported. Note, the OIDC token has been masked below."
2532
echo ""
26-
echo "CLOUDSMITH_PIP_INDEX_URL=https://$CLOUDSMITH_SERVICE_IDENTIFIER:********@packages.ft.com/basic/$CLOUDSMITH_REPOSITORY_IDENTIFIER/python/simple/"
33+
echo "CLOUDSMITH_PIP_INDEX_URL=https://$CLOUDSMITH_SERVICE_IDENTIFIER:********@$CLOUDSMITH_DOWNLOADS_DOMAIN/basic/$CLOUDSMITH_REPOSITORY_IDENTIFIER/python/simple/"

0 commit comments

Comments
 (0)