相关疑难解决方法(0)

Pip安装不与jenkins一起工作?

那是我的詹金斯文件.

pipeline {
    agent none
    stages {
        stage('Build') {
            agent {
                docker {
                    image 'python:3-alpine'
                }
            }
            steps {
                sh 'pip install --user -r requirements.txt'
                sh 'python WebChecker.py'
            }
            post {
                always {
                    junit 'output.xml'
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

当我在詹金斯运行时,我得到了跟随

[urltester] Running shell script

+ pip install --user -r requirements.txt

The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. …
Run Code Online (Sandbox Code Playgroud)

python pip jenkins docker

13
推荐指数
2
解决办法
4043
查看次数

如何使用 jenkins pipline 步骤在 docker 镜像中安装 pip ?

我有这个Dockerfile

FROM python:3.7

CMD ["/bin/bash"]
Run Code Online (Sandbox Code Playgroud)

和这个Jenkinsfile

pipeline {
agent {
    dockerfile {
        filename 'Dockerfile'
    }
}
stages {
    stage('Install') {
        steps {
            sh 'pip install --upgrade pip'
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这会导致以下错误:

The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/.cache/pip' or its …
Run Code Online (Sandbox Code Playgroud)

jenkins docker jenkins-pipeline

8
推荐指数
1
解决办法
3887
查看次数

使用sudo时jenkins中的身份验证错误

我在jenkins中有sh脚本,它有sudo ssh命令,我收到了这个错误

Warning: Identity file key.pem not accessible: Permission denied.
Host key verification failed.
sudo: no tty present and no askpass program specified
Run Code Online (Sandbox Code Playgroud)

我找到了添加的解决方案

jenkins ALL=(ALL) ALL
Run Code Online (Sandbox Code Playgroud)

/ etc/sudoers中的这些行仍然无法正常工作.

deployment ssh ubuntu sudo jenkins

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

jenkins ×3

docker ×2

deployment ×1

jenkins-pipeline ×1

pip ×1

python ×1

ssh ×1

sudo ×1

ubuntu ×1