Skip to content

Commit 3a9c308

Browse files
committed
skaffolding
1 parent 0a5ebd0 commit 3a9c308

File tree

8 files changed

+190
-2
lines changed

8 files changed

+190
-2
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ MAINTAINER Armand Ballaci
44

55
COPY pom.xml .
66

7+
COPY settings.xml "/root/.m2/settings.xml"
8+
79
COPY src src
810

911
RUN mvn dependency:go-offline -B

Readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ install the dashboard in grafana importing it from grafana_dashboard_spring-boot
6969

7070
<code> kubectl apply -f springboot-jpa.yaml </code>
7171

72+
or for local development
73+
74+
```skaffold dev```
75+
76+
to make the builds faster use a nexus docker image as proxy... more on that later...
77+
7278
```
7379
Metrics: http://localhost:8080/actuator/metrics
7480

persistent-volume.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ spec:
2626
- ReadOnlyMany
2727
resources:
2828
requests:
29-
storage: 1Mi
29+
storage: 1Mi

pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
88
<version>2.2.7.RELEASE</version>
9-
<relativePath/> <!-- lookup parent from repository -->
109
</parent>
1110
<groupId>de.ballaci</groupId>
1211
<artifactId>sakila.jpa</artifactId>
@@ -93,4 +92,16 @@
9392
<url>https://repo.spring.io/milestone</url>
9493
</repository>
9594
</repositories>
95+
<distributionManagement>
96+
<repository>
97+
<id>nexus</id>
98+
<name>maven-releases</name>
99+
<url>http://localhost:8081/repository/maven-releases/</url>
100+
</repository>
101+
<snapshotRepository>
102+
<id>nexus</id>
103+
<name>maven-snapshots</name>
104+
<url>http://localhost:8081/repository/maven-snapshots/</url>
105+
</snapshotRepository>
106+
</distributionManagement>
96107
</project>

settings.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<settings>
2+
<localRepository>/usr/share/maven/ref/repository</localRepository>
3+
<mirrors>
4+
<mirror>
5+
<!--This sends everything else to /public -->
6+
<id>nexus</id>
7+
<mirrorOf>*</mirrorOf>
8+
<url>http://172.17.0.2:8081/repository/maven-public/</url>
9+
</mirror>
10+
</mirrors>
11+
<profiles>
12+
<profile>
13+
<id>nexus</id>
14+
<!--Enable snapshots for the built in central repo to direct -->
15+
<!--all requests to nexus via the mirror -->
16+
<repositories>
17+
<repository>
18+
<id>central</id>
19+
<url>http://central</url>
20+
<releases><enabled>true</enabled></releases>
21+
<snapshots><enabled>true</enabled></snapshots>
22+
</repository>
23+
</repositories>
24+
<pluginRepositories>
25+
<pluginRepository>
26+
<id>central</id>
27+
<url>http://central</url>
28+
<releases><enabled>true</enabled></releases>
29+
<snapshots><enabled>true</enabled></snapshots>
30+
</pluginRepository>
31+
</pluginRepositories>
32+
</profile>
33+
</profiles>
34+
<activeProfiles>
35+
<!--make the profile active all the time -->
36+
<activeProfile>nexus</activeProfile>
37+
</activeProfiles>
38+
<servers>
39+
<server>
40+
<id>nexus</id>
41+
<username>admin</username>
42+
<password>nexus</password>
43+
</server>
44+
</servers>
45+
</settings>

skaffold.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: skaffold/v2beta3
2+
kind: Config
3+
metadata:
4+
name: springboot-sakila-jpa
5+
build:
6+
artifacts:
7+
- image: aballaci/springboot-sakila-jpa
8+
deploy:
9+
kubectl:
10+
manifests:
11+
- persistent-volume.yml
12+
- springboot-jpa.yaml
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package de.ballaci.jpa.domain;
2+
3+
import javax.persistence.*;
4+
import java.io.Serializable;
5+
import java.sql.Clob;
6+
7+
/**
8+
* @author Armand.Ballaci
9+
*/
10+
11+
@Entity
12+
@Table(name = "CUSTOMER_LIST")
13+
public class CustomerList implements Serializable {
14+
@Id
15+
@Column(name = "ID", updatable = false, insertable = false)
16+
@GeneratedValue(strategy = GenerationType.AUTO)
17+
private long id;
18+
19+
@Column(name = "NAME")
20+
private String name;
21+
22+
@Column(name = "ADDRESS")
23+
private String address;
24+
25+
@Column(name = "PHONE")
26+
private String phone;
27+
28+
@Column(name = "CITY")
29+
private String city;
30+
31+
@Column(name = "COUNTRY")
32+
private String country;
33+
34+
@Column(name = "SID")
35+
private int sid;
36+
37+
public long getId() {
38+
return id;
39+
}
40+
41+
public void setId(long id) {
42+
this.id = id;
43+
}
44+
45+
public String getName() {
46+
return name;
47+
}
48+
49+
public void setName(String name) {
50+
this.name = name;
51+
}
52+
53+
public String getAddress() {
54+
return address;
55+
}
56+
57+
public void setAddress(String address) {
58+
this.address = address;
59+
}
60+
61+
public String getPhone() {
62+
return phone;
63+
}
64+
65+
public void setPhone(String phone) {
66+
this.phone = phone;
67+
}
68+
69+
public String getCity() {
70+
return city;
71+
}
72+
73+
public void setCity(String city) {
74+
this.city = city;
75+
}
76+
77+
public String getCountry() {
78+
return country;
79+
}
80+
81+
public void setCountry(String country) {
82+
this.country = country;
83+
}
84+
85+
86+
public int getSid() {
87+
return sid;
88+
}
89+
90+
public void setSid(int sid) {
91+
this.sid = sid;
92+
}
93+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package de.ballaci.jpa.repositories;
2+
3+
import de.ballaci.jpa.domain.ActorInfo;
4+
import de.ballaci.jpa.domain.CustomerList;
5+
import org.springframework.data.jpa.repository.JpaRepository;
6+
import org.springframework.data.jpa.repository.Query;
7+
import org.springframework.data.repository.query.Param;
8+
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
9+
import org.springframework.transaction.annotation.Transactional;
10+
11+
import java.util.List;
12+
13+
/**
14+
* @author Armand.Ballaci
15+
*/
16+
17+
@Transactional(readOnly = true)
18+
@RepositoryRestResource(collectionResourceRel = "customerlist", path = "customerlist")
19+
public interface CustomerListViewRepository extends JpaRepository<CustomerList, Long> {}

0 commit comments

Comments
 (0)