2020-09-24 12:48:43 +00:00
|
|
|
local build = import 'lib/build.libsonnet';
|
|
|
|
local images = import 'lib/images.libsonnet';
|
|
|
|
local environment = import 'lib/node_modules/@sigyl/jsonnet-drone-environment/environment.libsonnet';
|
|
|
|
local compose = import 'lib/node_modules/@sigyl/jsonnet-compose/compose.libsonnet';
|
|
|
|
local util = import 'lib/util.libsonnet';
|
|
|
|
|
|
|
|
function(config)
|
|
|
|
{
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: 'registry',
|
|
|
|
clone: {
|
|
|
|
disable: false,
|
|
|
|
depth: 0,
|
|
|
|
},
|
|
|
|
services: [
|
|
|
|
images(config).docker {
|
|
|
|
privileged: true,
|
|
|
|
volumes: [
|
|
|
|
{
|
|
|
|
name: 'dockersock',
|
|
|
|
path: '/var/run',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'ca',
|
|
|
|
path: '/etc/docker/certs.d',
|
|
|
|
},
|
2020-10-22 12:10:13 +00:00
|
|
|
{
|
|
|
|
name: 'daemonjson',
|
|
|
|
path: '/etc/docker/daemon.json',
|
|
|
|
},
|
2020-09-24 12:48:43 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
volumes: [
|
|
|
|
{
|
|
|
|
name: 'dockersock',
|
|
|
|
temp: {},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'ca',
|
|
|
|
host: {
|
|
|
|
path: '/etc/docker/certs.d',
|
|
|
|
},
|
|
|
|
},
|
2020-10-22 12:10:13 +00:00
|
|
|
{
|
|
|
|
name: 'daemonjson',
|
|
|
|
host: {
|
|
|
|
path: '/etc/docker/daemon.json',
|
|
|
|
},
|
|
|
|
},
|
2020-09-24 12:48:43 +00:00
|
|
|
],
|
|
|
|
steps:[
|
|
|
|
images(config).docker {
|
|
|
|
name +: 'pull and save docker images:',
|
|
|
|
environment +: environment
|
2020-09-24 13:52:21 +00:00
|
|
|
.environmentSecrets(config.secrets),
|
2020-09-24 12:48:43 +00:00
|
|
|
volumes: [
|
|
|
|
{
|
|
|
|
name: 'dockersock',
|
|
|
|
path: '/var/run',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
commands: [
|
|
|
|
'set -e',
|
|
|
|
'export REGISTRY=$${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/',
|
2020-10-06 18:38:37 +00:00
|
|
|
'%(script)s $${REGISTRY} "$${REGISTRY_PASSWORD}"' % config,
|
2020-09-24 12:48:43 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
image_pull_secrets: [
|
|
|
|
'dockerconfigjson'
|
|
|
|
]
|
|
|
|
}
|