Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
testcontainers-cloud-orb: atomicjar/testcontainers-cloud-orb@0.1.0
Use testcontainers-cloud-orb
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
An example demonstrating how to use TestcontainersCloud with a Gradle project.
1
2
3
4
5
6
7
8
9
10
11
version: '2.1'
orbs:
gradle: circleci/gradle@3.0.0
tcc: atomicjar/testcontainers-cloud-orb@x.y
workflows:
build_and_test:
jobs:
- gradle/test:
executor: jdk17
pre-steps:
- tcc/setup
An example demonstrating how to use TestcontainersCloud with a Maven project.
1
2
3
4
5
6
7
8
9
10
11
12
version: '2.1'
orbs:
maven: circleci/maven@1.4.0
tcc: atomicjar/testcontainers-cloud-orb@x.y
workflows:
build_and_test:
jobs:
- maven/test:
command: verify
executor: jdk17
pre-steps:
- tcc/setup
This command install Testcontainers Cloud agent and start it as a background process.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
agent-download-dir | Specify the download directory of Testcontainers Cloud Agent. Defaults to /tmp
| No | /tmp | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
The testcontainers-cloud-orb will run TestcontainersCloud agent as a background process.
display:
home_url: https://www.testcontainers.cloud/
source_url: https://github.com/AtomicJar/testcontainers-cloud-orb
commands:
setup:
description: |
This command install Testcontainers Cloud agent and start it as a background process.
parameters:
agent-download-dir:
default: /tmp
description: |
Specify the download directory of Testcontainers Cloud Agent. Defaults to /tmp
type: string
steps:
- run:
command: |
#!/bin/bash
# Determine the architecture of the platform
suffix=$([[ $(uname -m) == "aarch64" || $(uname -m) == "arm64" ]] && echo "arm64" || echo "x86-64")
# Fetch the latest TCC agent version and make it executable
curl -L -o /tmp/agent https://app.testcontainers.cloud/download/testcontainers-cloud-agent_linux_"$suffix"
chmod +x /tmp/agent
environment:
PARAM_AGENT_DOWNLOAD_DIR: <<parameters.agent-download-dir>>
name: Install TC Agent
- run:
background: true
command: <<parameters.agent-download-dir>>/agent
name: Start TC Agent
- run:
command: <<parameters.agent-download-dir>>/agent wait
name: Wait for TC Agent to start
examples:
gradle-example:
description: |
An example demonstrating how to use TestcontainersCloud with a Gradle project.
usage:
version: "2.1"
orbs:
gradle: circleci/gradle@3.0.0
tcc: atomicjar/testcontainers-cloud-orb@x.y
workflows:
build_and_test:
jobs:
- gradle/test:
executor: jdk17
pre-steps:
- tcc/setup
maven-example:
description: |
An example demonstrating how to use TestcontainersCloud with a Maven project.
usage:
version: "2.1"
orbs:
maven: circleci/maven@1.4.0
tcc: atomicjar/testcontainers-cloud-orb@x.y
workflows:
build_and_test:
jobs:
- maven/test:
command: verify
executor: jdk17
pre-steps:
- tcc/setup