jsonnet-drone/registry.libsonnet

75 lines
1.7 KiB
Plaintext

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',
},
{
name: 'daemonjson',
path: '/etc/docker/daemon.json',
},
],
},
],
volumes: [
{
name: 'dockersock',
temp: {},
},
{
name: 'ca',
host: {
path: '/etc/docker/certs.d',
},
},
{
name: 'daemonjson',
host: {
path: '/etc/docker/daemon.json',
},
},
],
steps:[
images(config).docker {
name +: 'pull and save docker images:',
environment +: environment
.environmentSecrets(config.secrets),
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
],
commands: [
'set -e',
'export REGISTRY=$${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/',
'%(script)s $${REGISTRY} "$${REGISTRY_PASSWORD}"' % config,
],
},
],
image_pull_secrets: [
'dockerconfigjson'
]
}