I have defined a pipeline with 2 steps: Maven build for war generation and copy war to aws S3.
(project details replaced with 'projectname')
====================================================
image: maven:3.3.9
pipelines:
custom:
master:
- step:
name: war creation
caches:
- maven
script: # Modify the commands below to build your repository.
- cd projectname
- mvn -B clean install # -B batch mode makes Maven less verbose
- curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@target/project.war
artifacts:
- $BITBUCKET_CLONE_DIR/projectname/target/project.war
- step:
name: pip install and deploy to s3
image: node:7.5.0
caches:
- node
- pip
script:
- echo $BITBUCKET_CLONE_DIR
- apt-get update && apt-get install -y python-dev
- curl -O https://bootstrap.pypa.io/get-pip.py
- python get-pip.py
- pip install awscli --upgrade
- aws --version
- aws --debug --region ap-south-1 s3 cp $BITBUCKET_CLONE_DIR/projectname/target/project.war s3://bucketname/project.war
====================================================
The WAR file gets created in the first step and i get log entry
-> [INFO] Building war: /opt/atlassian/pipelines/agent/build/projectname/target/project.war
I have used 'artifacts' command to ensure access to project.war in the next step.
But i always get error when accessing the war file in the next step
->RuntimeError: The user-provided path /opt/atlassian/pipelines/agent/build/projectname/target/project.war does not exist.
Is there anything i am not doing properly?