Compare commits
6 Commits
5f42110d75
...
master
Author | SHA1 | Date | |
---|---|---|---|
e699b878e0
|
|||
ffed92fe39
|
|||
c61620753b
|
|||
63f7865f7c
|
|||
7f14051429
|
|||
0f71773149
|
46
.drone.yml
46
.drone.yml
@ -3,42 +3,11 @@ type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: restore-cache-with-filesystem
|
||||
image: meltwater/drone-cache
|
||||
settings:
|
||||
backend: "filesystem"
|
||||
restore: true
|
||||
cache_key: "{{ .Repo.Name }}"
|
||||
archive_format: "gzip"
|
||||
filesystem_cache_root: "/tmp/cache"
|
||||
mount:
|
||||
- 'build'
|
||||
- '.gradle'
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /tmp/cache
|
||||
|
||||
- name: build_application
|
||||
image: openjdk:11-jdk
|
||||
commands:
|
||||
- ./gradlew build -x test
|
||||
|
||||
- name: rebuild-cache-with-filesystem
|
||||
image: meltwater/drone-cache:dev
|
||||
pull: true
|
||||
settings:
|
||||
backend: "filesystem"
|
||||
rebuild: true
|
||||
cache_key: "{{ .Repo.Name }}"
|
||||
archive_format: "gzip"
|
||||
filesystem_cache_root: "/tmp/cache"
|
||||
mount:
|
||||
- 'build'
|
||||
- '.gradle'
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /tmp/cache
|
||||
|
||||
- name: kaniko
|
||||
image: banzaicloud/drone-kaniko
|
||||
settings:
|
||||
@ -51,18 +20,3 @@ steps:
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_BUILD_NUMBER}
|
||||
|
||||
- name: send telegram notification
|
||||
image: appleboy/drone-telegram
|
||||
settings:
|
||||
token:
|
||||
from_secret: TELEGRAM_TOKEN
|
||||
to:
|
||||
from_secret: TELEGRAM_TO_ID
|
||||
when:
|
||||
status: [ failure ]
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: "/tmp/cache"
|
||||
|
@ -12,8 +12,8 @@ buildscript {
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
@ -65,7 +65,7 @@ kotlin.experimental.coroutines = 'enable'
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,11 @@ import com.kmalbz.api.model.SampleObject
|
||||
import com.kmalbz.database.service.IInputObjectService
|
||||
import com.rabbitmq.client.BuiltinExchangeType
|
||||
import com.rabbitmq.client.ConnectionFactory
|
||||
import com.rabbitmq.client.MessageProperties
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import com.viartemev.thewhiterabbit.channel.confirmChannel
|
||||
import com.viartemev.thewhiterabbit.channel.publish
|
||||
import com.viartemev.thewhiterabbit.publisher.OutboundMessage
|
||||
import io.ktor.application.call
|
||||
import io.ktor.config.HoconApplicationConfig
|
||||
import io.ktor.http.HttpStatusCode
|
||||
@ -30,7 +34,6 @@ import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import java.time.LocalDate
|
||||
import java.util.*
|
||||
import javax.activation.MimetypesFileTypeMap
|
||||
|
||||
/**
|
||||
* Input Service
|
||||
@ -57,8 +60,6 @@ class InputServiceServer {
|
||||
val rabbitExchangeName = appConfig.property("ktor.mq.exchange").getString()
|
||||
|
||||
channel.exchangeDeclare(rabbitExchangeName, BuiltinExchangeType.FANOUT)
|
||||
val queueName = channel.queueDeclare().queue
|
||||
channel.queueBind(queueName, rabbitExchangeName, "")
|
||||
|
||||
val gson = GsonBuilder().setPrettyPrinting().create()
|
||||
|
||||
@ -99,7 +100,11 @@ class InputServiceServer {
|
||||
resultObjectService.addOne(currentApiObject)
|
||||
}
|
||||
|
||||
channel.basicPublish("",queueName, null, tag.toString().toByteArray())
|
||||
connection.confirmChannel {
|
||||
publish {
|
||||
publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag.toString()))
|
||||
}
|
||||
}
|
||||
|
||||
call.respond(currentApiObject)
|
||||
}
|
||||
|
Reference in New Issue
Block a user