Skip to content

Commit 6763f8d

Browse files
Add spring ai deploy script (#301)
Signed-off-by: Anders Swanson <anders.swanson@oracle.com>
1 parent 7b74a03 commit 6763f8d

3 files changed

Lines changed: 86 additions & 0 deletions

File tree

spring-ai-oracle/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ Optional config file authentication overrides use `OCI_CONFIG_FILE`, `OCI_PROFIL
184184

185185
Set `OCI_GENAI_MODEL` to run one chat model and `OCI_GENAI_EMBEDDING_MODEL` to run one embedding model.
186186

187+
## Deployment
188+
189+
Use the deploy script from the `spring-ai-oracle` directory to set the Spring AI Oracle reactor version and deploy the parent, model, auto-configuration, and starter artifacts to the target Maven repository.
190+
191+
```bash
192+
./scripts/deploy -v 2.0.0 -u https://repo.example.com/releases -r spring-cloud-oci-releases
193+
```
194+
195+
The script skips tests during deployment and prints the `com.oracle.spring.ai` coordinates created for upload.
196+
187197
## License
188198

189199
Copyright (c) 2026, Oracle and/or its affiliates.

spring-ai-oracle/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
1818

1919
<groupId>com.oracle.spring.ai</groupId>
2020
<artifactId>spring-ai-oracle-parent</artifactId>
21+
<version>2.0.0</version>
2122
<packaging>pom</packaging>
2223

2324
<name>Spring AI Oracle</name>
@@ -66,6 +67,11 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
6667
<maven.compiler.target>${java.version}</maven.compiler.target>
6768
<spring-boot.version>4.1.0</spring-boot.version>
6869
<oci-sdk.version>3.86.1</oci-sdk.version>
70+
71+
<!-- Distribution management -->
72+
<repository.id>artifactory</repository.id>
73+
<repository.name>spring-cloud-oci-releases</repository.name>
74+
<repository.url>changeme</repository.url>
6975
</properties>
7076

7177
<dependencyManagement>
@@ -102,4 +108,17 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
102108
</dependencies>
103109
</dependencyManagement>
104110

111+
<distributionManagement>
112+
<repository>
113+
<id>${repository.id}</id>
114+
<name>${repository.name}</name>
115+
<url>${repository.url}</url>
116+
</repository>
117+
<snapshotRepository>
118+
<id>${repository.id}</id>
119+
<name>${repository.name}</name>
120+
<url>${repository.url}</url>
121+
</snapshotRepository>
122+
</distributionManagement>
123+
105124
</project>

spring-ai-oracle/scripts/deploy

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
# Copyright (c) 2026, Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
set -euo pipefail
6+
7+
usage() {
8+
echo "Usage: $0 -v version -u repository.url -r repository.name "
9+
exit 1
10+
}
11+
12+
VERSION=""
13+
REPOSITORY_NAME=""
14+
REPOSITORY_URL=""
15+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16+
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
17+
18+
if ! command -v mvn >/dev/null 2>&1; then
19+
echo "Error: 'mvn' binary not found on PATH. Install 'mvn' before running this script."
20+
exit 1
21+
fi
22+
23+
while getopts ":v:r:u:" opt; do
24+
case $opt in
25+
v) VERSION="$OPTARG";;
26+
u) REPOSITORY_URL="$OPTARG";;
27+
r) REPOSITORY_NAME="$OPTARG";;
28+
\?) echo "Invalid option -$OPTARG" >&2; usage;;
29+
:) echo "Option -$OPTARG requires an argument." >&2; usage;;
30+
esac
31+
done
32+
33+
if [ -z "$VERSION" ] || [ -z "$REPOSITORY_URL" ] || [ -z "$REPOSITORY_NAME" ]; then
34+
echo "Error: -v, -u, and -r options are required."
35+
usage
36+
fi
37+
38+
cd "$PROJECT_DIR"
39+
40+
echo "Setting project version = $VERSION"
41+
42+
mvn -q versions:set -DnewVersion="$VERSION"
43+
44+
echo "Successfully set project version = $VERSION"
45+
46+
echo "Deploying project to ${REPOSITORY_URL}/${REPOSITORY_NAME}"
47+
48+
mvn -q deploy -Drepository.url="$REPOSITORY_URL" -Drepository.name="$REPOSITORY_NAME" -DskipTests
49+
50+
echo "Successfully deployed project to ${REPOSITORY_URL}/${REPOSITORY_NAME}"
51+
52+
# shellcheck disable=SC2016
53+
PACKAGES="$(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q)"
54+
printf "The following artifacts have been created for upload:\n\n"
55+
for PACKAGE in $PACKAGES; do
56+
echo "com.oracle.spring.ai:${PACKAGE}:${VERSION}"
57+
done

0 commit comments

Comments
 (0)