From 6eab8daf315e305c2cd3d6e6fa6dcddb04895b48 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 21 Aug 2024 16:50:44 +0300 Subject: [PATCH] update .drone.yml --- .drone.yml | 235 +++++++++++++++++++++++++---------------------------- 1 file changed, 111 insertions(+), 124 deletions(-) diff --git a/.drone.yml b/.drone.yml index 23dc182..1682622 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,13 +3,17 @@ kind: pipeline type: docker name: develop build +image_pull_secrets: + - DOCKER_AUTH + trigger: branch: - develop services: - name: docker - image: docker:20.10.22-dind-alpine3.17 + # https://hub.docker.com/r/library/docker + image: hub.docker.struchkov.dev/docker:27.0.3-dind-alpine3.20 privileged: true volumes: - name: dockersock @@ -24,7 +28,8 @@ volumes: steps: - name: create jar - image: maven:3.8.6-eclipse-temurin-17 + # https://hub.docker.com/_/maven + image: hub.docker.struchkov.dev/maven:3.9-eclipse-temurin-17-alpine volumes: - name: m2 path: /root/.m2/repository @@ -32,26 +37,15 @@ steps: - mvn -U clean package - name: docker publish develop - image: upagge/docker-buildx:latest + image: docker.struchkov.dev/docker-buildx:latest environment: - STRUCHKOV_DOCKER_REGISTRY_TOKEN: - from_secret: STRUCHKOV_DOCKER_REGISTRY_TOKEN - STRUCHKOV_DOCKER_IMAGE_NAME: - from_secret: STRUCHKOV_DOCKER_IMAGE_NAME - 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 "$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 - 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.struchkov.dev/gitlab-notify:develop" . --- @@ -59,13 +53,17 @@ kind: pipeline type: docker name: release build +image_pull_secrets: + - DOCKER_AUTH + trigger: ref: - refs/tags/v.*.*.* services: - name: docker - image: docker:20.10.22-dind-alpine3.17 + # https://hub.docker.com/r/library/docker + image: hub.docker.struchkov.dev/docker:27.0.3-dind-alpine3.20 privileged: true volumes: - name: dockersock @@ -88,122 +86,111 @@ steps: - mvn -U clean package - name: docker publish release - image: upagge/docker-buildx:latest - environment: - STRUCHKOV_DOCKER_REGISTRY_TOKEN: - from_secret: STRUCHKOV_DOCKER_REGISTRY_TOKEN - STRUCHKOV_DOCKER_IMAGE_NAME: - from_secret: STRUCHKOV_DOCKER_IMAGE_NAME - DOCKER_REGISTRY_TOKEN: - from_secret: DOCKER_REGISTRY_TOKEN - DOCKER_IMAGE_NAME: - from_secret: DOCKER_IMAGE_NAME - DOCKER_REGISTRY_USER: - from_secret: DOCKER_REGISTRY_USER + image: docker.struchkov.dev/docker-buildx:latest volumes: - name: dockersock path: /var/run commands: - - 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 - 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.struchkov.dev/gitlab-notify:latest" -t "docker.struchkov.dev/gitlab-notify:$DRONE_TAG" . ---- -kind: pipeline -type: docker -name: create-develop-docs-site +#--- +#kind: pipeline +#type: docker +#name: create-develop-docs-site +# +#trigger: +# branch: +# - develop +# - docs +# +#clone: +# disable: true +# +#steps: +# +# - name: build docs +# image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest +# volumes: +# - name: mkdocs_cache +# path: ${DRONE_WORKSPACE}/documentation/ru/.cache +# environment: +# GIT_SSH: +# from_secret: GIT_SSH +# GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" +# commands: +# - eval $(ssh-agent -s) +# - mkdir -p ~/.ssh +# - chmod 700 ~/.ssh +# - echo "$GIT_SSH" >> ~/.ssh/id_rsa +# - 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 clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . +# - git checkout $DRONE_COMMIT +# - cd documentation/ru +# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases develop +# +#image_pull_secrets: +# - DOCKER_AUTH +# +#volumes: +# - name: mkdocs_cache +# host: +# path: /drone/volume/mkdocs_cache/gitlab_notification/ru +# +#--- +#kind: pipeline +#type: docker +#name: create-release-docs-site +# +#trigger: +# ref: +# - refs/tags/v.*.*.* +# +#clone: +# disable: true +# +#steps: +# +# - name: build docs +# image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest +# volumes: +# - name: mkdocs_cache +# path: ${DRONE_WORKSPACE}/documentation/ru/.cache +# environment: +# GIT_SSH: +# from_secret: GIT_SSH +# GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" +# commands: +# - eval $(ssh-agent -s) +# - mkdir -p ~/.ssh +# - chmod 700 ~/.ssh +# - echo "$GIT_SSH" >> ~/.ssh/id_rsa +# - 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 clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . +# - git checkout $DRONE_COMMIT +# - cd documentation/ru +# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases ${DRONE_TAG} +# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases latest +# +#image_pull_secrets: +# - DOCKER_AUTH +# +#volumes: +# - name: mkdocs_cache +# host: +# path: /drone/volume/mkdocs_cache/gitlab_notification\ -trigger: - branch: - - develop - - docs - -clone: - disable: true - -steps: - - - name: build docs - image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest - volumes: - - name: mkdocs_cache - path: ${DRONE_WORKSPACE}/documentation/ru/.cache - environment: - GIT_SSH: - from_secret: GIT_SSH - GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" - commands: - - eval $(ssh-agent -s) - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$GIT_SSH" >> ~/.ssh/id_rsa - - 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 clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . - - git checkout $DRONE_COMMIT - - cd documentation/ru - - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases develop - -image_pull_secrets: - - DOCKER_AUTH - -volumes: - - name: mkdocs_cache - host: - path: /drone/volume/mkdocs_cache/gitlab_notification/ru - ---- -kind: pipeline -type: docker -name: create-release-docs-site - -trigger: - ref: - - refs/tags/v.*.*.* - -clone: - disable: true - -steps: - - - name: build docs - image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest - volumes: - - name: mkdocs_cache - path: ${DRONE_WORKSPACE}/documentation/ru/.cache - environment: - GIT_SSH: - from_secret: GIT_SSH - GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" - commands: - - eval $(ssh-agent -s) - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$GIT_SSH" >> ~/.ssh/id_rsa - - 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 clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . - - git checkout $DRONE_COMMIT - - cd documentation/ru - - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases ${DRONE_TAG} - - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases latest - -image_pull_secrets: - - DOCKER_AUTH - -volumes: - - name: mkdocs_cache - host: - path: /drone/volume/mkdocs_cache/gitlab_notification +# drone sign --save Telegram-Bots/gitlab-notification --- kind: signature -hmac: cf1bd0800e8f6bb49dae0a6c5f607676b87d5ee713f4203f4f1ed08a17f71f68 +hmac: 0f4fa66591566ee4272ac8c36e887966037a407a1441575ef26e1813205a7ae8 ...