-
This will be addressed via issue OD-2652
-
Previous Value Current Value Open
Closed
-
Thank you for implementing this @robin !
I tried using values from file for matrix building but I keep getting the same error:
docker: invalid reference formatThe image is specified like so:
my-docker-image-name:@file:VERSIONS@And my "VERSIONS" file looks like this:5.6.6 7.2.0How should I format my values? Should I be using something like json/yml/toml or is comma-seperation or just one value per line?
-
OneDev matrix build can only be fired via job parameter. Below build spec demonstrates how to trigger the "test" job for each image in images.txt published by the "build" job:
version: 43 jobs: - name: build steps: - type: CommandStep name: build runInContainer: true image: ubuntu interpreter: type: DefaultInterpreter commands: | echo "ubuntu\nalpine" > images.txt useTTY: true condition: SUCCESSFUL optional: false - type: PublishArtifactStep name: publish artifacts: images.txt condition: SUCCESSFUL optional: false retryCondition: never maxRetries: 3 retryDelay: 30 timeout: 14400 postBuildActions: - type: RunJobAction condition: successful jobName: test paramMatrix: - name: image secret: false valuesProvider: type: ScriptingValues scriptName: get-images - name: test steps: - type: CommandStep name: test runInContainer: true image: '@param:image@' interpreter: type: DefaultInterpreter commands: | cat /etc/os-release useTTY: true condition: SUCCESSFUL optional: false paramSpecs: - type: TextParam name: image allowEmpty: false multiline: false retryCondition: never maxRetries: 3 retryDelay: 30 timeout: 14400 stepTemplates: - name: test paramSpecs: - type: TextParam name: image allowEmpty: false multiline: falseThis spec uses a groovy script "get-images" which should be defined in
Administration / Groovy Scriptswith below content:return new File(build.artifactsDir, "images.txt").readLines() -
Thank you! This is works great.
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
In onedev CI I'm attempting to run a commandstep for multiple versions of docker images that I built in a different project. To do this matrix step I define my docker image like so:
This won't work because as written here, you cannot use the "file" statement for a commandstep. It does work for "run docker container".
I have code that I want to run inside my container that I'd rather not include in the build process of my images. Passing the entire script as an argument or mounting my script (that is not even located in the current workspace) to the container seems like a lot of work.
The fix of running docker inside docker (as suggested in: OD-2616) would not work for me since I want to run the step as a matrix.
Is there a method I overlooked?