Git Product home page Git Product logo

gitlab-pages-webhook's Introduction

Readme

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.

Install

npm install -g gitlab-pages-webhook

Web hook server configuration

Start a web hook server

//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.

Set a nginx proxy to your web hook server,such as

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;
    }
}

Web Hook Guide

Add your web hook server URL to your repo

YourPorject --> Settings --> Web Hooks --> URL values is Your web hook server RUL --> click "Add web Hook"。

Make sure your repo is Publick

YourPorject --> Settings --> Edit Project --> select Public mode: Public access。

deploy a branch(default is master) and a tag

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

use bower|grunt|gulp task

//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

gitlab-pages-webhook's People

Contributors

unbug avatar

Watchers

mandarin avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.