-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·84 lines (70 loc) · 3.17 KB
/
dev.sh
File metadata and controls
executable file
·84 lines (70 loc) · 3.17 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
GIT_ORG="https://github.com/testcontainers"
echo "----------------- Downloading Community modules -----------------"
COMMUNITY_MODULE_REPO="community-module-registry"
# PR number to checkout: If not set, it will checkout the latest commit
COMMUNITY_MODULE_PR="${COMMUNITY_MODULE_PR:-}"
rm -rf ${COMMUNITY_MODULE_REPO}
echo "Cloning ${GIT_ORG}/${COMMUNITY_MODULE_REPO}.git"
git clone "${GIT_ORG}/${COMMUNITY_MODULE_REPO}.git"
if [ -n "${COMMUNITY_MODULE_PR}" ]; then
echo "Checking out PR: ${COMMUNITY_MODULE_PR}"
cd ${COMMUNITY_MODULE_REPO}
git fetch origin pull/${COMMUNITY_MODULE_PR}/head:pr-${COMMUNITY_MODULE_PR}
git checkout pr-${COMMUNITY_MODULE_PR}
cd ..
fi
echo "---------------- Downloading Guides -----------------------------"
GUIDE_REPOS=(
'tc-guide-introducing-testcontainers'
'tc-guide-getting-started-with-testcontainers-for-java'
'tc-guide-testing-spring-boot-rest-api'
'tc-guide-testcontainers-lifecycle'
'tc-guide-configuration-of-services-running-in-container'
'tc-guide-replace-h2-with-real-database-for-testing'
'tc-guide-testing-aspnet-core'
'tc-guide-testing-spring-boot-kafka-listener'
'tc-guide-testing-rest-api-integrations-using-mockserver'
'tc-guide-getting-started-with-testcontainers-for-dotnet'
'tc-guide-testing-aws-service-integrations-using-localstack'
'tc-guide-testcontainers-in-quarkus-applications'
'tc-guide-getting-started-with-testcontainers-for-go'
'tc-guide-working-with-jooq-flyway-using-testcontainers'
'tc-guide-getting-started-with-testcontainers-for-nodejs'
'tc-guide-testing-rest-api-integrations-using-wiremock'
'tc-guide-simple-local-development-with-testcontainers-desktop'
'tc-guide-testing-rest-api-integrations-in-micronaut-apps-using-wiremock'
'tc-guide-testing-micronaut-kafka-listener'
'tc-guide-getting-started-with-testcontainers-for-python'
'tc-guide-securing-spring-boot-microservice-using-keycloak-and-testcontainers'
)
GUIDE_REPOS_CLONE_DIR="./guide-repos"
GUIDES_TARGET_DIR="./content/guides"
rm -rf ${GUIDE_REPOS_CLONE_DIR}
mkdir ${GUIDE_REPOS_CLONE_DIR}
for repo_name in "${GUIDE_REPOS[@]}"; do
echo "Cloning ${GIT_ORG}/${repo_name}.git"
git clone "${GIT_ORG}/${repo_name}.git" "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/"
rm -rf "${GUIDES_TARGET_DIR:?}/${repo_name}"
cp -r "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/guide/." "${GUIDES_TARGET_DIR}"
done
PREVIEW_GUIDE_REPOS=(
)
PREVIEW_BRANCH='preview'
for repo_name in "${PREVIEW_GUIDE_REPOS[@]}"; do
echo "Cloning ${GIT_ORG}/${repo_name}.git"
git clone -b "$PREVIEW_BRANCH" "${GIT_ORG}/${repo_name}.git" "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/"
for i in "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/guide"/*/index.adoc; do
sed -i'' -e "s/${repo_name}\/main/${repo_name}\/${PREVIEW_BRANCH}/g" "$i"
done
rm -rf "${GUIDES_TARGET_DIR:?}/${repo_name}"
cp -r "${GUIDE_REPOS_CLONE_DIR}/${repo_name}/guide/." "${GUIDES_TARGET_DIR}"
done
echo "------------------Guides Setup Completed ---------------------------"
# Convert SVG module logos to png for share image generation
echo "---------------- Converting SVGs ----------------"
echo "Installing dependencies"
npm install
echo "Running script"
node convert-svg.js
echo "Finished converting SVGs"