Настройка CICD с помощью Drone
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Struchkov Mark 2022-12-18 01:44:12 +03:00
parent c419254048
commit 9db2ac07ca

View File

@ -1,15 +1,11 @@
---
kind: pipeline kind: pipeline
type: docker type: docker
name: gitlab-notify name: develop build
steps: steps:
- name: create jar - name: create jar
image: maven:3.8.6-eclipse-temurin-17 image: maven:3.8.6-eclipse-temurin-17
when:
branch:
- develop
ref:
- refs/tags/v.*.*.*
volumes: volumes:
- name: m2 - name: m2
path: /root/.m2/repository path: /root/.m2/repository
@ -25,9 +21,6 @@ steps:
from_secret: DOCKER_IMAGE_NAME from_secret: DOCKER_IMAGE_NAME
DOCKER_REGISTRY_USER: DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER from_secret: DOCKER_REGISTRY_USER
when:
branch:
- develop
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
@ -36,6 +29,25 @@ steps:
- docker buildx create --use - docker buildx create --use
- docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" . - docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" .
trigger:
branch:
- develop
---
kind: pipeline
type: docker
name: release build
steps:
- name: create jar
image: maven:3.8.6-eclipse-temurin-17
volumes:
- name: m2
path: /root/.m2/repository
commands:
- mvn -U clean package
- name: docker publish release - name: docker publish release
image: upagge/docker-buildx:latest image: upagge/docker-buildx:latest
environment: environment:
@ -45,9 +57,6 @@ steps:
from_secret: DOCKER_IMAGE_NAME from_secret: DOCKER_IMAGE_NAME
DOCKER_REGISTRY_USER: DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER from_secret: DOCKER_REGISTRY_USER
when:
ref:
- refs/tags/v.*.*.*
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
@ -57,11 +66,11 @@ steps:
- docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:latest" -t "$DOCKER_IMAGE_NAME:$DRONE_TAG" . - docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:latest" -t "$DOCKER_IMAGE_NAME:$DRONE_TAG" .
trigger: trigger:
branch:
- develop
ref: ref:
- refs/tags/v.*.*.* - refs/tags/v.*.*.*
---
services: services:
- name: docker - name: docker
image: docker:20.10.22-dind-alpine3.17 image: docker:20.10.22-dind-alpine3.17