Loading gitlabci_local/parsers/gitlab.py +6 −6 Changes for gitlabci_local/parsers/gitlab.py: 6 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -582,8 +582,8 @@ class GitLab: # Result return jobs # Job, pylint: disable=too-many-branches,too-many-statements def job(self, job_node, job_name, data, global_values): # Job, pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements def job(self, job_node, job_name, data, global_values, extend=False): # Variables job = {} Loading Loading @@ -626,7 +626,7 @@ class GitLab: continue # Parse extended job job_extended = self.job(job_extend, job_extend, data, None) job_extended = self.job(job_extend, job_extend, data, None, True) # List available extended job job['options'].extends_available += [job_extend] Loading Loading @@ -668,7 +668,7 @@ class GitLab: job['options'].disabled = ', '.join(job['options'].extends_unknown) # Apply global values if global_values: if global_values and not extend: if job['image'] is None: job['image'] = global_values['image'] if job['entrypoint'] is None: Loading Loading @@ -703,7 +703,7 @@ class GitLab: # Extract job stage if 'stage' in job_data and job_data['stage']: job['stage'] = job_data['stage'] elif job['stage'] is None: elif job['stage'] is None and not extend: job['stage'] = GitLab.JOB_STAGE_DEFAULT # Extract job image Loading Loading @@ -783,7 +783,7 @@ class GitLab: job['trigger'] = job_data['trigger'] # Finalize global values if global_values: if global_values and not extend: # Configure job tags if job['tags'] and (set(job['tags']) & set(self.__options.tags)): Loading tests/extends/.gitlab-ci.stages.yml 0 → 100644 +60 −0 Changes for tests/extends/.gitlab-ci.stages.yml: 60 added lines, 0 removed lines. Original line number Diff line number Diff line stages: - extends .stage: stage: extends .image: image: registry.gitlab.com/adriandc/gitlabci-local/alpine:3.11 .before_script: before_script: - echo 'Template [BEFORE]' .script: script: - echo 'Template' .after_script: after_script: - echo 'Template [BEFORE]' .template: extends: - .stage - .image - .before_script - .script - .after_script 'Job 1': extends: - .stage - .image - .before_script - .script - .after_script 'Job 2': extends: - .after_script - .script - .before_script - .image - .stage 'Job 3': extends: template script: - echo 'Job 3' 'Job 4': extends: - .stage - .image - .before_script - .script - .after_script - template script: - echo 'Job 3' tests/extends/test.sh +1 −0 Changes for tests/extends/test.sh: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,3 +16,4 @@ gitlabci-local -c ./.gitlab-ci.incomplete.yml -H 'Job 3' && exit 1 || true gitlabci-local -c ./.gitlab-ci.partial.yml -H -p gitlabci-local -c ./.gitlab-ci.partial.yml -H 'Job 3' && exit 1 || true gitlabci-local -c ./.gitlab-ci.partial.yml -H 'Job 4' && exit 1 || true gitlabci-local -c ./.gitlab-ci.stages.yml -H -p Loading
gitlabci_local/parsers/gitlab.py +6 −6 Changes for gitlabci_local/parsers/gitlab.py: 6 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -582,8 +582,8 @@ class GitLab: # Result return jobs # Job, pylint: disable=too-many-branches,too-many-statements def job(self, job_node, job_name, data, global_values): # Job, pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements def job(self, job_node, job_name, data, global_values, extend=False): # Variables job = {} Loading Loading @@ -626,7 +626,7 @@ class GitLab: continue # Parse extended job job_extended = self.job(job_extend, job_extend, data, None) job_extended = self.job(job_extend, job_extend, data, None, True) # List available extended job job['options'].extends_available += [job_extend] Loading Loading @@ -668,7 +668,7 @@ class GitLab: job['options'].disabled = ', '.join(job['options'].extends_unknown) # Apply global values if global_values: if global_values and not extend: if job['image'] is None: job['image'] = global_values['image'] if job['entrypoint'] is None: Loading Loading @@ -703,7 +703,7 @@ class GitLab: # Extract job stage if 'stage' in job_data and job_data['stage']: job['stage'] = job_data['stage'] elif job['stage'] is None: elif job['stage'] is None and not extend: job['stage'] = GitLab.JOB_STAGE_DEFAULT # Extract job image Loading Loading @@ -783,7 +783,7 @@ class GitLab: job['trigger'] = job_data['trigger'] # Finalize global values if global_values: if global_values and not extend: # Configure job tags if job['tags'] and (set(job['tags']) & set(self.__options.tags)): Loading
tests/extends/.gitlab-ci.stages.yml 0 → 100644 +60 −0 Changes for tests/extends/.gitlab-ci.stages.yml: 60 added lines, 0 removed lines. Original line number Diff line number Diff line stages: - extends .stage: stage: extends .image: image: registry.gitlab.com/adriandc/gitlabci-local/alpine:3.11 .before_script: before_script: - echo 'Template [BEFORE]' .script: script: - echo 'Template' .after_script: after_script: - echo 'Template [BEFORE]' .template: extends: - .stage - .image - .before_script - .script - .after_script 'Job 1': extends: - .stage - .image - .before_script - .script - .after_script 'Job 2': extends: - .after_script - .script - .before_script - .image - .stage 'Job 3': extends: template script: - echo 'Job 3' 'Job 4': extends: - .stage - .image - .before_script - .script - .after_script - template script: - echo 'Job 3'
tests/extends/test.sh +1 −0 Changes for tests/extends/test.sh: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,3 +16,4 @@ gitlabci-local -c ./.gitlab-ci.incomplete.yml -H 'Job 3' && exit 1 || true gitlabci-local -c ./.gitlab-ci.partial.yml -H -p gitlabci-local -c ./.gitlab-ci.partial.yml -H 'Job 3' && exit 1 || true gitlabci-local -c ./.gitlab-ci.partial.yml -H 'Job 4' && exit 1 || true gitlabci-local -c ./.gitlab-ci.stages.yml -H -p