|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | 3 | # This script essentially does what ./build.ps1 + the dockerfiles do, but without building container images. |
4 | | -# Use this script if you need to troubleshoot or do something new with the servers that get embedded in the images |
| 4 | +# Use this script if you need to troubleshoot or do something new with the servers that get embedded in the images. |
5 | 5 |
|
6 | 6 | if [ "$#" -eq 0 ] |
7 | 7 | then |
8 | 8 | echo "You must specify the server to build. Supported options include config-server, eureka-server and spring-boot-admin." |
9 | 9 | exit 1 |
10 | 10 | fi |
11 | 11 |
|
12 | | -JVM="21" |
13 | | -bootVersion="3.5.6" |
14 | | - |
15 | 12 | if [ "$1" == "config-server" ]; then |
16 | 13 | appName="ConfigServer" |
17 | | - serverVersion="4.3.0" |
18 | 14 | dependencies="cloud-config-server,actuator,cloud-eureka,security" |
19 | 15 | elif [ "$1" == "eureka-server" ]; then |
20 | 16 | appName="EurekaServer" |
21 | | - serverVersion="4.3.0" |
22 | 17 | dependencies="cloud-eureka-server,actuator" |
23 | 18 | elif [ "$1" == "spring-boot-admin" ]; then |
24 | 19 | appName="SpringBootAdmin" |
25 | | - serverVersion="3.5.5" |
26 | 20 | dependencies="codecentric-spring-boot-admin-server" |
27 | 21 | else |
28 | 22 | echo "$1 is not currently supported by this script" |
29 | 23 | exit 2 |
30 | 24 | fi |
| 25 | + |
31 | 26 | sourceDirectory=$1 |
32 | 27 | serverName=${sourceDirectory//-/} |
33 | 28 | tempDir="$serverName-temp" |
| 29 | +JVM="21" |
| 30 | +bootVersion="3.5.6" |
| 31 | +serverVersion="$(cat $sourceDirectory/metadata/IMAGE_VERSION)" |
| 32 | + |
| 33 | +echo "From source: $sourceDirectory | Building server: $serverName@$serverVersion | In temp directory: $tempDir" |
34 | 34 |
|
35 | | -echo "Source: $sourceDirectory | Server: $serverName | TempDir: $tempDir" |
36 | 35 | rm -rf $tempDir |
37 | 36 | mkdir $tempDir |
38 | 37 | cd $tempDir |
@@ -61,8 +60,8 @@ for patch in patches/*.patch; do \ |
61 | 60 | cd ..; \ |
62 | 61 | done |
63 | 62 |
|
64 | | -$serverName/gradlew bootJar --project-dir $serverName |
65 | | -mkdir output |
66 | | -cp $serverName/build/libs/$serverName-$(cat metadata/IMAGE_VERSION).jar output/$serverName.jar |
| 63 | +cd $serverName |
| 64 | +./gradlew bootBuildImage --imageName="steeltoe.azurecr.io/$sourceDirectory:$serverVersion" |
| 65 | +cd .. |
67 | 66 |
|
68 | 67 | cd .. |
0 commit comments