Compare commits

..

6 Commits

Author SHA1 Message Date
7438d94ee1 Merge branch 'dev/ci-docker-builder' into develop
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-17 21:19:46 +02:00
deef6dfb69 Merge branch 'dev/ci-docker-builder' into develop
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-17 20:01:28 +02:00
033ca4c053 [test] Multistage build with drone CI
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-04-17 19:56:22 +02:00
3685ffb4a9 Merge branch 'dev/ci-docker-builder' into develop
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-17 13:26:47 +02:00
9088de4317 [test] Multistage build with drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-17 12:51:48 +02:00
6bc22c2b6b [test] Multistage build with drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-17 00:38:48 +02:00
2 changed files with 37 additions and 8 deletions

View File

@ -32,12 +32,13 @@ steps:
- name: build_image - name: build_image
image: plugins/docker image: plugins/docker
commands: commands:
- branch=$(echo $CI_COMMIT_BRANCH | grep -v '/') || echo $CI_COMMIT_BRANCH - ./test.sh
- p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s) # - branch=$(echo $CI_COMMIT_BRANCH | grep -v '/') || echo $CI_COMMIT_BRANCH
- p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s) # - p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s)
- tag=${branch:-$p1-$p2} # - p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s)
- echo $tag # - tag=${branch:-$p1-$p2}
- docker build -t git.pbiernat.dev/golang/vegvisir:$tag -f Dockerfile.build . # - echo $tag
# - docker build -t git.pbiernat.dev/golang/vegvisir:$tag -f Dockerfile.build .
volumes: volumes:
- name: docker-sock - name: docker-sock
path: /var/run path: /var/run
@ -50,7 +51,7 @@ steps:
DOCKER_PASSWORD: DOCKER_PASSWORD:
from_secret: registry_password from_secret: registry_password
commands: commands:
- branch=$(echo $CI_COMMIT_BRANCH | grep '/') || echo $CI_COMMIT_BRANCH - branch=$(echo $CI_COMMIT_BRANCH | grep -v '/') || echo $CI_COMMIT_BRANCH
- p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s) - p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s)
- 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}
@ -60,7 +61,7 @@ steps:
volumes: volumes:
- name: docker-sock - name: docker-sock
path: /var/run path: /var/run
services: services:
- name: docker - name: docker
image: docker:dind image: docker:dind

28
test.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
set -e
set -x
# BRANCH="dev/ci-docker-builder"
BRANCH="develop"
simple=$(echo $BRANCH | grep -v '/') || echo $BRANCH
p1=$(echo $BRANCH | cut -d '/' -f1 -s)
p2=$(echo $BRANCH | cut -d '/' -f2 -s)
tag=${simple:-$p1-$p2}
echo $tag
# p1=$(echo "develop" | grep -s '/') && echo "1: $p1"
# p2=$(echo "develop/fix" | grep -s '/') && echo "2: $p2"
# p3=$(echo "develop" | grep -s -v '/') && echo "3: $p3"
# p4=$(echo "develop/fix" | grep -s -v '/') && echo "4: $p4"
# echo $p1 $p2 $p3 $p4
# echo "DONE"
#simple=$(echo $BRANCH | grep -v '/') ;
#p1=$(echo $BRANCH | cut -d '/' -f1 -s) ;
#p2=$(echo $BRANCH | cut -d '/' -f2 -s) ;
#tag=${simple:=$p1-$p2} &&
#echo "TAG:" $tag