Giter Club home page Giter Club logo

satis-gitlab's Introduction

mbo/satis-gitlab

Build Status

PHP composer/satis application extended with the hability to automate SATIS configuration according to GITLAB projects containing a composer.json file.

It also provides a way to mirror PHP dependencies to allow offline builds.

Usage

1) Create SATIS project

git clone https://github.com/mborne/satis-gitlab
cd satis-gitlab
# PHP 7.x
composer install
# PHP 5.6 (downgrading versions refered in composer.lock is required)
composer update

2) Generate SATIS configuration

# add --archive if you want to mirror tar archives
bin/satis-gitlab gitlab-to-config \
    --homepage https://satis.example.org \
    --output satis.json \
    https://gitlab.example.org [GitlabToken]

3) Use SATIS as usual

bin/satis-gitlab build satis.json web

4) Configure a static file server for the web directory

Use you're favorite tool to expose web directory as https://satis.example.org.

satis.json should not be exposed, it contains the GitlabToken by default (see --no-token)

5) Configure clients

Option 1 : Configure projects to use SATIS

SATIS web page suggests to add the following configuration to composer.json in all your projects :

{
  "repositories": [{
    "type": "composer",
    "url": "https://satis.example.org"
  }]
}

Option 2 : Configure composer to use SATIS

Alternatively, composer can be configured globally to use SATIS :

composer config --global repo.satis.example.org composer https://satis.example.org

(it makes a weaker link between your projects and your SATIS instance(s))

Advanced usage

Filter by organization/groups and users

If you rely on gitlab.com, you will probably need to find projects according to groups and users :

bin/satis-gitlab gitlab-to-config https://gitlab.com $SATIS_GITLAB_TOKEN -vv --users=mborne --orgs=drutopia

Build configuration according to github repositories

github supports allows to perform :

bin/satis-gitlab gitlab-to-config https://github.com  $SATIS_GITHUB_TOKEN --orgs=symfony --users=mborne
bin/satis-gitlab build --skip-errors satis.json web

(Note that GITHUB_TOKEN is required to avoid rate request limitation)

Mirror dependencies

Note that --archive option allows to download tar archives for each tag and each branch in web/dist for :

  • The gitlab projects
  • The dependencies of the gitlab projects

Expose only public repositories

Note that GitlabToken is optional so that you can generate a SATIS instance only for you're public repositories.

Disable GitlabToken saving

Note that gitlab-to-config saves the GitlabToken to satis.json configuration file (so far you expose only the web directory, it is not a problem).

You may disable this option using --no-token option and use the following composer command to configure $COMPOSER_HOME/auth.json file :

composer config -g gitlab-token.satis.example.org GitlabToken

Deep customization

Some command line options provide a basic customization options. You may also use --template my-satis-template.json to replace the default template :

default-template.json

## Supported PHP versions

PHP 7.2 version is recommanded as it is the current LTS with the longest support (see PHP - Supported Versions)

Meanwhile 5.6, 7.1, 7.2 and 7.3 are tested throw Travis CI

Testing

export SATIS_GITLAB_TOKEN=AnyGitlabToken
export SATIS_GITHUB_TOKEN=AnyGithubToken

make test

Note that an HTML coverage report is generated to output/coverage/index.html

Requirements

  • GITLAB API v4

License

satis-gitlab is licensed under the MIT License - see the LICENSE file for details

satis-gitlab's People

Contributors

mborne avatar richgerdes avatar fantoine avatar silverfire avatar ochorocho avatar kaystrobach avatar

Watchers

 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.