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

Remove misleading base64 from gpg passphrase flag #134

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ var GPGFlags = []cli.Flag{
Usage: "Provides a private key encoded in base64 for GPG signing",
},
&cli.StringFlag{
Name: "gpg-passphrase-base64",
Name: "gpg-passphrase",
Usage: "Provides a private key passphrase encoded in base64 for GPG signing",
},
&cli.BoolFlag{
Expand Down
2 changes: 1 addition & 1 deletion containers/base_rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func RPMContainer(d *dagger.Client, opts *GPGOpts) *dagger.Container {
log.Printf("gpg-private-key-base64 cannot be decoded %s", err.Error())
}

gpgPassphraseSecret = d.SetSecret("gpg-passphrase-base64", opts.GPGPassphraseBase64)
gpgPassphraseSecret = d.SetSecret("gpg-passphrase", opts.GPGPassphrase)

return container.
WithExec([]string{"apt-get", "install", "-yq", "gnupg2"}).
Expand Down
4 changes: 2 additions & 2 deletions containers/opts_gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ type GPGOpts struct {
Sign bool
GPGPrivateKeyBase64 string
GPGPublicKeyBase64 string
GPGPassphraseBase64 string
GPGPassphrase string
}

func GPGOptsFromFlags(c cliutil.CLIContext) *GPGOpts {
return &GPGOpts{
Sign: c.Bool("sign"),
GPGPrivateKeyBase64: strings.ReplaceAll(c.String("gpg-private-key-base64"), "\n", ""),
GPGPublicKeyBase64: strings.ReplaceAll(c.String("gpg-public-key-base64"), "\n", ""),
GPGPassphraseBase64: c.String("gpg-passphrase-base64"),
GPGPassphrase: c.String("gpg-passphrase"),
}
}
2 changes: 1 addition & 1 deletion scripts/drone_publish_tag_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dagger run go run ./cmd rpm \
--sign=false \
--gpg-private-key-base64=${$GPG_PRIVATE_KEY} \
--gpg-public-key-base64=${$GPG_PUBLIC_KEY} \
--gpg-passphrase-base64=${$GPG_PASSPHRASE} > rpms.txt &
--gpg-passphrase=${$GPG_PASSPHRASE} > rpms.txt &

# For Windows we distribute zips and exes
dagger run go run ./cmd zip \
Expand Down
6 changes: 3 additions & 3 deletions scripts/drone_publish_tag_enterprise.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ dagger run go run ./cmd rpm \
--destination=${local_dst} \
--gcp-service-account-key-base64=${GCP_KEY_BASE64} \
--sign=true \
--gpg-private-key-base64=${GPG_PRIVATE_KEY} \
--gpg-public-key-base64=${GPG_PUBLIC_KEY} \
--gpg-passphrase-base64=${GPG_PASSPHRASE} > rpms.txt
--gpg-private-key-base64="${GPG_PRIVATE_KEY}" \
--gpg-public-key-base64="${GPG_PUBLIC_KEY}" \
--gpg-passphrase="${GPG_PASSPHRASE}" > rpms.txt

# For Windows we distribute zips and exes
dagger run go run ./cmd zip \
Expand Down
6 changes: 3 additions & 3 deletions scripts/drone_publish_tag_grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ dagger run --silent go run ./cmd rpm \
--destination=${local_dst} \
--gcp-service-account-key-base64=${GCP_KEY_BASE64} \
--sign=true \
--gpg-private-key-base64=${GPG_PRIVATE_KEY} \
--gpg-public-key-base64=${GPG_PUBLIC_KEY} \
--gpg-passphrase-base64=${GPG_PASSPHRASE} > rpms.txt
--gpg-private-key-base64="${GPG_PRIVATE_KEY}" \
--gpg-public-key-base64="${GPG_PUBLIC_KEY}" \
--gpg-passphrase="${GPG_PASSPHRASE}" > rpms.txt

# For Windows we distribute zips and exes
dagger run --silent go run ./cmd zip \
Expand Down
Loading