-
Notifications
You must be signed in to change notification settings - Fork 34
Fix CF CLI GPG key installation for modern apt #1934
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -130,9 +130,9 @@ jobs: | |||||||
| - run: | ||||||||
| name: Install-cf-cli | ||||||||
| command: | | ||||||||
| sudo mkdir -p /etc/apt/trusted.gpg.d | ||||||||
| sudo wget -q -O /etc/apt/trusted.gpg.d/cloudfoundry-cli.gpg https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | ||||||||
| echo "deb [signed-by=/etc/apt/trusted.gpg.d/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||||||||
| # Download and convert the GPG key to binary format for modern apt | ||||||||
| wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cloudfoundry-cli.gpg | ||||||||
| echo "deb [signed-by=/usr/share/keyrings/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||||||||
| sudo apt-get update | ||||||||
| sudo apt-get install -y cf8-cli | ||||||||
| cf -v | ||||||||
|
|
@@ -183,9 +183,9 @@ jobs: | |||||||
| - run: | ||||||||
| name: Install-cf-cli | ||||||||
| command: | | ||||||||
| # Install Cloud Foundry CLI repository key using modern signed-by mechanism | ||||||||
| sudo wget -q -O /etc/apt/trusted.gpg.d/cloudfoundry-cli.gpg https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | ||||||||
| echo "deb [signed-by=/etc/apt/trusted.gpg.d/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||||||||
| # Download and convert the GPG key to binary format for modern apt | ||||||||
|
||||||||
| # Download and convert the GPG key to binary format for modern apt | |
| # Download and convert the GPG key to binary format for modern apt | |
| sudo mkdir -p /usr/share/keyrings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The directory
/usr/share/keyrings/may not exist in all environments. The previous code created/etc/apt/trusted.gpg.dwithmkdir -pbefore writing the key file. Consider adding a directory creation step before the gpg command to ensure reliability across different base images. For example:sudo mkdir -p /usr/share/keyringsbefore the wget/gpg command.