2021-11-21 15:22:09 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Build
|
|
|
|
|
|
|
|
steps:
|
2021-11-23 12:57:04 +01:00
|
|
|
- name: build_release
|
2021-11-21 15:22:09 +01:00
|
|
|
image: plugins/docker
|
|
|
|
commands:
|
|
|
|
- sleep 5
|
|
|
|
- docker build -t docker.pbiernat.dev/nginx-php .
|
|
|
|
- docker images | grep nginx-php
|
2021-11-23 12:57:04 +01:00
|
|
|
when:
|
|
|
|
event: tag
|
2021-11-21 15:22:09 +01:00
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
2021-11-23 12:57:04 +01:00
|
|
|
- name: publish_release
|
2021-11-21 15:22:09 +01:00
|
|
|
image: plugins/docker
|
|
|
|
environment:
|
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: registry_username
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: registry_password
|
|
|
|
commands:
|
|
|
|
- sleep 5
|
2021-11-23 15:43:39 +01:00
|
|
|
# - docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
|
|
|
# - docker push docker.pbiernat.dev/nginx-php
|
2021-11-21 15:22:09 +01:00
|
|
|
when:
|
2021-11-23 12:57:04 +01:00
|
|
|
event: tag
|
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
- name: build_develop
|
|
|
|
image: plugins/docker
|
|
|
|
commands:
|
|
|
|
- sleep 5
|
2021-11-23 15:43:39 +01:00
|
|
|
#- env
|
|
|
|
- ./scripts/drone-build.sh
|
2021-11-23 12:57:04 +01:00
|
|
|
when:
|
|
|
|
branch: develop
|
2021-11-23 15:29:27 +01:00
|
|
|
event:
|
|
|
|
- push
|
2021-11-23 12:57:04 +01:00
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
- name: publish_develop
|
|
|
|
image: plugins/docker
|
2021-11-23 15:43:39 +01:00
|
|
|
# privileged: true
|
2021-11-23 12:57:04 +01:00
|
|
|
environment:
|
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: registry_username
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: registry_password
|
|
|
|
commands:
|
|
|
|
- sleep 5
|
2021-11-23 15:43:39 +01:00
|
|
|
# - docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
|
|
|
# - docker push docker.pbiernat.dev/nginx-php:dev
|
|
|
|
- ./scripts/drone-publish.sh
|
2021-11-23 12:57:04 +01:00
|
|
|
when:
|
|
|
|
branch: develop
|
2021-11-23 15:43:39 +01:00
|
|
|
event:
|
|
|
|
- push
|
2021-11-23 12:57:04 +01:00
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
- name: build_feature
|
|
|
|
image: plugins/docker
|
|
|
|
commands:
|
2021-11-23 15:43:39 +01:00
|
|
|
- env
|
2021-11-23 12:57:04 +01:00
|
|
|
- sleep 5
|
2021-11-23 15:43:39 +01:00
|
|
|
#- docker build -t docker.pbiernat.dev/nginx-php:$CI_COMMIT_BRANCH .
|
|
|
|
#- docker images --format "{{.Repository}}:{{.Tag}}" | grep nginx-php:${CI_COMMIT_BRANCH}
|
|
|
|
- ./scripts/drone-build.sh
|
2021-11-23 12:57:04 +01:00
|
|
|
when:
|
2021-11-23 15:43:39 +01:00
|
|
|
branch:
|
|
|
|
- feature_*
|
|
|
|
- develop
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
2021-11-23 12:57:04 +01:00
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
- name: publish_feature
|
|
|
|
image: plugins/docker
|
2021-11-23 15:43:39 +01:00
|
|
|
# privileged: true
|
2021-11-23 12:57:04 +01:00
|
|
|
environment:
|
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: registry_username
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: registry_password
|
|
|
|
commands:
|
2021-11-23 15:43:39 +01:00
|
|
|
# - env
|
2021-11-23 12:57:04 +01:00
|
|
|
- sleep 5
|
2021-11-23 15:43:39 +01:00
|
|
|
#- docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
|
|
|
#- docker push docker.pbiernat.dev/nginx-php:$CI_COMMIT_BRANCH
|
|
|
|
- ./scripts/drone-publish.sh
|
2021-11-23 12:57:04 +01:00
|
|
|
when:
|
2021-11-23 15:43:30 +01:00
|
|
|
branch: develop
|
2021-11-23 15:43:39 +01:00
|
|
|
event:
|
|
|
|
- pull_request
|
2021-11-21 15:22:09 +01:00
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: docker-sock
|
|
|
|
temp: {}
|