You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/user-guide/aws/codebuild/index.md
+152Lines changed: 152 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,161 @@ tags: ["Pro image"]
8
8
9
9
## Introduction
10
10
11
+
AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy.
12
+
It's part of the AWS Developer Tools suite and integrates with other AWS services to provide an end-to-end development pipeline.
13
+
14
+
LocalStack supports the emulation of most of the CodeBuild operations.
15
+
The supported operations are listed on the [API coverage page]({{< ref "coverage_codebuild" >}}).
16
+
17
+
AWS CodeBuild emulation is powered by the [AWS CodeBuild agent](https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html).
11
18
12
19
## Getting Started
13
20
21
+
This tutorial will show you how to use AWS CodeBuild to test and build a deployable version of a Java executable.
22
+
23
+
It assumes basic knowledge of the [`awslocal`](https://github.com/localstack/awscli-local) wrapper, Apache Maven, and Java.
24
+
25
+
### Create the source code
26
+
27
+
In the first step, we have to create the project that we want to build with AWS CodeBuild.
28
+
29
+
In an empty directory, we need to re-create the following structure:
30
+
31
+
```bash
32
+
root-directory-name
33
+
├── pom.xml
34
+
└── src
35
+
├── main
36
+
│ └── java
37
+
│ └── MessageUtil.java
38
+
└── test
39
+
└── java
40
+
└── TestMessageUtil.java
41
+
```
42
+
43
+
Let us walk through these files.
44
+
`MessageUtil.java` is the file implementing the logic of this small application.
45
+
It does nothing more than print a salutation message.
46
+
Copy the following content into the `src/main/java` directory.
47
+
48
+
```java
49
+
publicclassMessageUtil {
50
+
privateString message;
51
+
52
+
publicMessageUtil(Stringmessage) {
53
+
this.message = message;
54
+
}
55
+
56
+
publicStringprintMessage() {
57
+
System.out.println(message);
58
+
return message;
59
+
}
60
+
61
+
publicStringsalutationMessage() {
62
+
message ="Hi!"+ message;
63
+
System.out.println(message);
64
+
return message;
65
+
}
66
+
}
67
+
```
68
+
69
+
Every build needs some testing!
70
+
Therefore, create the `TestMessageUtil.java` file in the `src/test/java` directory.
0 commit comments