有一个解决方案是CircleCI的自动部署无法工作,即使什么都没有做
发生了什么事?
尽管未触动.circleci/config.yml文件,但部署机制却出现以下错误并停止运行。
#!/bin/bash -eo pipefail
sudo apt-get -y -qq update
sudo apt-get install python-pip python-dev build-essential
sudo pip install awscli awsebcli==3.14.6
W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Exited with code exit status 100
CircleCI received exit code 100
因为这个原因(结论)
由于支持德比安全文件(security.debian.org)的已结束,导致无法在circleci/php:7.3-apache-stretch镜像中运行。
解决方案
通过使用 image:circleci/php:7.3-apache-bullseye,它可以恢复正常工作。
關於這個話題,我想談談其他的事情。
由于我在旧环境中进行部署,所以与bullseye的版本不兼容,也出现了以下与主题无关的错误。
#!/bin/bash -eo pipefail
sudo apt-get -y -qq update
sudo apt-get install python-pip python-dev build-essential
sudo pip install awscli awsebcli==3.14.6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
Exited with code exit status 100
CircleCI received exit code 100
因此,还需要修改sudo apt-get install python-pip python-dev build-essential为sudo apt-get install python3-pip python-dev-is-python2 build-essential。
源代码
# ==略==
defaults: &defaults
environment:
NPM_CONFIG_LOGLEVEL: "info"
ARCH: "x64"
AWS_ACCOUNT_ID: "xxxxxxxxxxxx"
ECR_ENDPOINT: xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com
working_directory: ~/directory_name
docker:
- image: circleci/php:7.3-apache-stretch # ←ここがエラーを出した
# ==略==
references:
commands:
install_awscli_awsebcli: &install_awscli_awsebcli
name: Installing deployment dependencies
working_directory: /
command: |
sudo apt-get -y -qq update
sudo apt-get install python-pip python-dev build-essential # ←ここがエラーを出した
sudo pip install awscli awsebcli==3.14.6
# ==略==
# ==略==
defaults: &defaults
environment:
NPM_CONFIG_LOGLEVEL: "info"
ARCH: "x64"
AWS_ACCOUNT_ID: "xxxxxxxxxxxx"
ECR_ENDPOINT: xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com
working_directory: ~/directory_name
docker:
- image: circleci/php:7.3-apache-bullseye # ←直した
# ==略==
references:
commands:
install_awscli_awsebcli: &install_awscli_awsebcli
name: Installing deployment dependencies
working_directory: /
command: |
sudo apt-get -y -qq update
sudo apt-get install python3-pip python-dev-is-python2 build-essential # ←直した
sudo pip install awscli awsebcli==3.14.6
# ==略==
借鉴了我参考的那篇文章.
解決につながった記事(そもそもこのセキュリティファイルに依存する環境を使わないやり方)
解決につながったやり方の類似記事
ローカルならこれでも良さそうだと思った記事(セキュリティファイルの指定先を無理やり変更するやり方)