I tried to build a CI / CD pipeline using CodeStar, so I will introduce it.
It seems to be a service that quickly builds a CI / CD pipeline + execution environment using AWS managed services CodePipeline, CodeCommit, CodeBuild, and CodeDeploy.
https://aws.amazon.com/jp/codestar/
Alright, let's move it! !!
Select Code Star from the management console and click "start a project". Then, the screen for selecting the project template is displayed.
The categories are from Web application, Web service, Alexa Skill, Static Website, Languages are from Ruby, Node.js, Java, Python, PHP, HTML 5 The execution environment can be selected from Beanstalk, EC2, and Lambda.
You can also choose Web Application x Node.js x Lambda, which is like the current era.
Well, I want to use CodeBuild here, so select "Web Application x Java Spring x EC2".
Then enter the project name. Set the instance type. Click, click.
。。。 Well, this is the end of the work of building the CI / CD pipeline.
And wait 10 minutes. CodePipeline, CodeCommit, CodeBuild, CodeDeploy, and the dashboard to check this in an integrated manner have been made nice. Of course, the java web application is also running.
CodePipeline
CodeCommit
CodeBuild
CodeDeploy
From here is the production. Check the connection information to git with IAM (user ⇒ authentication information ⇒ HTTPS Git authentication information "generate" of AWS CodeCommit), and clone the source code on code commit. Then something like this will fall.
tree
.
├── README.md
├── appspec.yml
├── buildspec.yml
├── pom.xml
├── scripts
│ ├── install_dependencies
│ └── start_server
└── src
└── main
├── java
│ └── com
│ └── aws
│ └── codestar
│ └── projecttemplates
│ ├── HelloWorldAppInitializer.java
│ ├── configuration
│ │ ├── ApplicationConfig.java
│ │ └── MvcConfig.java
│ └── controller
│ └── HelloWorldController.java
├── resources
│ └── application.properties
└── webapp
├── WEB-INF
│ └── views
│ └── index.jsp
└── resources
├── gradients.css
├── set-background.js
├── styles.css
└── tweet.svg
Hmmm, I see. Here, I modified index.jsp a little to check the CI / CD pipeline quickly. Then push to code commit. You can also check the changed contents on code commit.
Then. .. ..
The pipeline has started to move Apparently, the movement seems to be doing something like this.
--Source: When a new code is pushed, the source code is acquired from code commit and stored in S3. --Build: Get the source code from S3 and build. And store the built module in S3. --Application: Deploy the module stored in S3 to EC2.
5 minutes to wait. Successful deployment. And when I check the previous screen. .. ..
It's changed! Easy! !!
--You can build a CI / CD pipeline using major languages such as Java and Ruby at explosive speed. --Free from Jenkins.
--I haven't come to the Tokyo region yet. --It's a problem on the CodeStar or code commit side, but you can't use pull request. ..
It seems that it is still difficult to use it as an application development environment / execution environment for production, but This may be enough for poc.
Recommended Posts