[feature] Build & publish dev tag after push to feature/* branch
This commit is contained in:
parent
cafd520a6c
commit
e2fe171924
69
.drone.yml
69
.drone.yml
@ -4,17 +4,19 @@ type: docker
|
||||
name: Build
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
- name: build_release
|
||||
image: plugins/docker
|
||||
commands:
|
||||
- sleep 5
|
||||
- docker build -t docker.pbiernat.dev/nginx-php .
|
||||
- docker images | grep nginx-php
|
||||
when:
|
||||
branch: master
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
path: /var/run
|
||||
|
||||
- name: publish
|
||||
- name: publish_release
|
||||
image: plugins/docker
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
@ -31,6 +33,69 @@ steps:
|
||||
- name: docker-sock
|
||||
path: /var/run
|
||||
|
||||
#- name: build_develop
|
||||
# image: plugins/docker
|
||||
# commands:
|
||||
# - sleep 5
|
||||
# - docker build -t docker.pbiernat.dev/nginx-php:dev .
|
||||
# - docker images --format "{{.Repository}}:{{.Tag}}" | grep nginx-php:dev
|
||||
# when:
|
||||
# branch: develop
|
||||
# volumes:
|
||||
# - name: docker-sock
|
||||
# path: /var/run
|
||||
|
||||
#- name: publish_develop
|
||||
# image: plugins/docker
|
||||
# privileged: true
|
||||
# environment:
|
||||
# DOCKER_USERNAME:
|
||||
# from_secret: registry_username
|
||||
# DOCKER_PASSWORD:
|
||||
# from_secret: registry_password
|
||||
# commands:
|
||||
# - sleep 5
|
||||
# - docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||
# - docker push docker.pbiernat.dev/nginx-php:dev
|
||||
# when:
|
||||
# branch: develop
|
||||
# event: push
|
||||
# volumes:
|
||||
# - name: docker-sock
|
||||
# path: /var/run
|
||||
|
||||
- name: build_feature
|
||||
image: plugins/docker
|
||||
commands:
|
||||
- sleep 5
|
||||
- docker build -t docker.pbiernat.dev/nginx-php:$CI_COMMIT_BRANCH .
|
||||
- docker images --format "{{.Repository}}:{{.Tag}}" | grep nginx-php:${CI_COMMIT_BRANCH}
|
||||
when:
|
||||
branch: feature_*
|
||||
event: push
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
path: /var/run
|
||||
|
||||
- name: publish_feature
|
||||
image: plugins/docker
|
||||
privileged: true
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
from_secret: registry_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: registry_password
|
||||
commands:
|
||||
- sleep 5
|
||||
- docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||
- docker push docker.pbiernat.dev/nginx-php:$CI_COMMIT_BRANCH
|
||||
when:
|
||||
branch: feature_*
|
||||
event: push
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
path: /var/run
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
|
@ -1,10 +1,8 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
root /var/www/app/public;
|
||||
|
||||
location / {
|
||||
# try to serve file directly, fallback to index.php
|
||||
try_files $uri /index.php$is_args$args;
|
||||
}
|
||||
|
||||
@ -14,7 +12,7 @@ server {
|
||||
include fastcgi_params;
|
||||
|
||||
# optionally set the value of the environment variables used in the application
|
||||
# fastcgi_param APP_ENV prod;
|
||||
fastcgi_param APP_ENV dev;
|
||||
# fastcgi_param APP_SECRET <app-secret-id>;
|
||||
# fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
|
||||
|
||||
@ -27,7 +25,8 @@ server {
|
||||
# for more information).
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||
# Prevents URIs that include the front controller. This will 404:
|
||||
|
||||
# Prevents URIs that include the front controller. This will 404:
|
||||
# http://domain.tld/index.php/some-path
|
||||
# Remove the internal directive to allow URIs like this
|
||||
internal;
|
||||
|
@ -2,6 +2,7 @@
|
||||
logfile=/var/log/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
nodaemon=false
|
||||
user=root
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx -g 'daemon off;'
|
||||
@ -21,4 +22,4 @@ priority=5
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
stderr_logfile_maxbytes=0
|
||||
|
Loading…
Reference in New Issue
Block a user