Goland remote development setup - go

Im developing my first go project and i need to develop it on a remote linux server. Its something small and this is why i need something really simple, but 3rd day now im trying to setup my goland with no success. Starting to wonder if i need it at all here.
I already setup my SSH terminal and my SFTP. The problem is that im not sure how to write my code locally, build it locally and upload to the server or build it on the server. This is what i tried:
Tried to develop with remote file manager and remote terminal, just using goland as editor. The problem here is that if goland meets some missing package, it will give me errors, maybe here i can somehow ignore this?
Tried to write it locally, sync with remote on every save and compile it from the terminal, but this will create an issie with missing packages, but in general it works.
Tried to write it locally, compile it remotely from the Run options. The problem here is that i want to write my install.go file locally and upload it to /root/project/install as compiled file, but its creating some temporary files, tried even to overwrite my -o file from the "Go tool arguments", but it just adds the path to the existent one.
Tried to write it locally and compile it locally and then upload it to the server, but cant find the way for such thing at all.
Maybe dlv, but it looks like a simple issue, hope i wont have to install additional software on the server because of this.
Is some of those options valid or im missing another options? I hope you understood what i really want.
Thank you in advance!

but 3rd day now im trying to setup my goland with no success. Starting to wonder if i need it at all here
You don't need it.
Tried to write it locally and compile it locally and then upload it to the server, but cant find the way for such thing at all.
This is what you want. The only thing you need to install on your server is the executable from go build, built for the server's architecture, which you can copy over SFTP.
When you want to run your program locally, you will use go build to produce an executable that you can run.
When you build for the remote server, you will want to set GOOS and GOARCH to the values appropriate for your server:
GOOS=linux GOARCH=amd64 go build -o my-project.linux-amd64
If your server is ARM, substitute arm64 for amd64.
Then copy my-project.linux-amd64 to the server and it will be able to successfully run there.
Im developing my first go project
Then make sure to understand this point: go executables don't need go libraries at runtime.
This is a big selling point for Go, and is different from an interpreted language like Python, Javascript, Ruby, and also different from languages that run in a software virtual machine like JVM (Java) or BEAM (Erlang) baed VMs.
As a newcomer to go, please make sure to read the tutorial.
Save yourself a lot of hassle and Write tests right away as you develop your first project. These should be your primary way of demonstrating functionality as you work on your project.

Related

How to create an all-inclusive Go environment to meet the requirements set forth: "application must compile on shared server"

