segunda-feira, 21 de maio de 2018

Publishing from Mac into a hosting (SmarterASP.NET)


This example, I will show how I did to publish the .Net Core that I build in my mac to a smartasp.net hosting.

In your terminal, you should be in new-project folder. There you should run:

dotnet publish --output publish

Source: 
https://jonhilton.net/2016/08/18/publishing-your-net-core-web-app/
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish?tabs=netcore2x

Pushing .net core from your local host into your hosting using terminal.

We won't use FTP because you can't upload all the files and folder at once. We will use NCFTP but this one you should not use in a public place because it is not using ftps.

In you terminal in any folder type command below to install brew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Source: https://brew.sh/

Now let's install NCFTP, in your terminal type:

brew install ncftp

Let's connect into the server using ncftp

Access your publish folder, if you are in new-project folder go to publish folder.

cd publish

Then type this command to upload all the files and folder.


ncftp -u yourFTPusername -p yourPWUsername ftp://ftp.yourftpsite.net/site2

put -R *

It should upload all your files into the Site2 directory in my case.

If you go to your host url you should be able to see your site up.


Observations:
- We are using ncftp, this is not safe because it does not have FTPS. You can use any other ftp. I didn't research so much but if you know any other ftp that is safe and easy to setup let me know.


Nenhum comentário:

Postar um comentário