-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic task modification #50
Comments
@neugeeug thanks for bringing up this topic. This would be a very useful feature, I was just looking for something similar right now! |
Thank you for the comment @faraquet. |
@neugeeug thanks very much for the suggestion and PR! We've seen similar requests re: interpolating stage/env specific-values into a task definition before, but so far haven't landed on a choice re: implementation. The linked approach (merging a task def 'fragment') strikes me as more extensible b/c you can apply a whole set of changes at once vs. a specific value. I understand the use cases may be somewhat different (to merge a JSON 'fragment' you need to have or add the JSON in a file, where for a single value creating a JSON string is more overhead), but I could be missing something. What do you think about a more general "merge" capability? |
@allisaurus thank you for the comment. I took a look to the linked approach and I agree, the more general solution might be good, but in my simple scenario will not solve the problem. I need to replace one value in the task definition and I know the new value only when the workflow is being executed (it is calculated during the build process). As you wrote, I would probably have to generate a JSON file first during the build process in order to be able to use it later in the proposed way. My idea was to keep it simple. I also see the constraints that @clareliguori mentioned regarding the input data types. There is not possible to define a kind of input map where you could define several different placeholders and values, but as a workaround you could use piping and call several time the same action. Each will replace another placeholder... I know it is not very elegant but seems to be simple. I would like to mention that we are able to accept any solution that solves the problem in ASAP mode because a deadline is approaching. Would be really pity to eliminate the Github Actions because of lack of this functionality. Thank you again for your help. I hope we are able to find a right solution together. |
@neugeeug Re: getting quickly unblocked, would it be possible for you to use a basic envsubst action in addition to this one in your workflow? There are a few available, but taking a look at an example I think you could do something like the following:
|
@neugeeug are you still experiencing this issue? |
@pkandasamy91 thank you for asking. I had to to switch for a while to another areas, and I have not had a time to test the solution proposed by @allisaurus. Fortunately I am going to switch back to the issue this week. I will let you know soon. |
@neugeeug No worries, please let us know if the proposed solution does not work for you. |
I've finally found a time to test the proposed solution and it seems that I am able to achieve the goal defined above in a simpler way, even without the render-task-definition action. It was not possible to use the action you proposed in a simple way because it is a Docker based action, and it is not so easy to pass the rendered task definition to the docker container (a copy action would be needed in order to transfer the file to place where Docker can see it)
Anyway it inspired me a bit and the final solution looks like below:
Thanks for help all of you @allisaurus @pkandasamy91 |
I did it already. |
Closing in favour of #20 |
In our use case, we need to modify some of our task definition parameters and use values that are known just during deployment. For example,
We need to provide to our component env variable VERSION:
Some general mechanism for replacing placeholders with wanted value would be really helpful. For example we could define
And pass there the correct value:
The action would replace the replacement_pattern (regexp) with replacement_value.
Would be possible to add this or similar functionality ?
The text was updated successfully, but these errors were encountered: