-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathfix-build-config.sh
More file actions
executable file
·45 lines (38 loc) · 1.18 KB
/
fix-build-config.sh
File metadata and controls
executable file
·45 lines (38 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -euo pipefail
JFROG_HOSTNAME="databricks.jfrog.io"
JFROG_REALM="Artifactory Realm"
JFROG_USERNAME="gha-service-account"
JFROG_URL="https://${JFROG_HOSTNAME}/artifactory/db-maven/"
# Configure sbt repositories
mkdir -p ~/.sbt
cat > ~/.sbt/repositories << EOF
[repositories]
local
databricks-jfrog: ${JFROG_URL}
EOF
# Configure sbt credentials
cat > ~/.sbt/.credentials << EOF
realm=${JFROG_REALM}
host=${JFROG_HOSTNAME}
user=${JFROG_USERNAME}
password=${JFROG_ACCESS_TOKEN}
EOF
# Configure global.sbt to load credentials
mkdir -p ~/.sbt/1.0
cat > ~/.sbt/1.0/global.sbt << 'EOF'
def sbtCredentialsFile = file(sys.props("user.home")) / ".sbt" / ".credentials"
credentials ++= {
if (sbtCredentialsFile.exists()) List(Credentials(sbtCredentialsFile))
else Nil
}
EOF
mkdir -p ~/.config/coursier
{
echo "jfrog.host=${JFROG_HOSTNAME}"
echo "jfrog.realm=${JFROG_REALM}"
echo "jfrog.username=${JFROG_USERNAME}"
echo "jfrog.password=${JFROG_ACCESS_TOKEN}"
} > ~/.config/coursier/credentials.properties
echo "COURSIER_REPOSITORIES=${JFROG_URL}" >> "$GITHUB_ENV"
sed -i "s|https://repo1.maven.org/maven2|https://${JFROG_USERNAME}:${JFROG_ACCESS_TOKEN}@${JFROG_URL:8}|g" ./mill