我使用 bitbucket 管道将代码自动部署到弹性beantalk ,但是我总是遇到相同的错误”调用该错误时(InvalidParameterValue) CreateApplicationVersion操作:找不到名为“ My_APP”的应用程序。” 。 我确定我创建的“ My_app”应用程序具有相同的名称,并且具有default_region“ eu-west-1”。 因此,流水线的第一步和第二步都是成功的,但是第三步是失败的。
我的位桶管道:
image: atlassian/default-image:2
options:
docker: true
pipelines:
default:
- step:
name: build and publish docker image.
services:
- docker # enable Docker for your repository
script: # Modify the commands below to build your repository.
# set DOCKER_HUB_USERNAME and DOCKER_HUB_PASSWORD as environment variables
# Docker variables
- export IMAGE_NAME="${DOCKER_HUB_USERNAME}/${BITBUCKET_REPO_SLUG}:${BITBUCKET_BUILD_NUMBER}"
# build and test the Node app
- npm install
- npm test
# build the Docker image (this will use the Dockerfile in the root of the repo)
- docker build -t "$IMAGE_NAME" .
# authenticate with the Docker Hub registry
- docker login --username "$DOCKER_HUB_USERNAME" --password "$DOCKER_HUB_PASSWORD"
# push the new Docker image to the Docker registry
- docker push "$IMAGE_NAME"
- step:
name: "Build and Test"
script:
- zip application.zip Dockerfile application.py cron.yaml Dockerrun.aws.json
artifacts:
- application.zip
- step:
name: "Deploy to Production"
deployment: production
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $APPLICATION_NAME
ZIP_FILE: "application.zip"
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: "deploy-$BITBUCKET_BUILD_NUMBER-OlifeOlistApp"
ENVIRONMENT_NAME: $APPLICATION_ENVIRONMENT
我的Docker文件:
FROM node:10-alpine
# Create app directory
WORKDIR /app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY ./package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "npm","run" "start" ]