setting cicd
This commit is contained in:
parent
d5c81795d1
commit
40a929009d
299
.drone.yml
299
.drone.yml
@ -53,157 +53,156 @@ steps:
|
|||||||
- docker buildx create --use
|
- docker buildx create --use
|
||||||
- docker buildx build -f Dockerfile-develop --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:develop" .
|
- docker buildx build -f Dockerfile-develop --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:develop" .
|
||||||
|
|
||||||
#---
|
---
|
||||||
#
|
kind: pipeline
|
||||||
#kind: pipeline
|
type: docker
|
||||||
#type: docker
|
name: release build
|
||||||
#name: release build
|
|
||||||
#
|
trigger:
|
||||||
#trigger:
|
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
|
privileged: true
|
||||||
# privileged: true
|
volumes:
|
||||||
# volumes:
|
- name: dockersock
|
||||||
# - name: dockersock
|
path: /var/run
|
||||||
# path: /var/run
|
|
||||||
#
|
volumes:
|
||||||
#volumes:
|
- name: m2
|
||||||
# - name: m2
|
host:
|
||||||
# host:
|
path: /drone/volume/m2
|
||||||
# path: /drone/volume/m2
|
- name: dockersock
|
||||||
# - name: dockersock
|
temp: { }
|
||||||
# temp: {}
|
|
||||||
#
|
steps:
|
||||||
#steps:
|
- name: create jar
|
||||||
# - name: create jar
|
image: maven:3.8.6-eclipse-temurin-17
|
||||||
# image: maven:3.8.6-eclipse-temurin-17
|
volumes:
|
||||||
# volumes:
|
- name: m2
|
||||||
# - name: m2
|
path: /root/.m2/repository
|
||||||
# path: /root/.m2/repository
|
commands:
|
||||||
# commands:
|
- mvn -U clean package
|
||||||
# - mvn -U clean package
|
|
||||||
#
|
- name: docker publish release
|
||||||
# - name: docker publish release
|
image: upagge/docker-buildx:latest
|
||||||
# image: upagge/docker-buildx:latest
|
environment:
|
||||||
# environment:
|
STRUCHKOV_DOCKER_REGISTRY_TOKEN:
|
||||||
# STRUCHKOV_DOCKER_REGISTRY_TOKEN:
|
from_secret: STRUCHKOV_DOCKER_REGISTRY_TOKEN
|
||||||
# from_secret: STRUCHKOV_DOCKER_REGISTRY_TOKEN
|
STRUCHKOV_DOCKER_IMAGE_NAME:
|
||||||
# STRUCHKOV_DOCKER_IMAGE_NAME:
|
from_secret: STRUCHKOV_DOCKER_IMAGE_NAME
|
||||||
# from_secret: STRUCHKOV_DOCKER_IMAGE_NAME
|
DOCKER_REGISTRY_TOKEN:
|
||||||
# DOCKER_REGISTRY_TOKEN:
|
from_secret: DOCKER_REGISTRY_TOKEN
|
||||||
# from_secret: DOCKER_REGISTRY_TOKEN
|
DOCKER_IMAGE_NAME:
|
||||||
# DOCKER_IMAGE_NAME:
|
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
|
volumes:
|
||||||
# volumes:
|
- name: dockersock
|
||||||
# - name: dockersock
|
path: /var/run
|
||||||
# path: /var/run
|
commands:
|
||||||
# commands:
|
- echo "$STRUCHKOV_DOCKER_REGISTRY_TOKEN" | docker login git.struchkov.dev --username $DOCKER_REGISTRY_USER --password-stdin
|
||||||
# - echo "$STRUCHKOV_DOCKER_REGISTRY_TOKEN" | docker login git.struchkov.dev --username $DOCKER_REGISTRY_USER --password-stdin
|
- echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin
|
||||||
# - echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin
|
- docker buildx create --use
|
||||||
# - 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" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:latest" -t "git.struchkov.dev/$STRUCHKOV_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" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:latest" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:$DRONE_TAG" .
|
|
||||||
#
|
---
|
||||||
#---
|
kind: pipeline
|
||||||
#kind: pipeline
|
type: docker
|
||||||
#type: docker
|
name: create-develop-docs-site
|
||||||
#name: create-develop-docs-site
|
|
||||||
#
|
trigger:
|
||||||
#trigger:
|
branch:
|
||||||
# branch:
|
- develop
|
||||||
# - develop
|
- docs
|
||||||
# - docs
|
|
||||||
#
|
clone:
|
||||||
#clone:
|
disable: true
|
||||||
# disable: true
|
|
||||||
#
|
steps:
|
||||||
#steps:
|
|
||||||
#
|
- name: build docs
|
||||||
# - name: build docs
|
image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest
|
||||||
# image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest
|
volumes:
|
||||||
# volumes:
|
- name: mkdocs_cache
|
||||||
# - name: mkdocs_cache
|
path: ${DRONE_WORKSPACE}/documentation/en/.cache
|
||||||
# path: ${DRONE_WORKSPACE}/documentation/ru/.cache
|
environment:
|
||||||
# environment:
|
GIT_SSH:
|
||||||
# GIT_SSH:
|
from_secret: GIT_SSH
|
||||||
# from_secret: GIT_SSH
|
GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222"
|
||||||
# GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222"
|
commands:
|
||||||
# commands:
|
- eval $(ssh-agent -s)
|
||||||
# - eval $(ssh-agent -s)
|
- mkdir -p ~/.ssh
|
||||||
# - mkdir -p ~/.ssh
|
- chmod 700 ~/.ssh
|
||||||
# - chmod 700 ~/.ssh
|
- echo "$GIT_SSH" >> ~/.ssh/id_rsa
|
||||||
# - echo "$GIT_SSH" >> ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
# - chmod 600 ~/.ssh/id_rsa
|
- ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts
|
||||||
# - ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
# - chmod 644 ~/.ssh/known_hosts
|
- git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}"
|
||||||
# - git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}"
|
- git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
|
||||||
# - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
|
- git clone ${DRONE_GIT_SSH_URL} .
|
||||||
# - git clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git .
|
- git checkout $DRONE_COMMIT
|
||||||
# - git checkout $DRONE_COMMIT
|
- cd documentation/en
|
||||||
# - cd documentation/ru
|
- mike deploy --prefix chatgpt-telegram-bot/en --branch docs-deploy --push --update-aliases develop
|
||||||
# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases develop
|
|
||||||
#
|
image_pull_secrets:
|
||||||
#image_pull_secrets:
|
- DOCKER_AUTH
|
||||||
# - DOCKER_AUTH
|
|
||||||
#
|
volumes:
|
||||||
#volumes:
|
- name: mkdocs_cache
|
||||||
# - name: mkdocs_cache
|
host:
|
||||||
# host:
|
path: /drone/volume/mkdocs_cache/chatgpt-telegram-bot/en
|
||||||
# path: /drone/volume/mkdocs_cache/gitlab_notification/ru
|
|
||||||
#
|
---
|
||||||
#---
|
kind: pipeline
|
||||||
#kind: pipeline
|
type: docker
|
||||||
#type: docker
|
name: create-release-docs-site
|
||||||
#name: create-release-docs-site
|
|
||||||
#
|
trigger:
|
||||||
#trigger:
|
ref:
|
||||||
# ref:
|
- refs/tags/v.*.*.*
|
||||||
# - refs/tags/v.*.*.*
|
|
||||||
#
|
clone:
|
||||||
#clone:
|
disable: true
|
||||||
# disable: true
|
|
||||||
#
|
steps:
|
||||||
#steps:
|
|
||||||
#
|
- name: build docs
|
||||||
# - name: build docs
|
image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest
|
||||||
# image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest
|
volumes:
|
||||||
# volumes:
|
- name: mkdocs_cache
|
||||||
# - name: mkdocs_cache
|
path: ${DRONE_WORKSPACE}/documentation/en/.cache
|
||||||
# path: ${DRONE_WORKSPACE}/documentation/ru/.cache
|
environment:
|
||||||
# environment:
|
GIT_SSH:
|
||||||
# GIT_SSH:
|
from_secret: GIT_SSH
|
||||||
# from_secret: GIT_SSH
|
GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222"
|
||||||
# GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222"
|
commands:
|
||||||
# commands:
|
- eval $(ssh-agent -s)
|
||||||
# - eval $(ssh-agent -s)
|
- mkdir -p ~/.ssh
|
||||||
# - mkdir -p ~/.ssh
|
- chmod 700 ~/.ssh
|
||||||
# - chmod 700 ~/.ssh
|
- echo "$GIT_SSH" >> ~/.ssh/id_rsa
|
||||||
# - echo "$GIT_SSH" >> ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
# - chmod 600 ~/.ssh/id_rsa
|
- ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts
|
||||||
# - ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
# - chmod 644 ~/.ssh/known_hosts
|
- git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}"
|
||||||
# - git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}"
|
- git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
|
||||||
# - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
|
- git clone ${DRONE_GIT_SSH_URL} .
|
||||||
# - git clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git .
|
- git checkout $DRONE_COMMIT
|
||||||
# - git checkout $DRONE_COMMIT
|
- cd documentation/en
|
||||||
# - cd documentation/ru
|
- mike deploy --prefix chatgpt-telegram-bot/en --branch docs-deploy --push --update-aliases ${DRONE_TAG}
|
||||||
# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases ${DRONE_TAG}
|
- mike deploy --prefix chatgpt-telegram-bot/en --branch docs-deploy --push --update-aliases latest
|
||||||
# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases latest
|
|
||||||
#
|
image_pull_secrets:
|
||||||
#image_pull_secrets:
|
- DOCKER_AUTH
|
||||||
# - DOCKER_AUTH
|
|
||||||
#
|
volumes:
|
||||||
#volumes:
|
- name: mkdocs_cache
|
||||||
# - name: mkdocs_cache
|
host:
|
||||||
# host:
|
path: /drone/volume/mkdocs_cache/chatgpt-telegram-bot/en
|
||||||
# path: /drone/volume/mkdocs_cache/gitlab_notification
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: e7f6553e0e0ffb44294dfee170fd01441b54cd56a5f4c70638486ac37fcdf047
|
hmac: 44ca201fe0ea4a7b739d9e170e0852171c5175c0128bfd3e77f7247f92db56a8
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Loading…
Reference in New Issue
Block a user