Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
- name: Run Docker Compose
uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: "./postman-docker-compose.yml"
compose-file: "./registry-server-runner/postman-docker-compose.yml"
action: "up"

- name: Run Application With Postman Tests
run: |
docker compose -f postman-docker-compose.yml up --build --exit-code-from newman
docker compose -f ./registry-server-runner/postman-docker-compose.yml up --build --exit-code-from newman

- name: Clean up containers
uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: "./postman-docker-compose.yml"
compose-file: "./registry-server-runner/postman-docker-compose.yml"
action: "down"
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<modules>
<module>server-bom</module>
<module>server</module>
<module>registry-server-runner</module>
</modules>

<build>
Expand Down
2 changes: 1 addition & 1 deletion server/Dockerfile → registry-server-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM openjdk:23-jdk-slim
RUN apt-get update && apt-get install -y curl
ARG JAR_FILE=target/*.jar
ARG JAR_FILE=./registry-server-runner/target/*.jar
COPY ${JAR_FILE} app.jar
EXPOSE 9095
ENTRYPOINT ["java", "-jar", "/app.jar"]
57 changes: 57 additions & 0 deletions registry-server-runner/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.michael</groupId>
<artifactId>service-container-parent</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>registry-server-runner</artifactId>

<properties>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.michael</groupId>
<artifactId>service-container-parent</artifactId>
<version>1.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.michael</groupId>
<artifactId>service-container-server</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.4.5</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
- spring.profiles.active=automation
build:
context: ..
dockerfile: ../Dockerfile
dockerfile: ./registry-server-runner/Dockerfile
ports:
- "9095:9095"
networks:
Expand All @@ -66,8 +66,8 @@ services:
newman:
image: postman/newman:alpine
volumes:
- ./postman/environment/env.json:/etc/newman/environment.json
- ./postman/collection/collection.json:/etc/newman/collection.json
- ../registry-server-runner/postman/environment/env.json:/etc/newman/environment.json
- ../registry-server-runner/postman/collection/collection.json:/etc/newman/collection.json
networks:
- app-network
depends_on:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.michael.container;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Runner {

public static void main(String[] args) {
SpringApplication.run(Runner.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
service.registry.enabled=true
server.port=9095
server.servlet.context-path=/service-registry/api/v2
spring.redis.host=${REDIS_HOST}
spring.redis.port=${REDIS_PORT}
etcd.leader.key=/leader
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
- REDIS_PORT=6379
build:
context: ..
dockerfile: ../Dockerfile
dockerfile: ./registry-server-runner/Dockerfile
depends_on:
redis:
condition: service_healthy
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;

@ComponentScan("com.michael.container")
@Configuration
@ConditionalOnProperty(value = "service.registry.enabled", havingValue = "true", matchIfMissing = true)
@EnableRedisRepositories(basePackages = "com.michael.container")
@ConditionalOnProperty(value = "service.registry.enabled", havingValue = "true")
public class ScanPackages {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

@Configuration
@EnableRedisRepositories(basePackages = "com.michael.container")
public class RedisConfiguration {
@Bean
public RedisConnectionFactory redisConnectionFactory(
Expand Down
5 changes: 0 additions & 5 deletions server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
server.port=9095
server.servlet.context-path=/service-registry/api/v2

etcd.urls=${ETCD_URLS}
etcd.leader.key=/leader

spring.redis.host=${REDIS_HOST}
spring.redis.port=${REDIS_PORT}
11 changes: 11 additions & 0 deletions server/src/test/java/com/michael/container/RegistryRunner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.michael.container;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class RegistryRunner {
public static void main(String[] args) {
SpringApplication.run(RegistryRunner.class);
}
}
Loading