Compare commits
2 Commits
3685ffb4a9
...
deef6dfb69
Author | SHA1 | Date | |
---|---|---|---|
deef6dfb69 | |||
033ca4c053 |
38
.drone.yml
38
.drone.yml
@ -63,6 +63,44 @@ steps:
|
|||||||
- name: docker-sock
|
- name: docker-sock
|
||||||
path: /var/run
|
path: /var/run
|
||||||
|
|
||||||
|
services:
|
||||||
|
- name: docker
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- name: gopath
|
||||||
|
path: /go
|
||||||
|
|
||||||
|
- name: build_image
|
||||||
|
image: plugins/docker
|
||||||
|
commands:
|
||||||
|
- branch=$(echo $CI_COMMIT_BRANCH | grep -v '/') || echo $CI_COMMIT_BRANCH
|
||||||
|
- p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s)
|
||||||
|
- p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s)
|
||||||
|
- tag=${branch:-$p1-$p2}
|
||||||
|
- docker build -t git.pbiernat.dev/golang/vegvisir:$tag -f Dockerfile.build .
|
||||||
|
volumes:
|
||||||
|
- name: docker-sock
|
||||||
|
path: /var/run
|
||||||
|
|
||||||
|
- name: push_image
|
||||||
|
image: plugins/docker
|
||||||
|
environment:
|
||||||
|
DOCKER_USERNAME:
|
||||||
|
from_secret: registry_username
|
||||||
|
DOCKER_PASSWORD:
|
||||||
|
from_secret: registry_password
|
||||||
|
commands:
|
||||||
|
- simple=$(echo $CI_COMMIT_BRANCH | grep '/') || echo $CI_COMMIT_BRANCH
|
||||||
|
- p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s)
|
||||||
|
- p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s)
|
||||||
|
- tag=${simple:=$p1-$p2}
|
||||||
|
- echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin &&
|
||||||
|
- docker push git.pbiernat.dev/golang/vegvisir:$tag
|
||||||
|
volumes:
|
||||||
|
- name: docker-sock
|
||||||
|
path: /var/run
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: docker
|
- name: docker
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
|
Loading…
Reference in New Issue
Block a user