Skip to content

Commit

Permalink
Merge pull request #30 from mborne/issue_24
Browse files Browse the repository at this point in the history
Issue 24 - github support with a clean way to support orgs/group and users filtering
  • Loading branch information
mborne authored Nov 25, 2018
2 parents 51fbee1 + 2066a7f commit 44e6355
Show file tree
Hide file tree
Showing 24 changed files with 338 additions and 968 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/nbproject/
/vendor/
/satis.json
/web
/web/
/output/

/composer.phar
Expand Down
15 changes: 9 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ language: php
sudo: false
dist: trusty

# Active PHP versions
php:
- 7.1
- 7.2
- 7.3
- nightly

matrix:
# composer update should be required only for PHP 5.6 version
include:
- php: 5.6
env: deps=update
fast_finish: true

cache:
directories:
- $HOME/.composer/cache

matrix:
include:
- php: 7.1
env: deps=update
fast_finish: true

before_script:
- if [ "$deps" == "update" ]; then composer update --prefer-dist; fi
- if [ "$deps" != "update" ]; then composer install --prefer-dist; fi
Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ It also provides a way to mirror PHP dependencies to allow offline builds.
```bash
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

```bash
Expand Down Expand Up @@ -63,19 +67,42 @@ composer config --global repo.satis.example.org composer https://satis.example.o

(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 :

```bash
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 :

```bash
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).
Expand All @@ -84,17 +111,38 @@ You may disable this option using `--no-token` option and use the following comp

`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](src/MBO/SatisGitlab/Resources/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](http://php.net/supported-versions.php))

Meanwhile [5.6, 7.1, 7.2 and 7.3 are tested throw Travis CI](https://travis-ci.org/mborne/satis-gitlab)


## Testing

```bash
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](LICENSE) file for details

6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
"psr-4": {"": "src/"}
},
"autoload-dev": {
"psr-4": {"Tests\\SatisGitlab\\": "tests"}
"psr-4": {
"MBO\\SatisGitlab\\Tests\\": "tests"
}
},
"bin": [
"bin/satis-gitlab"
],
"require": {
"guzzlehttp/guzzle": "~6.0",
"mborne/remote-git": "~0.1",
"symfony/console": "^3.4",
"composer/satis": "^1.0"
},
Expand Down
Loading

0 comments on commit 44e6355

Please sign in to comment.