Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy update AWS ECS service automatically in jenkins

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces you how to automatically deploy update AWS ECS service in jenkins, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The above is the flowchart of the entire deployment update:

1. The developer type a tag to the online code, and then push the code with tag to AWS codecommit.

Git add-A *

Git commit-a-m "${tag}"

Git tag "${tag}"

Git push origin Branch ${tag}

The 2.AWS codecommit trigger detects a new code coming in from the branch or tag and sends a message to the SNS topic

1. Create an AWS SNS theme:

Before creating a SNS theme, make sure that you already have access to the SNS theme. Here are the detailed steps for creating a SNS theme:

1) Log in to the AWS SNS console

2) enter the theme name in the create theme section (custom)

3) Select * * to create a theme, and * * will create a theme and open the theme name display page.

Topic name, ARN, (optional) display name and theme owner's AWS account ID are displayed in the * * details * * section

4) the theme ARN in the previous step will be used in creating AWS SNS theme triggers in the codecommit repository.

3.CodeCommit repository creates Amazon SNS theme triggers

Log in to the AWS console (of course, you can also add it through AWS CLI)

Enter the codecommit service configuration at https://console.aws.amazon.com/codesuite/codecommit/home

Enter one of the repositories and branch and set options appear:

Select create trigger and do the following:

1) enter a name in the trigger name (Custom)

2) in events, select the repository event that will trigger the Amazon SNS topic to send notifications:

If you select all repository events, you cannot select any other events. To select a subset of events, delete the All repository events and select one or more events from the list. For example, if you want triggers to run only when the user creates branches or tags in the CodeCommit repository, delete all repository events and select create branches or tags.

3) if you want the trigger to apply to all branches of the repository, leave the selection blank in the branch, as this default option automatically applies the trigger to all branches. If you want this trigger to apply only to specific branches, select up to 10 branch names from the repository branch list

4) in selecting the service to use, select Amazon SNS

5) in Amazon SNS, select a topic name from the list or enter an ARN for the topic

6) in the custom data, provide any information contained in the notifications sent by the Amazon SNS topic (for example, the IRC channel that developers use when discussing development work in the repository). The field is a string. It cannot be used to pass any dynamic parameters

7) Select the test trigger. Verify that access between CodeCommit and Amazon SNS topics is configured correctly. It sends test notifications using the data in the repository, if available, through the Amazon SNS topic. If no real data is available, the test notification will contain sample data.

8) choose to create a trigger to complete the trigger creation operation.

3.SNS topics subscribe messages to SQS queues

Create an AWS SQS message queue:

1) enter the Amazon SQS console

2) Click to start using now

4) then click Quick create below to create it.

5) Select the queue, subscribe to the queue to the topic, and then configure the queue.

Test access can be carried out, and after success, the application saves and exits. You can submit code for testing. The project configuration is as follows

Here's how to build image and push image to ECR

The following are the settings for updating the ECS service:

On how to automatically deploy updated AWS ECS services in jenkins to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report