Commit 6bd7fb40 authored by Adrian DC's avatar Adrian DC
Browse files

feat: implement #42: disable configurations with --defaults

parent 801ef3de
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitlab-ci.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ stages:
    - VARIABLE_8=value8 gitlabci-local -c ./tests/configurations/.gitlab-ci.yml -p </dev/null && exit 1 || true
    - VARIABLE_8= VARIABLE_11=value11 gitlabci-local -c ./tests/configurations/.gitlab-ci.yml -p </dev/null
    - gitlabci-local -c ./tests/configurations/.gitlab-ci.yml -e VARIABLE_8=value8 -e VARIABLE_11=value11 -p </dev/null
    - gitlabci-local -c ./tests/configurations/.gitlab-ci.yml -e VARIABLE_8=value8 -e VARIABLE_11=value11 --defaults -p
    - gitlabci-local -c ./tests/environment/.gitlab-ci.yml -p
    - gitlabci-local -c ./tests/environment/.gitlab-ci.yml -e USER -e VALUE_1=set1 -e VALUE_2=set2 -e VALUE_3=set3 -p
    - gitlabci-local -c ./tests/environment/.gitlab-ci.yml -e FOLDER=${PWD} -v ./ 'Job 2'
+2 −1
Changes for README.md: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ is the common and unique interface between GitLab CI and gitlabci-local.
```shell
usage: gitlabci-runner-local [-h] [-q] [-c CONFIGURATION] [-b] [-a] [-m] [-p]
                             [-e ENV] [-t TAGS] [-v VOLUME] [-w WORKDIR]
                             [-d | -s | -l | --pull]
                             [--defaults] [-d | -s | -l | --pull]
                             [names [names ...]]

gitlabci-runner-local: Launch .gitlab-ci.yml jobs locally
@@ -51,6 +51,7 @@ gitlabci-runner-local: Launch .gitlab-ci.yml jobs locally
| -p, --pipeline       | Run complete stages rather than jobs                                              |
| -v VOLUME            | Mount VOLUME or HOST:TARGET in Docker containers                                  |
| -w WORKDIR           | Override the container's working path                                             |
| --defaults           | Use default variables for .local:configurations                                   |
| -d, --dump           | Dump parsed .gitlab-ci.yml configuration                                          |
| -s, --select         | Force jobs selection from enumerated names                                        |
| -l, --list           | Select one job to run (implies --manual)                                          |
+2 −0
Changes for gitlabci_local/main.py: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ def main():
                        help='Mount VOLUME or HOST:TARGET in Docker containers')
    parser.add_argument('-w', dest='workdir',
                        help='Override the container\'s working path')
    parser.add_argument('--defaults', dest='defaults', action='store_true',
                        help='Use default variables for .local:configurations')

    # Arguments exclusive definitions
    group = parser.add_mutually_exclusive_group()
+1 −1
Changes for gitlabci_local/menu.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ def configurator(options, configurations):
            variable_set = True

        # Request configuration selection
        if not sys.stdin.isatty() or variable_set:
        if not sys.stdin.isatty() or variable_set or options.defaults:
            result[variable] = str(variable_default)
            print(' %s%s  %s%s%s' %
                  (colored.fg('yellow') + colored.attr('bold'), configuration_prompt[0]['message'],