Skip to content

Commit 619f870

Browse files
authored
Springboot code (#162)
* Springboot code * Review changes * add springboot in Lab configurations * dockerfile changes * docker build added
1 parent 89f150c commit 619f870

25 files changed

+1143
-142
lines changed

grabdish/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2021 Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

5-
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon"
5+
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon inventory-springboot"
66
for s in $MS; do
77
echo ________________________________________
88
echo "Deploying $s..."

grabdish/inventory-springboot/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM maven:3.6.3-openjdk-11 AS maven_build
22
COPY pom.xml /tmp/
33
COPY src /tmp/src/
44
WORKDIR /tmp/
5-
RUN mvn package
65
FROM openjdk
76
EXPOSE 8080
8-
CMD java -jar /data/inventory-springboot-0.1.0.jar
9-
COPY --from=maven_build /tmp/target/inventory-springboot-0.1.0.jar /data/inventory-springboot-0.1.0.jar
7+
ARG JAR_FILE=target/*.jar
8+
COPY ${JAR_FILE} app.jar
9+
ENTRYPOINT ["java","-jar","/app.jar"]

grabdish/inventory-springboot/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ fi
1515

1616
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
1717

18-
#mvn package
18+
mvn clean package spring-boot:repackage
1919
docker build -t=$IMAGE .
2020

2121
docker push "$IMAGE"
2222
if [ $? -eq 0 ]; then
2323
docker rmi "$IMAGE"
24-
fi
24+
fi
Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
2-
##
3-
## Copyright (c) 2021 Oracle and/or its affiliates.
4-
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
51
apiVersion: apps/v1
62
kind: Deployment
73
metadata:
84
name: inventory-springboot
9-
labels:
10-
app: inventory
115
spec:
126
replicas: 1
137
selector:
@@ -20,57 +14,42 @@ spec:
2014
version: springboot
2115
spec:
2216
containers:
23-
- name: inventory
24-
imagePullPolicy: Always
25-
image: %DOCKER_REGISTRY%/%IMAGE_NAME%:%IMAGE_VERSION%
26-
volumeMounts:
27-
- name: creds
28-
mountPath: /msdataworkshop/creds
29-
ports:
30-
- containerPort: 8080
31-
livenessProbe:
32-
httpGet:
33-
path: /health/live
34-
port: 8080
35-
initialDelaySeconds: 20
36-
periodSeconds: 20
37-
timeoutSeconds: 5
38-
failureThreshold: 3
39-
readinessProbe:
40-
httpGet:
41-
path: /health/ready
42-
port: 8080
43-
initialDelaySeconds: 3
44-
periodSeconds: 3
45-
timeoutSeconds: 5
46-
failureThreshold: 20
47-
env:
48-
- name: LOG_LEVEL
49-
value: "DEBUG"
50-
- name: server_port
51-
value: "8080"
52-
- name: db_user
53-
value: "inventoryuser"
54-
- name: db_url
55-
value: "jdbc:oracle:thin:@%INVENTORY_PDB_NAME%_tp?TNS_ADMIN=/msdataworkshop/creds"
56-
- name: db_queueOwner
57-
value: "inventoryuser"
58-
- name: db_orderQueueName
59-
value: "orderqueue"
60-
- name: db_inventoryQueueName
61-
value: "inventoryqueue"
62-
- name: OCI_REGION
63-
value: "%OCI_REGION%"
64-
- name: VAULT_SECRET_OCID
65-
value: "%VAULT_SECRET_OCID%"
66-
- name: db_password
67-
valueFrom:
68-
secretKeyRef:
69-
name: dbuser
70-
key: dbpassword
71-
optional: true #not needed/used if using VAULT_SECRET_OCID exists
17+
- name: inventory
18+
image: %DOCKER_REGISTRY%/%IMAGE_NAME%:%IMAGE_VERSION%
19+
imagePullPolicy: Always
20+
env:
21+
- name: LOG_LEVEL
22+
value: "DEBUG"
23+
- name: server_port
24+
value: "8080"
25+
- name: db_user
26+
value: "inventoryuser"
27+
- name: db_url
28+
value: "jdbc:oracle:thin:@%INVENTORY_PDB_NAME%_tp?TNS_ADMIN=/msdataworkshop/creds"
29+
- name: db_queueOwner
30+
value: "inventoryuser"
31+
- name: db_orderQueueName
32+
value: "orderqueue"
33+
- name: db_inventoryQueueName
34+
value: "inventoryqueue"
35+
- name: OCI_REGION
36+
value: "%OCI_REGION%"
37+
- name: VAULT_SECRET_OCID
38+
value: "%VAULT_SECRET_OCID%"
39+
- name: db_password
40+
valueFrom:
41+
secretKeyRef:
42+
name: dbuser
43+
key: dbpassword
44+
optional: true #not needed/used if using VAULT_SECRET_OCID exists
45+
volumeMounts:
46+
- name: creds
47+
mountPath: /msdataworkshop/creds
48+
ports:
49+
- containerPort: 8080
7250
restartPolicy: Always
7351
volumes:
7452
- name: creds
7553
secret:
76-
secretName: db-wallet-secret
54+
secretName: db-wallet-secret
55+

0 commit comments

Comments
 (0)