Update .drone.yml
This commit is contained in:
84
.drone.yml
84
.drone.yml
@@ -1,58 +1,48 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
type: kubernetes
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
|
node_selector:
|
||||||
|
physical-node: dev2
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
workspace:
|
workspace:
|
||||||
path: /drone/src
|
path: /drone/src
|
||||||
|
|
||||||
environment:
|
|
||||||
IMAGE_NAME: installer-tool
|
|
||||||
DOCKER_REGISTRY_URL: registry.format.hu
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build demo image
|
- name: build multiarch from dev
|
||||||
image: plugins/docker
|
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||||
commands:
|
privileged: true
|
||||||
- cd /drone/src/
|
settings:
|
||||||
- docker build -t $${DOCKER_REGISTRY_URL}/$${IMAGE_NAME} -f Dockerfile .
|
cache-from: [ "registry.dev.format.hu/installer-tool" ]
|
||||||
- docker push $${DOCKER_REGISTRY_URL}/$${IMAGE_NAME}
|
registry: registry.dev.format.hu
|
||||||
|
repo: registry.dev.format.hu/installer-tool
|
||||||
|
tags: latest
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
username:
|
||||||
|
from_secret: dev-hu-registry-username
|
||||||
|
password:
|
||||||
|
from_secret: dev-hu-registry-password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
|
||||||
|
- name: pull image to dockerhub
|
||||||
|
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
cache-from: [ "safebox/installer-tool" ]
|
||||||
|
repo: safebox/installer-tool
|
||||||
|
tags: latest
|
||||||
|
username:
|
||||||
|
from_secret: dockerhub-username
|
||||||
|
password:
|
||||||
|
from_secret: dockerhub-password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
volumes:
|
|
||||||
- name: docker
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
|
||||||
- name: update public installer repository
|
|
||||||
image: alpine:latest
|
|
||||||
environment:
|
|
||||||
TOKEN:
|
|
||||||
from_secret: TOKEN
|
|
||||||
GIT_URL: https://git.format.hu
|
|
||||||
REPO: public/local-install
|
|
||||||
FILE_PATH: install.sh
|
|
||||||
|
|
||||||
commands:
|
|
||||||
- apk --update add curl jq
|
|
||||||
- URL="$GIT_URL/api/v1/repos/$REPO/contents/$FILE_PATH"
|
|
||||||
- |
|
|
||||||
SHA=$(curl -s -H "Authorization: token $TOKEN" -H "Accept: application/json" $URL | jq -r '.sha')
|
|
||||||
CONTENT=$(cat /drone/src/install.sh | base64 -w0)
|
|
||||||
DATA=$(printf '{"message": "Modifying install.sh", "sha": "'$SHA'", "content": "%s", "branch": "main"}' "$CONTENT")
|
|
||||||
curl -X PUT -s -H "Authorization: token $TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" -d "$DATA" $URL
|
|
||||||
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
volumes:
|
|
||||||
- name: docker
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: docker
|
|
||||||
host:
|
|
||||||
path: /var/run/docker.sock
|
|
Reference in New Issue
Block a user