Merge branch 'dev/ci-docker-builder' into develop
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
7f8f915653
15
.drone.yml
15
.drone.yml
@ -32,12 +32,13 @@ steps:
|
|||||||
- name: build_image
|
- name: build_image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
commands:
|
commands:
|
||||||
|
- env
|
||||||
|
- echo $CI_COMMIT_BRANCH ;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} &&
|
||||||
|
echo $tag
|
||||||
- ./test.sh
|
- ./test.sh
|
||||||
# - 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}
|
|
||||||
# - echo $tag
|
|
||||||
# - docker build -t git.pbiernat.dev/golang/vegvisir:$tag -f Dockerfile.build .
|
# - docker build -t git.pbiernat.dev/golang/vegvisir:$tag -f Dockerfile.build .
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-sock
|
- name: docker-sock
|
||||||
@ -56,8 +57,8 @@ steps:
|
|||||||
- p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s)
|
- p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s)
|
||||||
- tag=${branch:=$p1-$p2}
|
- tag=${branch:=$p1-$p2}
|
||||||
- echo $tag
|
- echo $tag
|
||||||
- echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin &&
|
# - echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin &&
|
||||||
- docker push git.pbiernat.dev/golang/vegvisir:$tag
|
# - docker push git.pbiernat.dev/golang/vegvisir:$tag
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-sock
|
- name: docker-sock
|
||||||
path: /var/run
|
path: /var/run
|
||||||
|
17
test.sh
17
test.sh
@ -1,15 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
# set -e
|
||||||
set -x
|
# set -x
|
||||||
|
|
||||||
# BRANCH="dev/ci-docker-builder"
|
# BRANCH="dev/ci-docker-builder"
|
||||||
BRANCH="develop"
|
# BRANCH="develop"
|
||||||
|
BRANCH=$CI_COMMIT_BRANCH
|
||||||
|
|
||||||
simple=$(echo $BRANCH | grep -v '/') || echo $BRANCH
|
branch=$(echo $BRANCH | grep -v /) || echo $BRANCH ;
|
||||||
p1=$(echo $BRANCH | cut -d '/' -f1 -s)
|
p1=$(echo $BRANCH | cut -d / -f1 -s) &&
|
||||||
p2=$(echo $BRANCH | cut -d '/' -f2 -s)
|
p2=$(echo $BRANCH | cut -d / -f2 -s) &&
|
||||||
tag=${simple:-$p1-$p2}
|
tag=${branch:=$p1-$p2} &&
|
||||||
echo $tag
|
echo "tag:" $tag
|
||||||
|
|
||||||
# p1=$(echo "develop" | grep -s '/') && echo "1: $p1"
|
# p1=$(echo "develop" | grep -s '/') && echo "1: $p1"
|
||||||
# p2=$(echo "develop/fix" | grep -s '/') && echo "2: $p2"
|
# p2=$(echo "develop/fix" | grep -s '/') && echo "2: $p2"
|
||||||
|
Loading…
Reference in New Issue
Block a user