gitlab-notification/.drone.yml
Struchkov Mark 873e7217aa
Some checks failed
continuous-integration/drone/push Build is failing
Настройка dev сборки документации
2023-02-23 20:22:56 +03:00

154 lines
3.6 KiB
YAML

---
kind: pipeline
type: docker
name: develop build
trigger:
branch:
- develop
services:
- name: docker
image: docker:20.10.22-dind-alpine3.17
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: m2
host:
path: /drone/volume/m2
- name: dockersock
temp: {}
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 develop
image: upagge/docker-buildx:latest
environment:
DOCKER_REGISTRY_TOKEN:
from_secret: DOCKER_REGISTRY_TOKEN
DOCKER_IMAGE_NAME:
from_secret: DOCKER_IMAGE_NAME
DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER
volumes:
- name: dockersock
path: /var/run
commands:
- echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin
- docker buildx create --use
- docker buildx build -f Dockerfile-develop --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" .
---
kind: pipeline
type: docker
name: release build
trigger:
ref:
- refs/tags/v.*.*.*
services:
- name: docker
image: docker:20.10.22-dind-alpine3.17
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: m2
host:
path: /drone/volume/m2
- name: dockersock
temp: {}
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
image: upagge/docker-buildx:latest
environment:
DOCKER_REGISTRY_TOKEN:
from_secret: DOCKER_REGISTRY_TOKEN
DOCKER_IMAGE_NAME:
from_secret: DOCKER_IMAGE_NAME
DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER
volumes:
- name: dockersock
path: /var/run
commands:
- echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin
- docker buildx create --use
- docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:latest" -t "$DOCKER_IMAGE_NAME:$DRONE_TAG" .
---
kind: pipeline
type: docker
name: create-docs-site
trigger:
branch:
- docs
clone:
depth: 1
steps:
- name: build site
image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest
environment:
GIT_SSH:
from_secret: GIT_SSH
SSH_CONFIG:
from_secret: SSH_CONFIG
volumes:
- name: mkdocs_cache
path: ${DRONE_WORKSPACE}/documentation/.cache
commands:
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$GIT_SSH" >> ~/.ssh/id_rsa
- echo "$SSH_CONFIG" >> ~/.ssh/config
- chmod 700 ~/.ssh
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}"
- git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
- git remote add deploy ssh://git@git.struchkov.dev/Telegram-Bots/gitlab-notification.git
- cd documentation
- mike deploy --prefix gitlab-notification --branch docs-deploy --update-aliases develop
- git push deploy HEAD:docs-deploy
image_pull_secrets:
- DOCKER_AUTH
volumes:
- name: mkdocs_cache
host:
path: /drone/volume/mkdocs_cache/gitlab_notification
---
kind: signature
hmac: 3910c70de927dc9da8e879ffb9e3adb9551f99f100f551bf72b5772dc15ff886
...