Skip to content

Commit

Permalink
Merge pull request #443 from akanix42/process-execute-pipeline-variables
Browse files Browse the repository at this point in the history
Send fabricated pipeline values when processing config or executing jobs.
  • Loading branch information
aengelberg authored Jul 29, 2020
2 parents 56863d0 + 2498e30 commit 8db507d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ We are very grateful to the following people have helped us to build the CLI too
- [Daniel Ruthardt](https://github.com/DanielRuthardt)
- [Josef Šimánek](https://github.com/simi)
- [Brady Sullivan](https://github.com/d1str0)
- [Ashley Reid](https://github.com/akanix42)
2 changes: 1 addition & 1 deletion cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func validateConfig(opts configOptions) error {
}

func processConfig(opts configOptions) error {
response, err := api.ConfigQuery(opts.cl, opts.args[0], nil)
response, err := api.ConfigQuery(opts.cl, opts.args[0], pipeline.FabricatedValues())

if err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/features/circleci_config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ Feature: Config checking
steps: [checkout]
"""
When I run `circleci config process --skip-update-check config.yml`
Then the output should contain exactly:
Then the output should match:
"""
version: 2
jobs:
build:
machine: true
steps:
- checkout
environment:
- CIRCLE_COMPARE_URL: .*
workflows:
version: 2
workflow:
Expand Down
3 changes: 2 additions & 1 deletion local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/CircleCI-Public/circleci-cli/api"
"github.com/CircleCI-Public/circleci-cli/client"
"github.com/CircleCI-Public/circleci-cli/pipeline"
"github.com/CircleCI-Public/circleci-cli/settings"
"github.com/pkg/errors"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -42,7 +43,7 @@ func Execute(flags *pflag.FlagSet, cfg *settings.Config) error {

processedArgs, configPath := buildAgentArguments(flags)
cl := client.NewClient(cfg.Host, cfg.Endpoint, cfg.Token, cfg.Debug)
configResponse, err := api.ConfigQuery(cl, configPath, nil)
configResponse, err := api.ConfigQuery(cl, configPath, pipeline.FabricatedValues())

if err != nil {
return err
Expand Down

0 comments on commit 8db507d

Please sign in to comment.