How to create a drop down pipeline variable in codefresh (CI/CD) - cicd

I want to use multiple values for a single pipeline variable in codefresh.
For example let say the variable name is ENVIRONMENT and it's values can be env1, env2, env3 ...
For such variable creating a dropdown list would immensely helpful
I went through codefresh official doc - https://codefresh.io/docs/docs/codefresh-yaml/variables/ but no luck
Is there any reference for how to create a dropdown type pipeline variable ?
Thanks

Related

Adding dynamic variable in the grafana query

I am working over creating grafana queries by using the dynamic variable whose values get populated from the dropdown when the user selects the env.
My query is
metric_avg_total{env="$env",job="job1", topic=~"$env_read_val_topic"}
The topic value that I want to use is corr to the env.
eg: dev_read_val_topic
qas_read_val_topic
If I write the query as
metric_avg_total{env="$env",job="job1", topic=~"dev_read_val_topic"}
I am able to see the graph.
But using $env_read_val_topic doesnt replacce the values of the $env with the values selected as env from the dropdown.
Try to use the following query:
metric_avg_total{env="$env",job="job1", topic="${env}_read_val_topic"}

Tray.IO - Creating a NEW list

Working with Tray.IO for the first time and I run into an issue after using the object helper to format the data in the object model I need, to add to a NEW list that contains only the new object information. As you can see below I have tried manipulating the object in several ways.
Any help would be very appreciated.
Tray.IO Items
Based on the information you've provided, below is how I would approach this situation. I've also included a video link if you'd like to see it done step-by-step.
Using the Data Storage connector, you should create a new list by using ‘Append to List’ method, setting the Key to an appropriate name, with the Value coming from object-helpers-2. In addition, you’ll want to Create if missing.
Once the new list is created, you’ll need to retrieve the data using another Data Storage connector by using the ‘Get Value’ method, setting the Key to the name of your prior Data Storage step.
Finally, update the Key of your List Helpers step to the result of the Data Storage connector used to retrieve the data.
Link to Video
Happy Traygramming!
Grant

Google Cloud Data Fusion - Dynamic arguments based on functions

Good morning all,
I'm looking in Google Data Fusion for a way to make dynamic the name of a source file stored on GCS. The files to be processed are named according to their value date, example: 2020-12-10_data.csv
My need would be to set the filename dynamically so that the pipeline uses the correct file every day (something like this: ${ new Date(). Getfullyear()... }_data.csv
I managed to use the arguments in runtime by specifying the date as a string (2020-12-10) but not with a function.
And more generally is there any documentation on how to enter dynamic parameters with ready-made or custom "functions" (I couldn't find it)
Thanks in advance for your help.
There is a readymade workaround, you can give a try "BigQuery Execute" plugin.
Steps:
Put below query in SQL
select cast(current_date as string) ||'_data.csv' as filename
--for output '2020-12-15_data.csv'
Row As Arguments to 'true'
Now use the above arguments via ${filename} wherever you want to.

Using mapping variables in a post-session command

Workflow generates three files (header, detail, trailer) which I combine via post-session command. There are two variables which are set in my mapping, which I want to use in the post-session command like so:
cat header1.out detail1.out trailer1.out > OUTPUT_$(date +%Y%m%d)_$$VAR1_$$VAR2.dat
But this doesn't work and the values are empty, so I get OUTPUT_20151117__.dat.
I've tried creating workflow variables and assigning them via pre-session variable assignment, but this doesn't work either.
What am I missing? Or was this never going to work?
Can you see the values assigned to those variables on the session log or do they appear empty as well?
Creating workflow variables is what I'd try, but you need to assign the values with the post-session variable assignment.
Basically, you store values in a variable in your mapping and pass the values up to the workflow after the session succeeded. Here is how you can achieve that:
Define a Workflow variables $$VAR1 and $$VAR2
Define the variables in your mapping, but chose different names! So i.e. $$M_VAR1 and $$M_VAR2
In your mapping, assign the values to your mapping variables through the functions SetVariable(var as char, value as data type)
In your session, select Post-session on success variable assignment.
In step 4, the current value from $$M_VAR1 (mapping variable) is stored in your workflow variable $$VAR1 and can then be used in the workflow in command tasks like you asked.
A few notes:
I'm not 100% sure if the variable assignment is exectured before the post-session command. If the command is executed first, you could execute your command tasks in an external command task after your session.
Pre-Session variable assignment is used if you pass a value from a workflow variable down to a mapping variable. You can use this if your variables $$VAR1 or $$VAR2 are used inside another mapping and need to be initialized at the beginning.

Returning parameters from FinalBuilder 7 Action Lists

If I'm not mistaken, it seems that FinalBuilder 7's action list parameters only support input values. Is there any way I can simulate a workaround for return parameters? I do not want to store return parameters in a global temp variable or even a stack, because I'm calling the same action list multiple times asynchronously.
Here is sample of what I want to do. (Notice the shared use of the same action list)
Async Action Group
+-Action Group
| +-Run Action List - [Do Some Calculation]
| +-Replace variable A with return parameter from previous action list
+-Action Group
+-Run Action List - [Do Some Calculation]
+-Replace variable B with return parameter from previous action list
I'm currently using an INI file in the action list to save return values. The calling method passes a parameter to the action list specifying to which INI key to save to. The calling method then reads the value from the INI from the key.
Surely there has to be a more elegant way to do this?
I have never seen any way to return variables from action lists.
That would be an excellent suggestion to post in the FinalBuilder Wish List forum.
Many of requests in the past there are now features of the product.
I think it would require giving scope to variables to something like an Action Group to pull it off. But it would help some of my scripts as well. Update: I found that FB 7 supports Local Variables. But it still does not address the needs of this answer.