Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 24 - github support with a clean way to support orgs/group and users filtering #30

Merged
merged 20 commits into from
Nov 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0efcc2d
experimental github support (refs #24)
mborne Nov 24, 2018
0cdc5f8
refactor filter - prepare pagination removal to ease organization and…
mborne Nov 24, 2018
b8eecc9
add --orgs and --users options with github implementation (refs #24)
mborne Nov 24, 2018
b267843
add support for --orgs and --users for gitlab (refs #24)
mborne Nov 24, 2018
a0e2dad
travis - always update dependencies
mborne Nov 24, 2018
e9e326d
travis - always update dependencies
mborne Nov 24, 2018
9b93f7b
travis - add auth token for GITHUB
mborne Nov 24, 2018
c8f7bb3
fix README
mborne Nov 24, 2018
8845f1d
move git relative code to MBO\RemoteGit
mborne Nov 24, 2018
1da046d
GithubClient and GitlabClient : avoid some code duplication (refs #24)
mborne Nov 24, 2018
3b9f5e9
reorganize tests (refs #24)
mborne Nov 24, 2018
17112c6
organize RemoteGit to highlight interfaces (refs #24)
mborne Nov 24, 2018
ae26d69
Add getDescription() to ProjectFilterInterface to improve logs (refs …
mborne Nov 24, 2018
83a5000
travis - add php 5.6 as it is still alive and update README
mborne Nov 25, 2018
ec6415a
travis - test 5.6 with composer update
mborne Nov 25, 2018
154f68d
travis - avoid breaking support with 5.6
mborne Nov 25, 2018
57b2d2b
readme - note about PHP 5.6 and composer update
mborne Nov 25, 2018
998bda0
retreive authors to prepare RemoteGit splitting
mborne Nov 25, 2018
1b21d34
prepare extraction of RemoteGit (rename ProjectTypeFilter to Composer…
mborne Nov 25, 2018
2066a7f
move out mborne/remote-git (closes #24)
mborne Nov 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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