Skip to content

Commit

Permalink
adding default use case
Browse files Browse the repository at this point in the history
  • Loading branch information
ermirizio committed Feb 28, 2024
1 parent 70f3952 commit 6ca2cd8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cmd/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ var controllerSubCmd = &cobra.Command{
// db is the databases to use
// pump/sink are included only when needed
defaults := policy.TestVariations{
"pump": []string{"tykio/tyk-pump-docker-pub:v1.8", "$ECR/tyk-pump:master"},
"sink": []string{"tykio/tyk-mdcb-docker:v2.4", "$ECR/tyk-sink:master"},
params["job"] + "_conf": []string{"sha256"},
params["job"] + "_db": []string{"mongo44", "postgres15"},
"pump": []string{"tykio/tyk-pump-docker-pub:v1.8", "$ECR/tyk-pump:master"},
"sink": []string{"tykio/tyk-mdcb-docker:v2.4", "$ECR/tyk-sink:master"},
}
if err := params.SetVariations(&op, defaults); err != nil {
return err
Expand Down
38 changes: 36 additions & 2 deletions policy/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,38 @@ EOF
baseRef: "refs/heads/main",
},
{
job: "ui",
want: `versions<<EOF
tyk_image=$ECR/tyk:master
tyk_analytics_image=$ECR/tyk-analytics:master
tyk_pump_image=$ECR/tyk-pump:master
tyk_sink_image=$ECR/tyk-sink:master
# override default above with just built tag
tyk_image=v1.0
# alfa and beta have to come after the override
tyk_alfa_image=$tyk_image
tyk_beta_image=$tyk_image
EOF
gd_tag=master
pump<<EOF
["tykio/tyk-pump-docker-pub:v1.8","$ECR/tyk-pump:master"]
EOF
sink<<EOF
["tykio/tyk-mdcb-docker:v2.4","$ECR/tyk-sink:master"]
EOF
ui_conf<<EOF
["sha256"]
EOF
ui_db<<EOF
["mongo44","postgres15"]
EOF
`,
trigger: "",
isPR: "no",
isTag: "no",
isLTS: "no",
baseRef: "refs/heads/main",
}, {
job: "api",
want: `versions<<EOF
tyk_image=$ECR/tyk:release-5-lts
Expand Down Expand Up @@ -148,8 +180,10 @@ EOF
op.WriteString("\n")

defaults := TestVariations{
"pump": []string{"tykio/tyk-pump-docker-pub:v1.8", "$ECR/tyk-pump:master"},
"sink": []string{"tykio/tyk-mdcb-docker:v2.4", "$ECR/tyk-sink:master"},
p["job"] + "_conf": []string{"sha256"},
p["job"] + "_db": []string{"mongo44", "postgres15"},
"pump": []string{"tykio/tyk-pump-docker-pub:v1.8", "$ECR/tyk-pump:master"},
"sink": []string{"tykio/tyk-mdcb-docker:v2.4", "$ECR/tyk-sink:master"},
}

if err := p.SetVariations(&op, defaults); err != nil {
Expand Down

0 comments on commit 6ca2cd8

Please sign in to comment.