add drone
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Struchkov Mark 2023-01-23 15:17:25 +03:00
parent 4563ce2c4e
commit 91a40cdd14
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
3 changed files with 108 additions and 22 deletions

103
.drone.yml Normal file
View File

@ -0,0 +1,103 @@
---
kind: pipeline
type: docker
name: snapshot-publish
trigger:
branch:
- develop
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish
image: maven:3.8.5-openjdk-17
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
commands:
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- mvn --settings maven-settings.xml -U -P snapshot clean deploy
---
kind: pipeline
type: docker
name: release-maven-central
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2
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
---
kind: pipeline
type: docker
name: release-struchkov-nexus
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish struchkov nexus
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-struchkov-nexus clean deploy
---
kind: signature
hmac: ef2fc291eccd3ad61a646b5fc652e09d6fd7ae10714b35aa6bf147a52529e8e0
...

View File

@ -1,17 +0,0 @@
image: maven:3.8.4-openjdk-11
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'

10
pom.xml
View File

@ -6,12 +6,12 @@
<parent> <parent>
<groupId>dev.struchkov.haiti</groupId> <groupId>dev.struchkov.haiti</groupId>
<artifactId>haiti-dependencies</artifactId> <artifactId>haiti-dependencies</artifactId>
<version>2.0.0</version> <version>2.4.0</version>
</parent> </parent>
<groupId>dev.struchkov.haiti.utils</groupId> <groupId>dev.struchkov.haiti.utils</groupId>
<artifactId>haiti-utils-field-constants</artifactId> <artifactId>haiti-utils-field-constants</artifactId>
<version>0.0.6</version> <version>0.0.7-SNAPSHOT</version>
<name>Haiti Field Name Constants Utils</name> <name>Haiti Field Name Constants Utils</name>
<description>Generating class field names</description> <description>Generating class field names</description>
@ -71,9 +71,9 @@
</build> </build>
<scm> <scm>
<connection>scm:git:https://github.com/haiti-projects/haiti-utils-field-constants.git</connection> <connection>scm:git:https://git.struchkov.dev/Haiti/haiti-utils-field-constants.git</connection>
<url>https://github.com/haiti-projects/haiti-utils-field-constants</url> <url>https://git.struchkov.dev/Haiti/haiti-utils-field-constants</url>
<developerConnection>scm:git:https://github.com/haiti-projects/haiti-utils-field-constants.git</developerConnection> <developerConnection>scm:git:https://git.struchkov.dev/Haiti/haiti-utils-field-constants.git</developerConnection>
</scm> </scm>
</project> </project>