Compare commits

..

No commits in common. "1180a2a1bf7185f7e52cb9033795b5d8ff4a3424" and "b674704a31f02b3ede9f0e2b4398ac12f94d996a" have entirely different histories.

5 changed files with 14 additions and 134 deletions

View File

@ -4,40 +4,17 @@ type: docker
name: Build name: Build
steps: steps:
- name: build_release - name: build
image: plugins/docker
when:
event: tag
volumes:
- name: docker-sock
path: /var/run
- name: publish_release
image: plugins/docker
environment:
DOCKER_USERNAME:
from_secret: registry_username
DOCKER_PASSWORD:
from_secret: registry_password
when:
event: tag
volumes:
- name: docker-sock
path: /var/run
- name: build_develop
image: plugins/docker image: plugins/docker
commands: commands:
- ./scripts/drone-build.sh - sleep 5
when: - docker build -t docker.pbiernat.dev/nginx-php .
branch: develop - docker images | grep nginx-php
event:
- push
volumes: volumes:
- name: docker-sock - name: docker-sock
path: /var/run path: /var/run
- name: publish_develop - name: publish
image: plugins/docker image: plugins/docker
environment: environment:
DOCKER_USERNAME: DOCKER_USERNAME:
@ -45,43 +22,11 @@ steps:
DOCKER_PASSWORD: DOCKER_PASSWORD:
from_secret: registry_password from_secret: registry_password
commands: commands:
- ./scripts/drone-publish.sh - sleep 5
- docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker push docker.pbiernat.dev/nginx-php
when: when:
branch: develop branch: master
event:
- push
volumes:
- name: docker-sock
path: /var/run
- name: build_feature
image: plugins/docker
commands:
- ./scripts/drone-build.sh
when:
branch:
- feature_*
- develop
event:
- push
- pull_request
volumes:
- name: docker-sock
path: /var/run
- name: publish_feature
image: plugins/docker
environment:
DOCKER_USERNAME:
from_secret: registry_username
DOCKER_PASSWORD:
from_secret: registry_password
commands:
- ./scripts/drone-publish.sh
when:
branch: develop
event:
- pull_request
volumes: volumes:
- name: docker-sock - name: docker-sock
path: /var/run path: /var/run

View File

@ -1,36 +0,0 @@
#!/bin/sh
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" != "$string"
then
return 0 # $substring is in $string
else
return 1 # $substring is not in $string
fi
}
branch=$CI_COMMIT_BRANCH
event=$CI_BUILD_EVENT
source_branch=$DRONE_SOURCE_BRANCH
step_name=$DRONE_STEP_NAME
if { contains "$branch" "feature_" && [ "$event" = push ]; } ; then
sleep 5
docker build -t docker.pbiernat.dev/nginx-php:$branch .
return 0
fi
if { [ "$branch" = develop ] && [ "$event" = pull_request ]; } ; then
sleep 5
docker build -t docker.pbiernat.dev/nginx-php:$source_branch .
return 0
fi
if { [ "$branch" = develop ] && [ "$event" = push ] && [ "$step_name" != build_feature ]; } ; then
sleep 5
docker build -t docker.pbiernat.dev/nginx-php:dev .
return 0
fi

View File

@ -1,29 +0,0 @@
#!/bin/sh
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" != "$string"
then
return 0 # $substring is in $string
else
return 1 # $substring is not in $string
fi
}
branch=$CI_COMMIT_BRANCH
event=$CI_BUILD_EVENT
source_branch=$DRONE_SOURCE_BRANCH
docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
if { [ "$branch" = develop ] && [ "$event" = pull_request ]; } ; then
docker push docker.pbiernat.dev/nginx-php:$source_branch
return 0
fi
if { [ "$branch" = develop ] && [ "$event" = push ]; } ; then
docker push docker.pbiernat.dev/nginx-php:dev
return 0
fi

View File

@ -1,8 +1,10 @@
server { server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server;
root /var/www/app/public; root /var/www/app/public;
location / { location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args; try_files $uri /index.php$is_args$args;
} }
@ -12,7 +14,7 @@ server {
include fastcgi_params; include fastcgi_params;
# optionally set the value of the environment variables used in the application # optionally set the value of the environment variables used in the application
fastcgi_param APP_ENV dev; # fastcgi_param APP_ENV prod;
# fastcgi_param APP_SECRET <app-secret-id>; # fastcgi_param APP_SECRET <app-secret-id>;
# fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name"; # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
@ -25,8 +27,7 @@ server {
# for more information). # for more information).
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root; 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 # http://domain.tld/index.php/some-path
# Remove the internal directive to allow URIs like this # Remove the internal directive to allow URIs like this
internal; internal;

View File

@ -2,7 +2,6 @@
logfile=/var/log/supervisord.log logfile=/var/log/supervisord.log
pidfile=/var/run/supervisord.pid pidfile=/var/run/supervisord.pid
nodaemon=false nodaemon=false
user=root
[program:nginx] [program:nginx]
command=/usr/sbin/nginx -g 'daemon off;' command=/usr/sbin/nginx -g 'daemon off;'
@ -22,4 +21,4 @@ priority=5
stdout_logfile=/dev/stdout stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0 stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0 stderr_logfile_maxbytes=0