I am trying to use bitbucket pipeline for building and deploying the artifact onto AWS EC2 using codedeploy. However, I am at a slight disadvantage as I cannot find the output of the 1st step (Maven build) to push to S3. As far as I know, the maven build step (which is my step 1 in bitbucket-pipeline.yml) produces a WAR file. I should zip it with scripts, appspec file and push it on to S3 from where my code deploy app will pick it up. Can anyone help me on where will the bitbucket store the output WAR file after maven build?
@ajit54, for a "standard" maven project, you should be able to find your .war file under the "target" directory. Generally it should be target/<artifact>-<version>.war.
You should be able to verify this by running your build commands locally.
If you want to avoid writing additional scripts to build the .zip required by AWS CodeDeploy, you can also try using the maven-assembly-plugin to build the zip.
e.g The following entry in the <build> section of your pom.xml will enable the plugin:
// other plugins here
Under src/assembly/zip.xml, you would specify a zip.xml file which contains resources to zip up:
In the above example, I include my application war, as well as an appspec file, and a few scripts which are referenced from within the appspec.
This would suite a project with a similar structure to:
│ ├── start.sh
│ └── stop.sh
│ ├── assembly
│ │ └── zip.xml
│ └── main
│ └── java
│ └── <your app files>
This will produce a "myapp.zip" file which can be uploaded to S3 and deployed using code deploy.
Hello friends! From the community that brought you Welcome Wednesday, Throwback Thursday and Friday Fun, welcome to Taco Tuesday, a weekly discussion about all things Trello. The best part? One Tac...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events