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
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
12
It is part of the [AWS Developer Tools suite](https://aws.amazon.com/products/developer-tools/) and integrates with other AWS services to provide an end-to-end development pipeline.
13
13
14
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" >}}).
15
+
The supported operations are listed on the [API coverage page]().
16
16
17
17
AWS CodeBuild emulation is powered by the [AWS CodeBuild agent](https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html).
18
18
@@ -28,17 +28,17 @@ In the first step, we have to create the project that we want to build with AWS
28
28
29
29
In an empty directory, we need to re-create the following structure:
30
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
-
```
31
+
<FileTree>
32
+
-root-directory-name
33
+
- pom.xml
34
+
- src
35
+
- main
36
+
- java
37
+
- MessageUtil.java
38
+
- test
39
+
- java
40
+
- TestMessageUtil.java
41
+
</FileTree>
42
42
43
43
Let us walk through these files.
44
44
`MessageUtil.java` contains the entire logic of this small application.
@@ -175,30 +175,23 @@ Now we have to create two S3 buckets:
175
175
176
176
Create the buckets with the following commands:
177
177
178
-
{{< command >}}
179
-
$ awslocal s3 mb s3://codebuild-demo-input
180
-
<disable-copy>
181
-
make_bucket: codebuild-demo-input
182
-
</disable-copy>
183
-
{{< /command >}}
184
-
185
-
{{< command >}}
186
-
$ awslocal s3 mb s3://codebuild-demo-output
187
-
<disable-copy>
188
-
make_bucket: codebuild-demo-output
189
-
{{< /command >}}
178
+
```bash
179
+
awslocal s3 mb s3://codebuild-demo-input
180
+
awslocal s3 mb s3://codebuild-demo-output
181
+
```
190
182
191
183
Finally, zip the content of the source code directory and upload it to the created source bucket.
192
184
With a UNIX system, you can simply use the `zip` utility:
193
-
{{< command >}}
194
-
$ zip -r MessageUtil.zip <source-directory>
195
-
{{< /command >}}
185
+
186
+
```bash
187
+
zip -r MessageUtil.zip <source-directory>
188
+
```
196
189
197
190
Then, upload `MessageUtil.zip` to the `codebuild-demo-input` bucket with the following command:
You have now created a CodeBuild project called `codebuild-demo-project` that uses the S3 buckets you just created as source and artifact.
333
330
334
-
{{< callout >}}
331
+
:::note
335
332
LocalStack does not allow to customize the build environment.
336
333
Depending on the host architecture, the build will be executed an Amazon Linux container, version `3.0.x` and `5.0.x`, respectively for the ARM and the x86 architecture.
337
-
{{< /callout >}}
334
+
:::
338
335
339
336
### Run the build
340
337
341
338
In this final step, you can now execute your build with the following command:
Make note of the `id` information given in output, since it can be used to query the status of the build.
348
345
If you inspect the running containers (e.g., with the `docker ps -a` command), you will notice a container with the `localstack-codebuild` prefix (followed by the build ID), which CodeBuild started to execute the build.
349
346
This container will be responsible to start a Docker compose stack that executes the actual build.
350
347
351
348
As said, you can inspect the status of the build with the following command:
0 commit comments