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', }, ], }, ], volumes: [ { name: 'dockersock', temp: {}, }, { name: 'ca', host: { path: '/etc/docker/certs.d', }, }, ], steps:[ images(config).docker { name +: 'pull and save docker images:', environment +: environment .environmentSecrets([ 'REGISTRY_PASSWORD', 'REGISTRY_DOMAIN', 'REGISTRY_PORT', ]), 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' ] } /* local steps = import '../steps/steps.libsonnet'; local docker = import '../docker.libsonnet'; local images = import '../images.libsonnet'; local util = import '../util.libsonnet'; function(config) function(trigger) [ docker(config).pipeline { name: 'registry', trigger: trigger, steps: [ images(config).docker { name +: 'build docker images:', environment +: util.environment([ 'LOCAL_DOCKER_REGISTRY', 'LOCAL_REGISTRY_PASSWORD', ]), volumes: [ { name: 'dockersock', path: '/var/run', }, ], commands: [ 'set -e', 'sleep 40', 'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${LOCAL_REGISTRY_PASSWORD}"', 'sh jsonnet/lib/initialise-images.sh %(registry)s' % config, 'docker logout $${LOCAL_DOCKER_REGISTRY}', ], }, ], services +: [ docker(config).service, ], volumes +: docker(config).volumes, }, ] */