Compare commits
4 Commits
7f14051429
...
master
Author | SHA1 | Date | |
---|---|---|---|
e699b878e0
|
|||
ffed92fe39
|
|||
c61620753b
|
|||
63f7865f7c
|
46
.drone.yml
46
.drone.yml
@ -3,42 +3,11 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
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
|
- name: build_application
|
||||||
image: openjdk:11-jdk
|
image: openjdk:11-jdk
|
||||||
commands:
|
commands:
|
||||||
- ./gradlew build -x test
|
- ./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
|
- name: kaniko
|
||||||
image: banzaicloud/drone-kaniko
|
image: banzaicloud/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
@ -51,18 +20,3 @@ steps:
|
|||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- ${DRONE_BUILD_NUMBER}
|
- ${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"
|
|
||||||
|
@ -6,7 +6,11 @@ import com.kmalbz.api.model.SampleObject
|
|||||||
import com.kmalbz.database.service.IInputObjectService
|
import com.kmalbz.database.service.IInputObjectService
|
||||||
import com.rabbitmq.client.BuiltinExchangeType
|
import com.rabbitmq.client.BuiltinExchangeType
|
||||||
import com.rabbitmq.client.ConnectionFactory
|
import com.rabbitmq.client.ConnectionFactory
|
||||||
|
import com.rabbitmq.client.MessageProperties
|
||||||
import com.typesafe.config.ConfigFactory
|
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.application.call
|
||||||
import io.ktor.config.HoconApplicationConfig
|
import io.ktor.config.HoconApplicationConfig
|
||||||
import io.ktor.http.HttpStatusCode
|
import io.ktor.http.HttpStatusCode
|
||||||
@ -56,8 +60,6 @@ class InputServiceServer {
|
|||||||
val rabbitExchangeName = appConfig.property("ktor.mq.exchange").getString()
|
val rabbitExchangeName = appConfig.property("ktor.mq.exchange").getString()
|
||||||
|
|
||||||
channel.exchangeDeclare(rabbitExchangeName, BuiltinExchangeType.FANOUT)
|
channel.exchangeDeclare(rabbitExchangeName, BuiltinExchangeType.FANOUT)
|
||||||
val queueName = channel.queueDeclare().queue
|
|
||||||
channel.queueBind(queueName, rabbitExchangeName, "")
|
|
||||||
|
|
||||||
val gson = GsonBuilder().setPrettyPrinting().create()
|
val gson = GsonBuilder().setPrettyPrinting().create()
|
||||||
|
|
||||||
@ -98,7 +100,11 @@ class InputServiceServer {
|
|||||||
resultObjectService.addOne(currentApiObject)
|
resultObjectService.addOne(currentApiObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
channel.basicPublish("",queueName, null, tag.toString().toByteArray())
|
connection.confirmChannel {
|
||||||
|
publish {
|
||||||
|
publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag.toString()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
call.respond(currentApiObject)
|
call.respond(currentApiObject)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user