Github-pages is cool,but what about gitlab?This project helps you to set up a web hook server for your gitlab,so you can deoply your gitlab-pages,it's easier and powerful then your image,try it out.
npm install -g gitlab-pages-webhook
//gitlab-pages-webhook [listen port] [gitlab host,...]
gitlab-pages-webhook 8163 http://mygitlab.com,http://mygitlab2.com
gitlab hosts tells the hook to filter which host to listene,in this case,only gitlab host http://mygitlab.com and http://mygitlab2.com will deploy to your server,http://mygitlab3.com will not.
server {
listen 80;
server_name myserver.com;
root /home;
index index.html index.htm;
error_page 405 =200 @405;
location @405{
root /home;
proxy_method GET;
proxy_pass http://static_backend;
}
access_log off;
error_log off;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
#include /etc/nginx/naxsi.rules
#autoindex on;
}
location ~* ^/.*/$ {
#alias /usr/share/doc/;
#autoindex on;
#allow 127.0.0.1;
#allow ::1;
#deny all;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
location /deploy/ {
proxy_pass http://127.0.0.1:8163;
}
}
YourPorject --> Settings --> Web Hooks --> URL values is Your web hook server RUL --> click "Add web Hook"。
YourPorject --> Settings --> Edit Project --> select Public mode: Public access。
The web hook server is http://myserver.com/deploy/[?branch=branch1&tag=v1.0.0]
eg. switch to branch1
http://myserver.com/deploy/?branch=branch1
switch branch1
and tag v1.0.1
:
http://myserver.com/deploy/?branch=branch1&tag=v1.0.1
//run bower update task
http://myserver.com/deploy/?bower=update
//run grunt default task,task name is required!
http://myserver.com/deploy/?grunt=default
//run gulp default task,task name is required!
http://myserver.com/deploy/?gulp=default
//run bower update then run gulp default task
http://myserver.com/deploy/?bower=update&gulp=default