Skip to content
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

Added build deploy option environment #109

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions cmd/createApplyConfigPipelineJob.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,27 @@ import (
"github.com/equinor/radix-cli/pkg/client"
"github.com/equinor/radix-cli/pkg/config"
"github.com/equinor/radix-cli/pkg/flagnames"
"github.com/equinor/radix-cli/pkg/model"
"github.com/equinor/radix-cli/pkg/utils/completion"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

var deployExternalDNSAlias model.BoolPtr

var createApplyConfigPipelineJobCmd = &cobra.Command{
Use: "apply-config",
Short: "Will trigger apply-config of a Radix application",
Long: "Triggers applyConfig of a Radix application according to the radix config in its repository's master branch.",
Example: ` # Create a Radix pipeline apply-config job to apply the radixconfig properties without re-building or re-deploying components.
Currently applied changes in properties DNS alias, build secrets, create new or soft-delete existing environments.
By default it is applied changes in properties DNS alias, build secrets, create new or soft-delete existing environments.
satr marked this conversation as resolved.
Show resolved Hide resolved
rx create job apply-config --application radix-test

# Create a Radix pipeline applyConfig-only job, short option versions
rx create job apply-config -a radix-test`,
rx create job apply-config -a radix-test

# Create a Radix pipeline apply-config job with external DNS aliases
rx create job apply-config -a radix-test --deploy-external-dns-alias true`,
RunE: func(cmd *cobra.Command, args []string) error {
var errs []error
appName, err := config.GetAppNameFromConfigOrFromParameter(cmd, flagnames.Application)
Expand Down Expand Up @@ -68,7 +74,8 @@ Currently applied changes in properties DNS alias, build secrets, create new or
triggerPipelineParams := application.NewTriggerPipelineApplyConfigParams()
triggerPipelineParams.SetAppName(appName)
parametersApplyConfig := models.PipelineParametersApplyConfig{
TriggeredBy: triggeredByUser,
TriggeredBy: triggeredByUser,
DeployExternalDNS: deployExternalDNSAlias.Get(),
}
triggerPipelineParams.SetPipelineParametersApplyConfig(&parametersApplyConfig)

Expand All @@ -89,6 +96,7 @@ Currently applied changes in properties DNS alias, build secrets, create new or
func init() {
createJobCmd.AddCommand(createApplyConfigPipelineJobCmd)
createApplyConfigPipelineJobCmd.Flags().StringP(flagnames.Application, "a", "", "Name of the application to apply-config")
createApplyConfigPipelineJobCmd.Flags().Var(&deployExternalDNSAlias, flagnames.DeployExternalDNSAlias, "Optional. Deploy changes in External DNS aliases. Default is false.")
createApplyConfigPipelineJobCmd.Flags().StringP(flagnames.User, "u", "", "The user who triggered the apply-config")
createApplyConfigPipelineJobCmd.Flags().BoolP(flagnames.Follow, "f", false, "Follow applyConfig")
_ = createApplyConfigPipelineJobCmd.RegisterFlagCompletionFunc(flagnames.Application, completion.ApplicationCompletion)
Expand Down
7 changes: 5 additions & 2 deletions generated-client/models/deployment_summary.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions generated-client/models/job.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions generated-client/models/job_summary.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions generated-client/models/pipeline_parameters_apply_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions generated-client/models/pipeline_parameters_build.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 49 additions & 48 deletions pkg/flagnames/names.go
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
package flagnames

const (
AcknowledgeWarnings = "acknowledge-warnings"
AdminADGroups = "ad-groups"
Alias = "alias"
ApiEnvironment = "api-environment"
Application = "application"
AwaitReconcile = "await-reconcile"
Branch = "branch"
Certificate = "certificate"
CertificateFromFile = "certificate-from-file"
Cluster = "cluster"
CommitID = "commitID"
Component = "component"
ConfigurationItem = "configuration-item"
ConfigBranch = "config-branch"
ConfigFile = "config-file"
Context = "context"
Deployment = "deployment"
Environment = "environment"
Follow = "follow"
FromConfig = "from-config"
FromEnvironment = "from-environment"
ImageTagName = "image-tag-name"
Job = "job"
Previous = "previous"
Print = "print"
PrivateKey = "private-key"
PrivateKeyFromFile = "private-key-from-file"
ReaderADGroups = "reader-ad-groups"
Replicas = "replicas"
Reset = "reset"
Repository = "repository"
Schema = "schema"
Secret = "secret"
SharedSecret = "shared-secret"
Duration = "duration"
Since = "since"
SkipValidation = "skip-validation"
StrictValidation = "strict-validation"
ToEnvironment = "to-environment"
TokenEnvironment = "token-environment"
TokenStdin = "token-stdin"
UseActiveDeployment = "use-active-deployment"
UseBuildCache = "use-build-cache"
UseDeviceCode = "use-device-code"
User = "user"
Variable = "variable"
Verbose = "verbose"
Value = "value"
AcknowledgeWarnings = "acknowledge-warnings"
AdminADGroups = "ad-groups"
Alias = "alias"
ApiEnvironment = "api-environment"
Application = "application"
DeployExternalDNSAlias = "deploy-external-dns-alias"
AwaitReconcile = "await-reconcile"
Branch = "branch"
Certificate = "certificate"
CertificateFromFile = "certificate-from-file"
Cluster = "cluster"
CommitID = "commitID"
Component = "component"
ConfigurationItem = "configuration-item"
ConfigBranch = "config-branch"
ConfigFile = "config-file"
Context = "context"
Deployment = "deployment"
Environment = "environment"
Follow = "follow"
FromConfig = "from-config"
FromEnvironment = "from-environment"
ImageTagName = "image-tag-name"
Job = "job"
Previous = "previous"
Print = "print"
PrivateKey = "private-key"
PrivateKeyFromFile = "private-key-from-file"
ReaderADGroups = "reader-ad-groups"
Replicas = "replicas"
Reset = "reset"
Repository = "repository"
Schema = "schema"
Secret = "secret"
SharedSecret = "shared-secret"
Duration = "duration"
Since = "since"
SkipValidation = "skip-validation"
StrictValidation = "strict-validation"
ToEnvironment = "to-environment"
TokenEnvironment = "token-environment"
TokenStdin = "token-stdin"
UseActiveDeployment = "use-active-deployment"
UseBuildCache = "use-build-cache"
UseDeviceCode = "use-device-code"
User = "user"
Variable = "variable"
Verbose = "verbose"
Value = "value"
)