πDeploy a Go App to Clouddley Triggr
Learn how to deploy a Go app to Triggr.
This article will walk you through the process of utilizing Clouddley Triggr for deploying your Go application. Clouddley Triggr is a zero downtime application deployment tool that auto-detects your runtime and deploys your application to your server (virtual machines and bare metal). Letβs dive in!
Prerequisites
Deploy a Go Application
Optimize your codebase for deployment
Based on Triggr's design, deploying a Go application differs for both API and full-stack development. We will be showing these two use cases below.
To deploy a full-stack Go application on Triggr, you need to create a Toml file project.toml
in the root directory of your project.
The value
should specify the folder containing all the files without the .go
extension for Triggr to include them during the build process. For this application, the files can be found in a folder named static
You can check out the code for this application here.
Accessing Clouddley Triggr
Open your web browser, log in to your Clouddley account
Navigate to Triggr and click on Add App
Step 1: Configure Git
Choose the version control platform your code is hosted on, either GitHub or Bitbucket. For this tutorial, we will be using Github.
Click on the Select username/organization dropdown and click on Add username/organization to connect your GitHub user or organization account.
Select your repository and the branch.
Click on NEXT
Step 2: Configure VM
To configure your VM, insert your username, hostname or IP address, and the port for ssh access.
Download the public key to your local machine.
Run the command provided on your local machine, allowing Triggr to connect to your virtual machine.
ssh-copy-id -f -i ~/path/to/downloaded/Publickey username@ipaddress
Click on Verify. This verifies the connection
Click on NEXT
Step 3: Configure app settings
Insert the name of the application and its port.
The firewall of the virtual machine should allow access to the application port.
You can add environment variables by adding the key-value pair in the environment variable section and clicking on save or adding it by clicking on the + button.
To configure the application's Notification settings, switch the disabled button in the notification section and select which event(failed, timeout, or success) you want to be notified of.
Input your Email address.
Click on Create App
Step 4: Test and Verify the app
Upon app creation, your app appears on the Triggr dashboard.
After the app deployment is complete, the app status changes from
deploying
torunning
Click on the application's URL, which opens the deployed application in your browser.
You can test the application functionalities.
You have successfully deployed your Go application on Triggr.
You can navigate to deployments, click on the icon in the actions column to view logs, download your logs, and restart the build if needed.
Conclusion
Last updated