Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/enomotodev/gitlabci-composer-update-mr

Create MergeRequest of composer update in GitLabCI
https://github.com/enomotodev/gitlabci-composer-update-mr

composer gitlab gitlab-ci php

Last synced: 2 months ago
JSON representation

Create MergeRequest of composer update in GitLabCI

Awesome Lists containing this project

README

        

# gitlabci-composer-update-mr

[![Latest Stable Version](https://poser.pugx.org/enomotodev/gitlabci-composer-update-mr/v/stable.png)](https://packagist.org/packages/enomotodev/gitlabci-composer-update-mr)
[![Build Status](https://api.travis-ci.org/enomotodev/gitlabci-composer-update-mr.svg?branch=master)](https://travis-ci.org/enomotodev/gitlabci-composer-update-mr)

## Installation

```
$ composer require enomotodev/gitlabci-composer-update-mr
```

## Prerequisites

The application on which you want to run continuous composer update must be configured to be built on GitLabCI.

## Usage

### Setting GitLab personal access token to GitLabCI

GitLab personal access token is required for sending merge requests to your repository.

1. Go to [your account's settings page](https://gitlab.com/profile/personal_access_tokens) and generate a personal access token with "api" scope
1. On GitLab dashboard, go to your application's "Settings" -> "CI /CD" -> "Environment variables"
1. Add an environment variable `GITLAB_API_PRIVATE_TOKEN` with your GitLab personal access token

### Configure .gitlab-ci.yml

Configure your `.gitlab-ci.yml` to run `gitlabci-composer-update-mr`, for example:

```yaml
job:
except:
- schedules
script:
# snip

job:on-schedule:
image: composer:latest
only:
- schedules
script:
- "composer global require enomotodev/gitlabci-composer-update-mr"
- "$COMPOSER_HOME/vendor/bin/gitlabci-composer-update-mr master"
```

NOTE: Please make sure you replace `` and `` with yours.

### Setting Schedule

1. On GitLab dashboard, go to your application's "Schedules" -> "New schedule"
1. Create new schedule and save

## CLI command references

General usage:

```
$ gitlabci-composer-update-mr
```

## License

gitlabci-composer-update-mr is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)