2020-05-20 12:26:13 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: robot-image
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: cleanup and build
|
2020-07-01 02:28:31 +00:00
|
|
|
image: docker:19.03.11-dind
|
2020-05-20 12:26:13 +00:00
|
|
|
environment:
|
|
|
|
IMG_NAME: 'registry.nspcc.ru/docker-local/robot'
|
2020-07-01 02:28:31 +00:00
|
|
|
REG_USR: 'admin'
|
|
|
|
REG_PWD:
|
|
|
|
from_secret: docker_passwd
|
|
|
|
JF_TOKEN:
|
|
|
|
from_secret: api_key
|
2020-05-20 12:26:13 +00:00
|
|
|
volumes:
|
|
|
|
- name: docker_sock
|
|
|
|
path: /var/run/docker.sock
|
|
|
|
commands:
|
|
|
|
- ./images_cleanup.sh
|
|
|
|
- docker build --no-cache -t $IMG_NAME:latest ./
|
2020-07-01 02:28:31 +00:00
|
|
|
- docker login registry.nspcc.ru -u admin -p "$REG_PWD"
|
2020-05-20 12:26:13 +00:00
|
|
|
- docker push $IMG_NAME:latest
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
2020-07-01 02:28:31 +00:00
|
|
|
- pull_request
|
2020-05-20 12:26:13 +00:00
|
|
|
|
|
|
|
# host volume mount requires a repository to be `trusted`
|
|
|
|
# in drone; this option enables in repository settings
|
|
|
|
# by admin user
|
|
|
|
volumes:
|
|
|
|
- name: docker_sock
|
|
|
|
host:
|
|
|
|
path: /var/run/docker.sock
|