2020-07-30 14:32:27 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: scp
|
|
|
|
image: appleboy/drone-scp
|
|
|
|
settings:
|
|
|
|
command_timeout: 2m
|
2020-08-05 07:49:09 +00:00
|
|
|
host:
|
|
|
|
from_secret: ssh-host
|
|
|
|
key:
|
|
|
|
from_secret: ssh-key
|
|
|
|
port:
|
|
|
|
from_secret: ssh-port
|
2020-07-30 14:32:27 +00:00
|
|
|
source:
|
|
|
|
- .
|
|
|
|
target: /stack/squid
|
2020-08-05 07:49:09 +00:00
|
|
|
username:
|
|
|
|
from_secret: ssh-user
|
2020-07-30 14:32:27 +00:00
|
|
|
|
|
|
|
- name: wait
|
|
|
|
image: alpine
|
|
|
|
commands:
|
|
|
|
- sleep 15
|
|
|
|
|
2020-08-06 09:28:48 +00:00
|
|
|
- name: "dockerbuild docker image:"
|
|
|
|
image: docker:dind
|
|
|
|
commands:
|
|
|
|
- set -e
|
|
|
|
- pwd
|
|
|
|
- sleep 15
|
|
|
|
- cd docker
|
|
|
|
- docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${LOCAL_REGISTRY_PASSWORD}"
|
|
|
|
- docker build . -t $${LOCAL_DOCKER_REGISTRY}squid
|
|
|
|
- docker push $${LOCAL_DOCKER_REGISTRY}squid
|
|
|
|
- docker logout $${LOCAL_DOCKER_REGISTRY}
|
2020-08-05 11:31:43 +00:00
|
|
|
environment:
|
|
|
|
LOCAL_DOCKER_REGISTRY:
|
|
|
|
from_secret: local-docker-registry
|
|
|
|
LOCAL_REGISTRY_PASSWORD:
|
|
|
|
from_secret: local-registry-password
|
2020-08-06 09:28:48 +00:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
2020-07-30 14:32:27 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
- name: ca
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
|
|
|
- name: ca
|
|
|
|
host:
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
|
|
|
|
...
|