Skip to content

A demo project about how to deploy Go applications relying on Workspaces on Clever Cloud

Notifications You must be signed in to change notification settings

CleverCloud/go-workspaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy a Go Workspace based app on Clever Cloud

In its version 1.18, Go introduced Workspaces to use multiple modules in the same project easier. This repository contains an application (in the cmd/ folder) relying on two Go Modules declared in the go.work file. To try by yourself, you'll need a Clever Cloud account and our CLI, Clever Tools (you can also use our Console).

The easier way to install it is through npm (but there are lots of other ways):

npm i -g clever-tools
clever login
clever profile

Then git clone this repository and follow our deploy instructions:

git clone https://github.com/CleverCloud/go-workspaces.git
cd go-workspaces

How to deploy on Clever Cloud - Makefile

This repository contains a Makefile. So you just have to create a Go application on your account, declare where is the built binary through CC_GO_BINARY environment variable and git push!

clever create -t go
clever env set CC_GO_BINARY bin/myApp
git add . && git commit -m "First commit"
clever deploy && clever domain

After that, your application should be built and deployed. Just type its URL in your browser!

How to deploy on Clever Cloud - Env vars

If you prefer to rely on environment variables, delete Makefile. The create process is this time followed by env vars declaration:

clever create -t go
clever env set CC_GO_BUILD_TOOL "gomod"
clever env set CC_GO_PKG "cmd/main.go"
git add . && git commit -m "First commit"
clever deploy && clever domain

About

A demo project about how to deploy Go applications relying on Workspaces on Clever Cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published