我在BitBucket中设置了CodeDeploy管道,以便可以自动将其部署到我的AWS EC2实例。
这是我的bitbucket-pipelines.yml文件的样子:
image: php:7.2.5
pipelines:
default:
- step:
script:
- apt-get update && apt-get install -y unzip
- apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
- apt-get install -y zip
- docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
- docker-php-ext-install -j$(nproc) gd
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer require monolog/monolog
- composer install
- zip -r cqeor-app.zip .
- pipe: atlassian/aws-code-deploy:0.5.3
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME
S3_BUCKET: $S3_BUCKET
COMMAND: 'upload'
ZIP_FILE: 'cqeor-app.zip'
VERSION_LABEL: 'cqeor-app-1.0.0'
- pipe: atlassian/aws-code-deploy:0.5.3
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP
S3_BUCKET: $S3_BUCKET
COMMAND: 'deploy'
WAIT: 'true'
VERSION_LABEL: 'cqeor-app-1.0.0'
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
我不断收到以下错误,并且构建失败: