Compare commits
No commits in common. "d86499860f8f5b5f875c6be4c153e825e7e21922" and "9ec19b94f11828424d5308ab092ee378776683de" have entirely different histories.
d86499860f
...
9ec19b94f1
6 changed files with 20 additions and 42 deletions
|
@ -1,9 +1,11 @@
|
||||||
stages:
|
stages:
|
||||||
- package
|
|
||||||
- compile
|
- compile
|
||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
|
|
||||||
|
.setup-mvn: &setup-mvn
|
||||||
|
- chmod a+x mvnw
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
|
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
|
||||||
|
|
||||||
|
@ -12,30 +14,18 @@ cache:
|
||||||
- .m2/repository/
|
- .m2/repository/
|
||||||
- "**/target/"
|
- "**/target/"
|
||||||
|
|
||||||
container:
|
|
||||||
stage: package
|
|
||||||
image: $CI_REGISTRY/ict/images/alpine/ci:latest
|
|
||||||
variables:
|
|
||||||
BUILDAH_ISOLATION: chroot
|
|
||||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
|
||||||
before_script:
|
|
||||||
- apk add buildah fuse-overlayfs
|
|
||||||
- buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
||||||
- buildah info
|
|
||||||
script:
|
|
||||||
- buildah build --tag $IMAGE_TAG -f Dockerfile
|
|
||||||
- buildah push $IMAGE_TAG
|
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
stage: compile
|
stage: compile
|
||||||
image: maven:3.8.6-openjdk-18
|
image: maven:3.8.6-openjdk-18
|
||||||
script:
|
script:
|
||||||
|
- *setup-mvn
|
||||||
- ./mvnw clean compile
|
- ./mvnw clean compile
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
image: markhobson/maven-chrome:jdk-18
|
image: markhobson/maven-chrome:jdk-18
|
||||||
script:
|
script:
|
||||||
|
- *setup-mvn
|
||||||
- ./mvnw test
|
- ./mvnw test
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "Surefire test reports from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
|
name: "Surefire test reports from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
|
||||||
|
@ -48,13 +38,15 @@ check:
|
||||||
stage: build
|
stage: build
|
||||||
image: markhobson/maven-chrome:jdk-18
|
image: markhobson/maven-chrome:jdk-18
|
||||||
script:
|
script:
|
||||||
- ./mvnw clean compile # dependency-check:aggregate
|
- *setup-mvn
|
||||||
|
- ./mvnw clean compile
|
||||||
- ./mvnw sonar:sonar -Dsonar.projectKey=$SONAR_PROJECT -Dsonar.projectName=$SONAR_PROJECT -Dsonar.host.url=$SONAR_URL -Dsonar.token=$SONAR_TOKEN
|
- ./mvnw sonar:sonar -Dsonar.projectKey=$SONAR_PROJECT -Dsonar.projectName=$SONAR_PROJECT -Dsonar.host.url=$SONAR_URL -Dsonar.token=$SONAR_TOKEN
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
image: maven:3.8.6-openjdk-18
|
image: maven:3.8.6-openjdk-18
|
||||||
script:
|
script:
|
||||||
|
- *setup-mvn
|
||||||
- ./mvnw package -DskipTests
|
- ./mvnw package -DskipTests
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "Maven artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
|
name: "Maven artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
FROM eclipse-temurin:17-jre-jammy
|
|
||||||
ARG JAR_FILE=app/target/*.jar
|
|
||||||
COPY ${JAR_FILE} app.jar
|
|
||||||
EXPOSE 8081
|
|
||||||
ENTRYPOINT ["java","-jar","/app.jar"]
|
|
|
@ -9,18 +9,15 @@ import java.util.List;
|
||||||
@Component
|
@Component
|
||||||
@Profile("stub")
|
@Profile("stub")
|
||||||
public class ClubDatabaseDaoStub implements ClubDatabaseDao {
|
public class ClubDatabaseDaoStub implements ClubDatabaseDao {
|
||||||
public static final String PILOT_ROLE = "PILOT";
|
|
||||||
public static final String BACKOFFICE_ROLE = "BACKOFFICE";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<User> getUsers() {
|
public List<User> getUsers() {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new User(1L, "Kamila", "Spoustová", Arrays.asList(PILOT_ROLE)),
|
new User(1L, "Kamila", "Spoustová", Arrays.asList("PILOT")),
|
||||||
new User(2L, "Naděžda", "Pavelková", Arrays.asList(PILOT_ROLE)),
|
new User(2L, "Naděžda", "Pavelková", Arrays.asList("PILOT")),
|
||||||
new User(3L, "Silvie", "Hronová", Arrays.asList(PILOT_ROLE)),
|
new User(3L, "Silvie", "Hronová", Arrays.asList("PILOT")),
|
||||||
new User(9L, "Miloš", "Korbel", Arrays.asList(PILOT_ROLE, BACKOFFICE_ROLE)),
|
new User(9L, "Miloš", "Korbel", Arrays.asList("PILOT", "BACKOFFICE")),
|
||||||
new User(10L, "Petr", "Hrubec", Arrays.asList(PILOT_ROLE, BACKOFFICE_ROLE)),
|
new User(10L, "Petr", "Hrubec", Arrays.asList("PILOT", "BACKOFFICE")),
|
||||||
new User(13L, "Michal", "Vyvlečka", Arrays.asList(BACKOFFICE_ROLE))
|
new User(13L, "Michal", "Vyvlečka", Arrays.asList("BACKOFFICE"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
pom.xml
12
pom.xml
|
@ -93,17 +93,5 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.owasp</groupId>
|
|
||||||
<artifactId>dependency-check-maven</artifactId>
|
|
||||||
<version>8.4.0</version>
|
|
||||||
<configuration>
|
|
||||||
<format>ALL</format>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -51,6 +51,10 @@ public class FlightController {
|
||||||
|
|
||||||
@PostMapping("/flight/takeoff")
|
@PostMapping("/flight/takeoff")
|
||||||
public ResponseEntity<Serializable> takeoff(@RequestBody FlightTakeoffTo start) {
|
public ResponseEntity<Serializable> takeoff(@RequestBody FlightTakeoffTo start) {
|
||||||
|
// TODO tutorial-4.2: Remove this commented-out code
|
||||||
|
// for (int i = 0; i <= 10; i++) {
|
||||||
|
// System.out.println("Just printing i:" + i);
|
||||||
|
// }
|
||||||
log.debug("Start\n{}", start);
|
log.debug("Start\n{}", start);
|
||||||
|
|
||||||
flightService.takeoff(start);
|
flightService.takeoff(start);
|
||||||
|
|
|
@ -32,10 +32,12 @@ public class CsvExportServiceImpl implements CsvExportService {
|
||||||
private final FlightRepository flightRepository;
|
private final FlightRepository flightRepository;
|
||||||
|
|
||||||
private final String fileName;
|
private final String fileName;
|
||||||
|
private String neverUsedField;
|
||||||
|
|
||||||
public CsvExportServiceImpl(FlightRepository flightRepository, @Value("${csv.export.flight.fileName}") String fileName) {
|
public CsvExportServiceImpl(FlightRepository flightRepository, @Value("${csv.export.flight.fileName}") String fileName) {
|
||||||
this.flightRepository = flightRepository;
|
this.flightRepository = flightRepository;
|
||||||
this.fileName = fileName;
|
this.fileName = fileName;
|
||||||
|
this.neverUsedField = "redundant";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue