Skip to content

Commit

Permalink
begin rabbitmq and keycloak journey
Browse files Browse the repository at this point in the history
  • Loading branch information
NiHaiden committed Jan 4, 2024
1 parent d9593b6 commit 3e235ed
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 4 deletions.
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ dependencies {
implementation 'me.paulschwarz:spring-dotenv:4.0.0'
implementation 'org.springframework.boot:spring-boot-starter-amqp'
implementation 'org.springframework.boot:spring-boot-starter-quartz'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'com.github.dasniko:testcontainers-keycloak:3.2.0'
testImplementation 'org.springframework.amqp:spring-rabbit-test'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:rabbitmq'
testImplementation 'org.testcontainers:postgresql'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
developmentOnly 'org.springframework.boot:spring-boot-docker-compose'
Expand Down
5 changes: 5 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@ services:
PGADMIN_DEFAULT_PASSWORD: Niklas12
volumes:
- pgadmin-data:/var/lib/pgadmin
rabbitmq:
image: rabbitmq:management
ports:
- "5672:5672"
- "15672:15672"
volumes:
pgadmin-data:
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ open class DockerService protected constructor(
@NotNull
@ManyToOne
@JoinColumn(name = "machineID")
var serviceMachine: DockerMachine
var serviceMachine: DockerMachine,

@OneToOne
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package tech.niklas.ariesbackend.model.dockerservice

import jakarta.persistence.DiscriminatorValue
import jakarta.persistence.Entity
import tech.niklas.ariesbackend.model.DockerMachine
import tech.niklas.ariesbackend.model.DockerService
import tech.niklas.ariesbackend.model.types.DatabaseType
import tech.niklas.ariesbackend.model.types.ServiceType

@Entity
@DiscriminatorValue("website-service")
class WebsiteService(
serviceID: String?,
serviceName: String,
serviceType: ServiceType,
serviceMachine: DockerMachine,
serviceUrl: String
)
: DockerService(serviceID, serviceName, serviceType, serviceMachine)
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ package tech.niklas.ariesbackend.model.types

enum class DatabaseType(val databaseType: String) {
POSTGRESQL("postgres"),
MARIADB("mariadb")
MARIADB("mariadb"),
MONGODB("mongodb")
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class MachineController(@Autowired private val dockerMachineService: DockerMachi

@PatchMapping("/update/{id}")
fun updateMachine(@PathVariable @NotBlank id: String, @RequestBody dockerMachine: DockerMachine): DockerMachine {

return dockerMachineService.updateMachine(id, dockerMachine)
}
}
6 changes: 5 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ spring.security.oauth2.client.registration.keycloak.client-id=${KC_CLIENT_ID}
spring.security.oauth2.client.registration.keycloak.client-secret=${KC_CLIENT_SECRET}
spring.security.oauth2.client.registration.keycloak.scope[3]=profile,email
spring.devtools.livereload.enabled=true
server.port=8081
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
server.port=8080

0 comments on commit 3e235ed

Please sign in to comment.