This deployment automation tool helps users to generate basic files that are required to deploy their app on cloud run, scan their code to check for bugs before deployment and tracing any error on the app in dev mode or prod mode. The script will generate files as follows:
- Dockerfile for frontend (vue, nuxt) and backend(expressJS, gofiber)
- Sonarcloud github actions and properties file (need to seek from Admin for keys)
- Deploying to Cloud Run github actions
- Pub/Sub to Redpanda Kafka
- Download the binary package based on your OS and set to local path.
curl -vLJO https://github.com/thcollective/thc-deployment-tool/releases/download/v0.4.0/thc-deployment-tool_0.4.0_darwin_amd64.tar.gz
tar -xzvf thc-deployment-tool_0.4.0_darwin_amd64.tar.gz
chmod +x ./thc-cli-tool
mv ./thc-cli-tool /usr/local/bin
curl -vLJO https://github.com/thcollective/thc-deployment-tool/releases/download/v0.4.0/thc-deployment-tool_0.4.0_darwin_arm64.tar.gz
tar -xzvf thc-deployment-tool_0.4.0_darwin_arm64.tar.gz
chmod +x ./thc-cli-tool
mv ./thc-cli-tool /usr/local/bin
curl -vLJO https://github.com/thcollective/thc-deployment-tool/releases/download/v0.4.0/thc-deployment-tool_0.4.0_linux_amd64.tar.gz
tar -xzvf thc-deployment-tool_0.4.0_linux_amd64.tar.gz
chmod +x ./thc-cli-tool
mv ./thc-cli-tool /usr/local/bin
curl -vLJO https://github.com/thcollective/thc-deployment-tool/releases/download/v0.4.0/thc-deployment-tool_0.4.0_linux_arm64.tar.gz
tar -xzvf thc-deployment-tool_0.4.0_linux_arm64.tar.gz
chmod +x ./thc-cli-tool
mv ./thc-cli-tool /usr/local/bin
- Tap here to download for amd64
- Tap here to download for arm64
- Right click the file and extract preferably using
7zip
. - Add
thc-cli-tool.exe
to system propertiesEnvironment Variables...
-
For Darwin/Linux users, run
thc-cli-tool
using theterminal
on root directory of your project, then start answering the prompt. -
For windows user, run
./thc-cli-tool.exe
on your working project root directory, preferably run it on yourterminal
, then start answering the prompt. -
The live url will be display on github actions
tab
located underdeploy
job. -
Hit ctrl+c or ctrl+d to if you want to abort the process.
- For redpanda users, note that
appName
is a global name and developers need to keep it consistent followed by application that they using topub/sub
amessage/event
- create a topic from POST https://thc-redpanda-admin-d7mdbpojaa-as.a.run.app/api/v1/redpanda/createTopic
payload:
{
"clientId": "appName",
"topic": "topicName",
"numPartitions": 3
}
-
To check what topics is available on the brokers, GET https://thc-redpanda-admin-d7mdbpojaa-as.a.run.app/api/v1/redpanda/listTopic to see what topics are available on the broker
-
To delete a topic, DELETE https://thc-redpanda-admin-d7mdbpojaa-as.a.run.app/api/v1/redpanda/deleteTopic
payload:
{
"clientId": "appName",
"topic": "topicName"
}
-
Continue with thc-cli-tool prompt
-
Install dependencies @
npm i kafkajs uuid dotenv @kafkajs/confluent-schema-registry
-
Get Redpanda Kafka Broker IP addresses and Redpanda Schema Registry Host URL from Adri or Ming
NOTE (for maintainers):
The procedure and deployment notes are here
- Install dependencies
go mod tidy
- Run main file
go run cmd/thc-cli-tool/main.go
- Build main file
go build cmd/thc-cli-tool/main.go