Настройка cicd с помощью drone

This commit is contained in:
Struchkov Mark 2022-12-18 17:33:47 +03:00
parent f62bed7d13
commit 7dfd315512
21 changed files with 71 additions and 43 deletions

33
.drone.yml Normal file
View File

@ -0,0 +1,33 @@
kind: pipeline
type: docker
name: haiti-framework
steps:
- name: publish maven central
image: maven:3.8.5-openjdk-17
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
GPG_PRIVATE_KEY:
from_secret: GPG_PRIVATE_KEY
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
GPG_PASSPHRASE:
from_secret: GPG_PASSPHRASE
commands:
- echo "$GPG_PRIVATE_KEY" >> gpg.key
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE --import gpg.key
- mvn --settings maven-settings.xml -U -P ossrh,release clean deploy
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2

View File

@ -1,17 +0,0 @@
image: maven:3.8.5-openjdk-17
variables:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
stages:
- deploy
deploy:
stage: deploy
only:
- /^v.*$/
except:
- branches
before_script:
- gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE --import $GPG_PRIVATE_KEY
script:
- 'mvn --settings $MAVEN_SETTINGS -U -P ossrh,release clean deploy'

28
pom.xml
View File

@ -5,7 +5,7 @@
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
@ -38,7 +38,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<godfather.core.ver>0.0.32</godfather.core.ver>
<godfather.core.ver>0.0.41</godfather.core.ver>
<telegrambots.ver>6.3.0</telegrambots.ver>
<haiti.version>2.0.0</haiti.version>
@ -48,6 +48,7 @@
<plugin.maven.source.ver>3.2.1</plugin.maven.source.ver>
<plugin.maven.javadoc.ver>3.4.0</plugin.maven.javadoc.ver>
<plugin.maven.gpg.ver>3.0.1</plugin.maven.gpg.ver>
<plugin.maven.release.ver>3.0.0-M7</plugin.maven.release.ver>
</properties>
<dependencyManagement>
@ -127,12 +128,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
@ -289,6 +284,19 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${plugin.maven.release.ver}</version>
<configuration>
<preparationGoals>clean compile</preparationGoals>
<goal>install</goal>
<tagNameFormat>v.@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
</plugins>
</pluginManagement>
@ -313,6 +321,10 @@
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<artifactId>telegram-bot</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-consumer</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-consumer-main</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-consumer-quarkus</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-consumer</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-consumer-simple</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<artifactId>telegram-bot</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-context</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-context</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-context-main</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-context</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-context-quarkus</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<artifactId>telegram-context</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-context-simple</artifactId>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<modules>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-core-main</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<artifactId>telegram-core</artifactId>
<groupId>dev.struchkov.godfather.telegram</groupId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-core-quarkus</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-core</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-core-simple</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-domain</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-sender</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-sender</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-sender-main</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-sender</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-sender-quarkus</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-sender</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-sender-simple</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather.telegram</groupId>
<artifactId>telegram-bot</artifactId>
<version>0.0.44</version>
<version>0.0.45-SNAPSHOT</version>
</parent>
<artifactId>telegram-simple</artifactId>