A little backstory:
I am creating my first Go web app for school. The professor said that I could use Go. I asked him if I could use the latest version, 1.13, rather than the version installed on the server, 1.10, to leverage the module management feature and the updated errors module. He did not say that I was restricted to 1.10 and even gave me the contact information of the server admin. I reached out to the server admin with my professor CC'd and he said he doesn't want to update the server's version of Go in the middle of the semester. He then included instructions on how to download, install, and use whatever version of Go that I need in my home directory.
Pick your version:
https://golang.org/dl/
Set it up for your own use:
https://golang.org/doc/install
I installed go 1.13 and updated my own envvars to reflect this version and everything works.
Well, the other requirement is that I have to hand my professor my project and that it has to compile on the server. I am thinking that if I hand him a bundle and give him directions on how to build it, then I've technically met the requirements of the project so far.
My question is, does Go have anything that takes my Go v1.13 environment and packages everything up so that the project can compile on the target server? I have only been able to find solutions along the lines of "just copy the project binary to your production server" but that doesn't help me. I need it to compile on the production server. Besides, I tried copying my binary to the production server and it couldn't find my html templates (stored in ./ui/html/ directory) but I guess that will be solved in this discussion or saved for another SO question later.
student#universityserver:~$ ./web
INFO 2019/09/22 10:21:52 Starting server on :5089
INFO 2019/09/22 10:23:03 <ipaddress>:63527 - HTTP/1.1 GET /
ERROR 2019/09/22 10:23:03 handlers.go:29: open ./ui/html/home.page.tmpl: no such file or directory
The only thing I can think of right now is to basically add everything they need (the go amd64 binary distribution and all modules) and write a script that handles it all (extract go in local folder, export envvars, build, etc.)
Dear, Professor.
Copy this tarball to your home directory, extract, run build_my_goapp.sh script.
Sincerely,
Your student
The answer in my case was that I can supply a Makefile that does anything I need it to do.
(It's actually good practice, if not an expectation, of a project that is turned in.)
The requirements were that my project needs to compile on the server and that I had to supply a Makefile. Therefore, any downloading, installing, and setting up of a Go environment for my project can be done, as long as everything happens in the user's environment and is not something that needs sudo to install correctly. The server does not have Docker.

Compile SCSS on Synology

I've got a DS718+ serving my development environment, PHP/MySQL on the bundled Nginx. Everything seems to work after lots of messing around except I'm used to a SCSS compiler that detects changes and automatically recompiles. I can't seem to find anything on Synology that does this.
I could do:
A Docker. This requires too much work to maintain and overhead to run.
phpSCSS. I'd have to change my source to serve SCSS and compile on the fly, which breaks my existing dev (and prod) environments.
Local compilation of SCSS. Then my Synology no longer represents a self-contained development environment.
Does anyone have a working solution or a recommendation?
I guess you would like a full-version linux platform like debian on synology. So that you can do whatever you want like you do before on your linux boxes.
I recommend you use debian-chroot on synology.
I have compiled a suite of debian-chroot for DSM6.x on almost synology platforms, you can install it on your DS718+ follows https://github.com/OKit-Scripts-Projects/DSM.Customizations/blob/master/App.Debian-Chroot.md
Once you have a debian-8 on your DS718+, you can do anything like before, such as a self-contained development environment.
If there is any problem, feel free to ask me here or open an issue on my github repo.
Use Synology Client,and create a local folder naming the folder as it appears on the nas on your pc where you will hold the project files. If you create a two way sync the two folder will mirror each other, and any changes will automatically update.

How to run MSBuild file after TFS done building successfully?

So, i recently set up an TFS build server, server could build and test, not problems there, however i found out that MsBuild cant publish to ftp directly. so i search on the internet, of what exactly i can do to solve my problem.
I found ms build tasks extension which have possibility to publish files to ftp. The problem i am facing right now is that i cant really figure out how to use it. I am using default build process template, with few changes. I dont understand if i have to change that template, or i have to write a brand new template? Or do i have to change in VS project file? or how do i get started? I never worked with MSBuild before. So the question is, how do i get started?
There are plenty information on the internet, but i couldnt find a plain dummy explanation of how to integrate this library and make it work together with TFS.
You would be better to love your ftp your to PowerShell.
If you use the TfvcTemplate.12.xaml you should see a post test script location. Here you can specify a PowerShell to fun after your build has finished and tests have passed. This would be much easeyer to support long term.

Connecting the PyDev debugger to a remote computer running a different OS

We develop software, which constantly needs to be debugged on both Linux and Windows. The way I would like to do this is to have an option in Eclipse (PyDev) saying "Debug this application on the remote Linux server". I then want the option to execute the code line-by-line.
Does such a feature exist in Eclipse? If it does not exist in Eclipse, what is the recommended approach to do such a thing? I have thought about installing Eclipse also on the Linux server, but then I have the extra work of configuring and maintaining several eclipse setups.
Have you read: http://pydev.org/manual_adv_remote_debugger.html ?
One thing you cannot escape from right now is having the sources for the debugger in the platform you want to run... (although you don't need eclipse itself there, at least you need the contents of org.python.pydev.debug/pysrc there, so, maybe you can create your script which will copy those from a 'central' location you keep updated, or if you have a shared folder, just add that network folder to your pythonpath).

Can Xcode run straight from source control without install

I am managing a build lab and have several products/branches to provide service to and I would like my build machines not to be specialized to any one product/branch.
The scenario I would like to have is that souce and all tools needed to build it are checked into source control and just sync and build with some prep/env setup before hand via script.
This is very doable with Visual Studio and many other tools. Is it possible with Xcode? Has anyone gotten a scenario like this to work?
Some system components may need to be shared. Since this is such an atypical scenario, documentation will not be readily available. I would suggest asking on the Xcode-users mailing list that Apple maintains, as you may get a more certain answer.
I doubt if this possible. There are 2 possible ways I know of.
First, which we also follow in our project:
Source code for all projects in checked in the common repository.
A remote server is configured to point to this repository.
Remote server has XCode pre-installed. A pre-written scripts with steps including workspace cleanup, checkout fresh code, build the code, package the output is already feed into the remote server. Of these XCode related commands are using xcodebuild.
Remote server can be configured in 3 ways: a) Build the source code on every checkin, b) Build the source code triggered by user, c) Scheduled building of the source code.
Build results are emailed to the configured email addresses.
Second way is the continuous integration with MAC OS X server.
Just in case you found out the exact system config you are looking for, please post an answer here to enlighten us as well.

Resources