Python 如何使用Jenkins在aws cdk中安装s3?

Python 如何使用Jenkins在aws cdk中安装s3?,python,amazon-web-services,jenkins,pip,aws-cdk,Python,Amazon Web Services,Jenkins,Pip,Aws Cdk,嗨,我正在AWS cdk上工作,以创建s3 bucket。我正在使用我的企业jenkins创建管道。下面是我创建s3 bucket的python代码 app.py 下面是我的基本_stack.sh 下面是我的詹金斯管道 withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: "${env.PROJECT_ID}-aws-${env.ENVIRONMENT}"]]) {

嗨,我正在AWS cdk上工作,以创建s3 bucket。我正在使用我的企业jenkins创建管道。下面是我创建s3 bucket的python代码

app.py

下面是我的基本_stack.sh

下面是我的詹金斯管道

 withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: "${env.PROJECT_ID}-aws-${env.ENVIRONMENT}"]]) {
            docker.image("${ECR_HOST}/sharedtools/cdk:latest").inside {
              sh "./scripts/build.sh"
            }
下面是build.sh

因此,每当我使用管道时,我都会得到下面的错误

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 parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting aws-cdk.s3
  Could not find a version that satisfies the requirement aws-cdk.s3 (from versions: )
No matching distribution found for aws-cdk.s3

有人能帮我解决这个问题吗?任何帮助都将不胜感激。谢谢

aws cdk.cdk
此模块已被弃用并重命名为
@aws cdk/core
。另外,由于您使用的是
python3
,因此应该使用
pip3
。谢谢您的回答。我只是保留了这两个命令pip install aws-cdk.core pip install aws-cdk.aws-s3。现在我开始发现错误CDK CLI>=1.10.0是与此应用程序交互所必需的。请问您在cdk synth中遇到了什么问题?您需要升级您的版本。是的,我如何升级版本?
npm安装-g aws cdk:当您是Python、C#或Java开发人员时,为什么需要Node.js?AWS CDK是用TypeScript开发的,并传输到JavaScript。其他受支持语言的绑定使用Node.js上运行的AWS CDK引擎,CDK命令行工具也是如此。
 withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: "${env.PROJECT_ID}-aws-${env.ENVIRONMENT}"]]) {
            docker.image("${ECR_HOST}/sharedtools/cdk:latest").inside {
              sh "./scripts/build.sh"
            }
#!/bin/bash

# http://blog.kablamo.org/2015/11/08/bash-tricks-eux/
set -euxo pipefail
cd "$(dirname "$0")/.."

cd aws
python3 -m venv .env && \
  source .env/bin/activate && \
  pip install aws-cdk.cdk
  pip install aws-cdk.core
  cdk synth
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 parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting aws-cdk.s3
  Could not find a version that satisfies the requirement aws-cdk.s3 (from versions: )
No matching distribution found for aws-cdk.s3