Skip to content

Commit 42d52c2

Browse files
authored
SDCICD-1592 command to provision clusters for PD reserve jenkins job (#2996)
1 parent 44ffeec commit 42d52c2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

scripts/provision-cluster-reserve.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set +e
4+
5+
UNIQUE_ID=$(date +%s%N) # Generate a unique identifier for this instance
6+
CONTAINER_NAME="osde2e-${UNIQUE_ID}" # Name of the container based on the unique identifier
7+
8+
# Check if the container already exists
9+
if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
10+
echo "Container ${CONTAINER_NAME} already exists. Exiting."
11+
exit 1
12+
fi
13+
14+
# Create the container with environment variables and unique name
15+
docker create --name "${CONTAINER_NAME}" -e OCM_TOKEN \
16+
-e OCM_CLIENT_ID -e OCM_CLIENT_SECRET \
17+
-e AWS_ACCESS_KEY_ID \
18+
-e AWS_SECRET_ACCESS_KEY \
19+
-e AWS_ACCOUNT_ID \
20+
-e AWS_REGION \
21+
-e ROSA_STS="${STS}" \
22+
-e CHANNEL \
23+
-e REPORT_DIR='/tmp/osde2e-report' \
24+
quay.io/redhat-services-prod/osde2e-cicada-tenant/osde2e:latest provision --reserve --configs "${CONFIGS}"
25+
26+
# Start the container
27+
docker start -a "${CONTAINER_NAME}"
28+
29+
# Copy the junit results xml for publishing
30+
docker cp "${CONTAINER_NAME}":/tmp/osde2e-report .
31+
32+
# Optionally, clean up by removing the container after use
33+
docker rm "${CONTAINER_NAME}"

0 commit comments

Comments
 (0)