Support parameterized logic with IP ranges.
complete
Activity Feed
Sort by
![Nathan Fish](https://canny.io/images/9fa7547eda7aa4058a45ab6335dacfc4.png)
Nathan Fish
complete
This has now been released.
![Thomas Linderdahl](https://canny.io/images/0f94e90317a4dfe42e0e0221c788088b.png)
Thomas Linderdahl
Nathan Fish Thanks a lot! Is it documented anywhere?
![Nathan Fish](https://canny.io/images/9fa7547eda7aa4058a45ab6335dacfc4.png)
Nathan Fish
Thomas Linderdahl looks like docs missed getting updated. I'll take care of that now but here's an example from the changelog entry.
jobs:
job_a:
executor: base
circleci_ip_ranges: << pipeline.parameters.ip_ranges >>
steps:
- run: echo "Running job a"
F
Fernando Abreu
Thomas Linderdahl: were you able to use this new change?
![Nicholas Shaw](https://canny.io/images/d9fdfc7ab8e16e0085b33a0d492be767.jpg)
Nicholas Shaw
If this feature were implemented, it would save us 160 lines of duplicated code. For example, say we need two of six workflows to use IP ranges, we now need to maintain two copies of a job, one the original and one for restricted IPs.
A parameter would avoid this duplication and is how I expected the IP ranges feature to work before diving into it.
F
Fernando Abreu
Nicholas Shaw: were you able to use the conditional parameter support?
![Nicholas Shaw](https://canny.io/images/d9fdfc7ab8e16e0085b33a0d492be767.jpg)
Nicholas Shaw
Fernando Abreu yes thank you, now we don't need to duplicate a bunch of config
![Nathan Fish](https://canny.io/images/9fa7547eda7aa4058a45ab6335dacfc4.png)
Nathan Fish
Question Thomas Linderdahl on this? What type of rules do you want to base this on? Can you provide some examples of parameters you would like to see supported? Would existing pipeline values work (https://circleci.com/docs/pipeline-variables/#pipeline-values)?
![Thomas Linderdahl](https://canny.io/images/0f94e90317a4dfe42e0e0221c788088b.png)
Thomas Linderdahl
Nathan Fish I'm not extremely well versed in circleci so I'll try to explain the usecase and hopefully that answers your question.
We use a homebrew orb in our pipelines. In some of our pipelines we need circleci_ip_ranges enabled for a specific job and in other pipelines we don't. We'd like to set this as an input parameter in the pipeline config like below. Hope that helps.
version: 2.1
orbs:
myord: orb@1.0
workflows:
version: 2
my_workflow:
- myorb/jobname:
enableips: true
![Nathan Fish](https://canny.io/images/9fa7547eda7aa4058a45ab6335dacfc4.png)
Nathan Fish
Thomas Linderdahl my thought is possible enabling this to support expression based evaluation (like our expression based contexts) so you can evaluate based on pipeline parameters as well. So it would add a bit more dynamic nature to the feature.
![Thomas Linderdahl](https://canny.io/images/0f94e90317a4dfe42e0e0221c788088b.png)
Thomas Linderdahl
Nathan Fish Sorry for slow response! That would allow setting this per pipeline/repo, correct? Sounds good enough to me.