amazon web services - Deploy .war to AWS -
i want deploy war jenkins cloud.
could please let me know how deploy war file jenkins on local aws bean stalk ?
i tried using jenkins post-process plugin copy artifact s3, following error:
error: failed upload files java.io.ioexception: put destination [bucketname=https:, objectname=/s3-eu-west-1.amazonaws.com/bucketname/test.war]: com.amazonaws.amazonclientexception: unable execute http request: connect s3.amazonaws.com/s3.amazonaws.com/ timed out @ hudson.plugins.s3.s3profile.upload(s3profile.java:85) @ hudson.plugins.s3.s3bucketpublisher.perform(s3bucketpublisher.java:143)
some work has been done on this.
basically, adding post-build task run standard command line deployment scripts.
from referenced page, assuming have post-build task plugin on jenkins , aws command line tools installed:
step 1
in jenkins job configuration screen, add “post-build action” , choose plugin “publish artifacts s3 bucket”, specify source (in our case, use maven source target/.war , destination s3 bucket name)
step 2
then, add “post-build task” (if don’t have it, plugin in maven repo) same section above (“post-build actions”) , drag below “publish artifacts s3 bucket”. important want make sure war file uploaded s3 before proceeding scripts.
in post-build task portion, make sure check box “run script if previous steps successful”
in script text area, put in path of script automate deployment (described in step 3 below). us, put this:
<path_to_script_file>/deploy.sh "$version_number" "$version_description" the $version_number , $version_description jenkins’ build parameters , must specified when deployment triggered. both variables used aeb deployment
step 3
the script
#!/bin/sh export aws_credential_file=<path_to_your aws.key file> export path=$path:<path bin file inside "api" folder inside aeb command line tool (a)> export path=$path:<path root folder of s3cmd (b)> //get current time , append name of .war file that's being deployed. //this create unique identifier each .war file , allow rollback easily. current_time=$(date +"%y%m%d%h%m%s") original_file="app.war" new_file="app_$current_time.war" //rename deployed war file new name. s3cmd mv "s3://<your s3 bucket>/$original_file" "s3://<your s3 bucket>/$new_file" //create application version in aeb , link renamed war file elastic-beanstalk-create-application-version -a "hoiio app" -l "$1" -d "$2" -s "<your s3 bucket>/$new_file"
Comments
Post a Comment