在 github 操作中安装清漆

installing varnish in a github action

我尝试在 github 操作中为 https://github.com/FriendsOfSymfony/FOSHttpCache/pull/500/

安装 varnish
bash -c 'curl -L https://packagecloud.io/varnishcache/varnish66/gpgkey | sudo apt-key add -'
bash -c 'curl -L "https://packagecloud.io/install/repositories/varnishcache/varnish66/config_file.list?os=ubuntu&dist=focal&source=script" | sudo tee -a /etc/apt/sources.list'
sudo apt-get update
sudo apt-get install -t focal varnish

密钥已安装,但 apt-get 更新仍然失败

...
Get:19 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [18.9 kB]
Get:20 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [7492 B]
Get:21 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [636 B]
Get:22 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [121 kB]
Err:7 https://packagecloud.io/varnishcache/varnish66/ubuntu focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 45DACFFDB8AFA6AA
Get:23 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1069 kB]
...
W: GPG error: https://packagecloud.io/varnishcache/varnish66/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 45DACFFDB8AFA6AA
E: The repository 'https://packagecloud.io/varnishcache/varnish66/ubuntu focal InRelease' is not signed.

我尝试使用 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 45DACFFDB8AFA6AA 安装 apt 缺少的密钥,它做了一些事情并产生了输出 gpg: key 0BAC19E3F6C90CD5: public key "https://packagecloud.io/varnishcache/varnish66 (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>" imported (请注意,这里的密钥不一样 - 对 apt 密钥不够熟悉告诉这是预期的还是问题)

知道如何安装它吗?

一位同事发现了我的错误:varnish 源列表文件指定了 gpg 密钥所在的密钥环的路径,但我使用 apt-key 将密钥添加到默认密钥环。

我们发现 https://packagecloud.io/varnishcache/varnish66/install 这似乎是问题的干净解决方案,一个以一致的方式安装密钥和源条目的脚本。我现在将使用安装脚本。

我在 Varnish Developer Portal 上创建了一个官方教程,解释了如何使用软件包安装 Varnish。

查看 https://www.varnish-software.com/developers/tutorials/#installations 了解分布概览。

这是 Ubuntu 的示例:https://www.varnish-software.com/developers/tutorials/installing-varnish-ubuntu/