11name : ' Testcontainers Cloud'
2- description : ' Download and setup Testcontainers Cloud'
2+ description : ' Download and setup Testcontainers Cloud Client'
3+ inputs :
4+ version :
5+ description : ' Specific version of Testcontainers Cloud Client to use'
6+ required : false
7+ default : ' latest'
8+ token :
9+ description : ' Testcontainers Cloud API token'
10+ required : false
311runs :
412 using : ' composite'
513 steps :
614 - id : testcontainers-cloud
715 shell : bash
16+ env :
17+ TC_CLOUD_TOKEN : ${{ inputs.token || env.TC_CLOUD_TOKEN }}
818 run : |
919 # determine the architecture of the platform
1020 suffix=$([[ $(uname -m) == "aarch64" || $(uname -m) == "arm64" ]] && echo "arm64" || echo "x86-64")
@@ -14,14 +24,20 @@ runs:
1424
1525 # determine the extension of the package
1626 extension=$([[ $os == "windows" ]] && echo ".exe" || echo "")
27+
28+ TCC_BINARY_NAME=${TCC_BINARY_NAME:-"tcc-agent"}
29+
30+ VERSION=${{ inputs.version }}
31+
32+ LATEST_BINARY_URL="https://app.testcontainers.cloud/download/testcontainers-cloud-agent_${VERSION}_${os}_${suffix}${extension}"
1733
1834 # fetch the latest TCC agent version and make it executable
19- echo "Downloading https://app.testcontainers.cloud/download/testcontainers-cloud-agent_${os}_${suffix}${extension }"
20- curl -L -o agent https://app.testcontainers.cloud/download/testcontainers-cloud-agent_${os}_${suffix}${extension}
21- chmod +x agent
35+ echo "Downloading ${LATEST_BINARY_URL }"
36+ curl -fsSL -o "${TCC_BINARY_NAME}" "${LATEST_BINARY_URL}"
37+ chmod +x ${TCC_BINARY_NAME}
2238
2339 # start agent as background process
24- ./agent &
40+ ./"${TCC_BINARY_NAME}" &
2541
2642 # make sure TCC is ready before proceeding
27- ./agent wait
43+ ./"${TCC_BINARY_NAME}" wait
0 commit comments