image: atlassian/default-image:3
pipelines:
default:
- step:
name: Grant Maven Access
script:
- apt-get update
- apt-get install -y maven
- echo "Maven installed and updated"
caches:
- maven
after-script:
- pipe: atlassian/checkstyle-report:0.3.0
- step:
name: Test
script:
- chmod +x mvnw
- ./mvnw verify --file pom.xml
- echo "Testing done"
- step:
name: Build
script:
- ls -la # Debugging: List files in the current directory
- chmod +x mvnw
- ./mvnw package -DskipTests
- ls target
- zip -j application.zip target/*.jar
- echo "Build Created"
artifacts:
- application.zip
- step:
name: Debugging
script:
- pwd # Print current working directory
- ls -la # List files in the current directory
- ls -la /opt/atlassian/pipelines/agent/build # List files in the build directory
- step:
name: Prepare for Upload
script:
- mkdir -p /opt/atlassian/pipelines/agent/build/upload_folder # Create a new folder for upload if it doesn't exist
- mv /opt/atlassian/pipelines/agent/build/application.zip /opt/atlassian/pipelines/agent/build/upload_folder/
- mv /opt/atlassian/pipelines/agent/build/appspec.yml /opt/atlassian/pipelines/agent/build/upload_folder/
- mv /opt/atlassian/pipelines/agent/build/start_server.sh /opt/atlassian/pipelines/agent/build/upload_folder/
- mv /opt/atlassian/pipelines/agent/build/stop_server.sh /opt/atlassian/pipelines/agent/build/upload_folder/
artifacts:
- upload_folder/application.zip # Make the new folder and application.zip an artifact
- upload_folder/appspec.yml
- upload_folder/start_server.sh
- upload_folder/stop_server.sh
- step:
name: Upload to S3
script:
- pipe: atlassian/aws-s3-deploy:0.4.4
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_1
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_1
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: 'abc'
LOCAL_PATH: "/opt/atlassian/pipelines/agent/build/upload_folder"
APPLICATION_NAME: "def"
- echo "Uploaded application.zip, appspec.yml, start_server.sh and stop_server.sh to S3"
- step:
name: Deploy to Development
deployment: Development
trigger: manual
script:
- ls -la # Debugging: List files in the current directory
- ls -la upload_folder # Debugging
- pipe: atlassian/aws-code-deploy:1.4.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_1
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_1
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
DEBUG: 'true'
COMMAND: "deploy"
APPLICATION_NAME: "def"
DEPLOYMENT_GROUP: "xyz"
S3_BUCKET: 'abc'
S3_KEY: "application.zip"
ZIP_FILE: "upload_folder/application.zip"
I was expecting that the pipeline would run, it ran eventually till the second last step but then on the last step while deployment to the development branch, it failed with the error
**✖ Failed to fetch revision.. An error occurred (RevisionDoesNotExistException) when calling the GetApplicationRevision operation: No application revision found for revision."
I have checked the IAM policies of the user, they are fully correct, the s3 bucket has the revision there, the correct path is provided, still it is showing the same error.