Commit 5bab10a1 authored by Adrian DC's avatar Adrian DC
Browse files

feat: resolve #25: use listed values for -t tags parameters

parent b50cd30a
Loading
Loading
Loading
Loading
+1 −1
Changes for .markdownlint.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
{
    "line-length": {
        "line_length": 100
        "line_length": 110
    },
    "no-inline-html": {
        "allowed_elements": [ "br" ]
+13 −13
Changes for README.md: 13 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ with inplace project volume mounts and adaptive user selections.
## Usage

```
usage: gitlabci-runner-local [-h] [-q] [-c CONFIGURATION] [-b] [-a] [-m]
                             [-t MANUAL_TAGS] [-d | -s | -l | -p]
usage: gitlabci-runner-local [-h] [-q] [-c CONFIGURATION] [-b] [-a] [-m] [-p]
                             [-t TAGS] [-d | -s | -l]
                             [names [names ...]]

gitlabci-runner-local: Launch .gitlab-ci.yml jobs locally
@@ -26,14 +26,14 @@ gitlabci-runner-local: Launch .gitlab-ci.yml jobs locally
| names                | Names of specific jobs (or stages with --pipeline) |

| optional arguments   |                                                                                   |
| ------------------ | ----------------------------------------------------------------------- |
| -------------------- | --------------------------------------------------------------------------------- |
| -h                   | Show this help message                                                            |
| -q, --quiet          | Hide jobs execution context                                                       |
| -c CONFIGURATION     | Path to the .gitlab-ci.yml configuration                                          |
| -b, --before         | Enable before_script executions                                                   |
| -a, --after          | Enable after_script executions                                                    |
| -m, --manual         | Allow manual jobs to be used                                                      |
| -t MANUAL_TAGS     | Handle listed tags as manual jobs<br>Default list: deploy,local,publish |
| -t TAGS              | Handle listed tags as manual jobs<br>Default list: ['deploy', 'local', 'publish'] |
| -p, --pipeline       | Run complete stages rather than jobs                                              |
| -d, --dump           | Dump parsed .gitlab-ci.yml configuration                                          |
| -s, --select         | Force jobs selection from enumerated names                                        |
@@ -43,17 +43,17 @@ gitlabci-runner-local: Launch .gitlab-ci.yml jobs locally

## Dependencies

* [blessings](https://pypi.org/project/blessings/): Terminal colors and styles
* [docker](https://pypi.org/project/docker/): Docker Engine API
* [oyaml](https://pypi.org/project/oyaml/): Ordered YAML dictionnaries
* [PyInquirer](https://pypi.org/project/PyInquirer/): Interactive terminal user interfaces
* [python-dotenv](https://pypi.org/project/python-dotenv/): Support for .env files parsing
- [blessings](https://pypi.org/project/blessings/): Terminal colors and styles
- [docker](https://pypi.org/project/docker/): Docker Engine API
- [oyaml](https://pypi.org/project/oyaml/): Ordered YAML dictionnaries
- [PyInquirer](https://pypi.org/project/PyInquirer/): Interactive terminal user interfaces
- [python-dotenv](https://pypi.org/project/python-dotenv/): Support for .env files parsing

---

## References

* [.gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/): GitLab CI/CD Pipeline Configuration Reference
* [git-chglog](https://github.com/git-chglog/git-chglog): CHANGELOG generator
* [peek](https://github.com/phw/peek): Simple GIF screen recorder
* [PyPI](https://pypi.org/): The Python Package Index
- [.gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/): GitLab CI/CD Pipeline Configuration Reference
- [git-chglog](https://github.com/git-chglog/git-chglog): CHANGELOG generator
- [peek](https://github.com/phw/peek): Simple GIF screen recorder
- [PyPI](https://pypi.org/): The Python Package Index
+3 −6
Changes for gitlabci_local/main.py: 3 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -46,11 +46,11 @@ def main():
                        help='Enable after_script executions')
    parser.add_argument('-m', '--manual', dest='manual', action='store_true',
                        help='Allow manual jobs to be used')
    parser.add_argument(
        '-t', dest='manual_tags', default='deploy,local,publish',
        help='Handle listed tags as manual jobs\nDefault list: %(default)s')
    parser.add_argument('-p', '--pipeline', dest='pipeline', action='store_true',
                        help='Run complete stages rather than jobs')
    parser.add_argument(
        '-t', dest='tags', action='append', default=['deploy', 'local', 'publish'],
        help='Handle listed tags as manual jobs\nDefault list: %(default)s')

    # Arguments exclusive definitions
    group = parser.add_mutually_exclusive_group()
@@ -73,9 +73,6 @@ def main():
        print(' ', flush=True)
        sys.exit(0)

    # Prepare manual_tags
    options.manual_tags = options.manual_tags.split(',')

    # Prepare paths
    options.path = os.path.dirname(os.path.abspath(options.configuration))

+1 −1
Changes for gitlabci_local/parser.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ def stager(options, job_name, job_data, global_values):
        job['tags'] = job_data['tags'][:]

    # Configure job tags
    if (set(job['tags']) & set(options.manual_tags)):
    if (set(job['tags']) & set(options.tags)):
        job['when'] = 'manual'

    # Result