Closed e-picas closed 6 months ago
@firecow I'm working for a french tourism company (https://github.com/ClubMediterranee) and this feature and my two other fixes (#1138 and #1140 ) are quite urgent for us as we would love to use your tool in our internal CI development validation (we have a CE Gitlab factory and are on the way to increase our developments robustness). I'm totally open for discussion, help, question etc.
And many thanks for your great work ! The gitlab-ci-local tool is just amazing ;)
other fixes (https://github.com/firecow/gitlab-ci-local/pull/1138 and https://github.com/firecow/gitlab-ci-local/pull/1140 ) are quite urgent for us as we would love to use your tool in our internal CI development validation
@e-picas by the way, It might take some time to wait for the review and creation of a new release.
Instead, it'll probably be much quicker for you to create the executable from your forked branch
Using the following:
npm run build
npm run pkg-all
$ tree bin
├── linux
│ └── gitlab-ci-local
├── linux.gz
├── macos
│ └── gitlab-ci-local
├── macos.gz
├── win
│ └── gitlab-ci-local.exe
└── win.gz
Copy the respective executable to your $PATH
Hello @ANGkeith , thank you for the advice, that's exactly what I did ;)
@e-picas Let's just fix how --preview
is working instead of adding a new option
I find it perfectly reasonable that --preview
output should be able to pass https://gitlab.com/ci/lint, and I'm sure the other collaborators do too.
@e-picas I'll be publishing a new version tomorrow :+1:
Closes #1141
Explanation
This introduces a new option named
--merge
(not sure about that, let me know if you have a better idea) which do basically the same job as the--preview
one but without variables expansion. The result should be (quite) the same as the "Full configuration" tool of GitLab's internal CI editor: https://docs.gitlab.com/ee/ci/pipeline_editor/#view-full-configuration.Dev implementation
I just added a new option called
merge
which follows the same logic as thepreview
one, adding aexpandVariables
bollean flag to switch between one or the other.I also added correponding test-case to validate it on an
environment
block in a CI using a variable as 'name' that can not be guessed outside a git tag.NOTE - I'm having a failure running the tests but I don't think it was due to my dev. Please see the final notes below.
Illustration
With the same YML as in the #1141 ticket:
We now have a not-expanded result using the
--merge
options:Which is valid passing it to the
ci/lint
GitLab API validator:NOTES
Running the test suite to validate my dev I faced a single failure but I don't think it was due to it (please let me know):
Test Suites: 1 failed, 109 passed, 110 total Tests: 1 failed, 260 passed, 261 total Snapshots: 0 total Time: 55.212 s, estimated 60 s