88 lines
1.4 KiB
Plaintext
88 lines
1.4 KiB
Plaintext
local images = {
|
|
docker: {
|
|
name: 'docker',
|
|
image: 'docker:dind',
|
|
},
|
|
scp(target): {
|
|
name: 'scp',
|
|
image: 'appleboy/drone-scp',
|
|
settings: {
|
|
host: {
|
|
from_secret: 'ssh-host',
|
|
},
|
|
username: {
|
|
from_secret: 'ssh-user',
|
|
},
|
|
password: {
|
|
from_secret: 'ssh-password',
|
|
},
|
|
port: {
|
|
from_secret: 'ssh-port',
|
|
},
|
|
command_timeout: '2m',
|
|
target: target,
|
|
source: [
|
|
'.',
|
|
],
|
|
},
|
|
},
|
|
wait(delay): {
|
|
image: 'alpine',
|
|
name: 'wait',
|
|
commands: [
|
|
'sleep %s' % delay,
|
|
],
|
|
}
|
|
};
|
|
[
|
|
{
|
|
kind: 'pipeline',
|
|
type: 'docker',
|
|
name: 'build',
|
|
clone: {
|
|
disable: false,
|
|
depth: 0,
|
|
},
|
|
services: [
|
|
images.docker {
|
|
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',
|
|
},
|
|
},
|
|
{
|
|
name: 'ssh',
|
|
host: {
|
|
path: '/home/giles/.ssh'
|
|
},
|
|
},
|
|
],
|
|
steps:[
|
|
images.scp(
|
|
'/stack/root'
|
|
),
|
|
images.wait(15),
|
|
],
|
|
}
|
|
]
|
|
|