[Deploy beego app]


#1

I have golang project on begoo frame work. I can build it become executable file, config file and ui file. How can I upload my project on this hosting? How can I edit my config file?
When I upload all source on this hosting, its return error like:


My config is:

Is anybody can help me edit my config and upload my project on this hosting. Many thanks.!


#2

You must first install govendor in your dev environment and then run:

 govendor init

This should generate a file ./vendor/vendor.json in your current working directory.

You can then add beego package dependency using the below:

govendor fetch github.com/astaxie/beego 

You can then deploy your app to OpsCaptain.


#3

I’ve tried that but still got error. This time it is

I do not know how to edit my config:
Here is my config file when I upload code:


Thanks and help me please.!


#4

A few things, you can set the GOPACKAGENAME environment variable under the app details section. Simply scroll down to the environment variables section and then set the variable name to “GOPACKAGENAME” and the variable value to your app’s package name.

As for your configuration, you cannot hard code the httpport value since it is a dynamic value delivered at runtime. You have to retrieve it as seen below:

os.Getenv("PORT")
beego.BConfig.Listen.HTTPPort = port

Your MySQL settings is pointing to a localhost database which wouldn’t work. You must change the values to match your OpsCaptain settings. You can find the host, port, user and password values for your database from the App details section when you click on the name of the database from under the Apps section.


#5

Thanks you very much for your reply, I’ve uploaded my project on hosting success. But I don’t know how to add table in mysql? Can you tell me how can I do that please?


#6

You can use any mysql gui to do that. Unless you want to write some sort of script for it. I primarily work on ubuntu and use the “mysql” cli to do these type of things.