Compare commits

..
10 Commits
Author SHA1 Message Date
2martens 8381c1ba7d Use Drone semver
continuous-integration/drone/push Build is failing
2023-08-17 23:07:16 +02:00
2martens 4308130cd1 Fixed usage of image version
continuous-integration/drone/push Build is failing
continuous-integration/drone/promote/production Build is failing
2023-08-17 23:03:00 +02:00
2martens 721cdac95d Use latest ansible plugin version
continuous-integration/drone/push Build is failing
2023-08-17 22:59:49 +02:00
2martens 395fa52962 Fixed pipeline
continuous-integration/drone/push Build is failing
continuous-integration/drone/promote/production Build is failing
2023-08-17 22:50:20 +02:00
2martens 45e5c473ff Added pipeline to deploy via Ansible
continuous-integration/drone/push Build is failing
continuous-integration/drone/promote/production Build is failing
2023-08-17 21:11:44 +02:00
2martens 1c3648f0f4 Update [CI SKIP] 2023-08-17 12:51:18 +02:00
2martens 5b707728b8 Change properties [CI SKIP] 2023-08-17 02:18:08 +02:00
2martens c19c211839 Make properties refreshable
continuous-integration/drone/push Build is failing
2023-08-17 02:15:23 +02:00
2martens aace535914 Change message [CI SKIP] 2023-08-17 02:13:07 +02:00
2martens 59982ef762 Remove refresh scope from Clock
continuous-integration/drone/push Build is failing
2023-08-17 02:08:12 +02:00
4 changed files with 69 additions and 7 deletions
+64 -3
View File
@@ -88,10 +88,71 @@ volumes:
path: /var/lib/drone/cache/.gradle
trigger:
branches:
- main
event:
include:
- push
- tag
- custom
---
kind: pipeline
name: deploy image
type: docker
platform:
os: linux
arch: arm64
clone:
disable: true
steps:
- name: clone
image: alpine/git
environment:
SSH_KEY:
from_secret: ssh_key
commands:
- mkdir $HOME/.ssh
- echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
- chmod 600 $HOME/.ssh/id_ed25519
- touch $HOME/.ssh/known_hosts
- chmod 600 $HOME/.ssh/known_hosts
- ssh-keyscan -H git.2martens.de > $HOME/.ssh/known_hosts 2>/dev/null
- git clone ssh://giteajim@git.2martens.de:22/2martens/cloud-configuration.git .
- git checkout main
- name: modify deployed image
image: alpine
commands:
- sed -i -r "s/(wahlrecht_image_version:).*/\1\ ${DRONE_SEMVER}/" ansible/inventories/host_vars/api-server/public.yaml
- name: save modified variable file
image: alpine/git
environment:
SSH_KEY:
from_secret: ssh_key
commands:
- mkdir $HOME/.ssh
- echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
- chmod 600 $HOME/.ssh/id_ed25519
- touch $HOME/.ssh/known_hosts
- chmod 600 $HOME/.ssh/known_hosts
- ssh-keyscan -H git.2martens.de > $HOME/.ssh/known_hosts 2>/dev/null
- git add ansible/inventories/host_vars/api-server/public.yaml
- git commit -m "[Drone] Changed wahlrecht_image_version to ${DRONE_SEMVER}"
- git push origin main
- name: deploy image
image: plugins/ansible:latest
settings:
playbook: ansible/deploy_spring.yaml
inventory: ansible/inventories/production
private_key:
from_secret: ssh_key
vault_password:
from_secret: vault_password
trigger:
target:
- production
event:
include:
- promote
- rollback
@@ -1,7 +1,6 @@
package de.twomartens.wahlrecht.configuration
import de.twomartens.wahlrecht.property.ServiceProperties
import org.springframework.cloud.context.config.annotation.RefreshScope
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import java.time.Clock
@@ -10,7 +9,6 @@ import java.time.Clock
open class ClockConfiguration(private val serviceProperties: ServiceProperties) {
@Bean
@RefreshScope
open fun clock(): Clock {
return Clock.system(serviceProperties.defaultTimeZone)
}
@@ -8,4 +8,7 @@ import java.time.ZoneId
@RefreshScope
@ConfigurationProperties(prefix = "de.twomartens.wahlrecht")
@Schema(description = "Properties, to configure this Application")
data class ServiceProperties(var defaultTimeZone: ZoneId, var greeting: String)
class ServiceProperties {
lateinit var defaultTimeZone: ZoneId
lateinit var greeting: String
}
@@ -1,2 +1,2 @@
de.twomartens.wahlrecht:
greeting: "Moin %s, you are stage"
greeting: "Moin %s, you are test"