Reputation: 7581
In Jenkins I can build, tag and push docker images to the AWS ECR. This is possible after docker-login in via the Jenkins AWS plugin step 'withAWS()'.
To redeploy the latest image I can normally perform this shell command:
aws ecs update-service --cluster spring-boot-cluster-6 --service spring-boot-service-6 --force-new-deployment
How can I execute this action via the Jenkins Pipeline Step Plugin for AWS?
This plugin is also known as 'jenkinsci/pipeline-aws-plugin'.
Upvotes: 1
Views: 1063
Reputation: 1431
Have you tried with this docs
In my case I have put the bash script within the source code, so the Jenkins pipeline simply executes it to create the new task definition and update the service.
Added from comments
Here you have some examples. github.com/jenkinsci/aws-credentials-plugin/issues/22 using withCredentials and the Jenkins secrets manager. Another option is to put them on a file in the host machine. In my case the route is /var/lib/jenkins/.aws/credentials . Another option is to use environment vars docs.aws.amazon.com/cli/latest/userguide/…. This is the worst option as the secrets becomes visible in the pipeline code. – Carlos 2 hours ago delete
Upvotes: 1