我有以下内容.gitlab-ci.yml file:
image: docker
services:
- docker:dind
stages:
- test
- build
- deploy
test:
stage: test
before_script:
- apk add --update -y python-pip
- pip install docker-compose
script:
- echo "Testing the app"
- docker-compose run app sh -c "python manage.py test && flake8"
build:
stage: build
only:
- develop
- production
- feature/deploy-debug-gitlab
before_script:
- apk add --update -y python-pip
- pip install docker-compose
script:
- echo "Building the app"
- docker-compose build
deploy:
stage: deploy
only:
- master
- develop
- feature/deploy
- feature/deploy-debug-gitlab
before_script:
- apk add --update -y python-pip
- pip install docker-compose
script:
- echo "Deploying the app"
- docker-compose up -d
environment: production
when: manual
当 Gitlab 运行程序执行它时,我收到以下错误:
$ apk add --update -y python-pip
bash: line 82: apk: command not found
ERROR: Job failed: exit status 1
我应该如何安装apk?或者除了什么图像docker
我应该用它来运行这个gitlab-ci.yml
file?
好吧,事实证明我有两个不同的运行程序:一个标记为“shell executor”(Ubuntu),另一个标记为“docker executor”。
仅当 Ubuntu 运行程序分派作业时才会抛出此错误,因为 Ubuntu 不附带 apk。
我禁用了 Ubuntu 运行程序并解决了问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)