Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,550
Community Members
 
Community Events
184
Community Groups

Deploying ASP.NET Core application via FTP

Hello! I'm fairly new to Pipelines and .NET Core and I'm trying to figure out how to build and deploy my application via FTP using Pipelines.

I currently have the following setup in my Pipelines .yml file and the build portion seems to be running just fine.

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines
:
default:
- step:
caches:
- dotnetcore
script:
- export PROJECT_NAME=WebApplication
- dotnet restore
- dotnet build $PROJECT_NAME

 

I see there is an FTP pipe that can be added that looks pretty straightforward if being used with static files in my repo, but I'm unclear how to integrate this with my existing .NET Core build.

script:
- pipe: atlassian/ftp-deploy:0.3.1
variables:
USER: '<string>'
PASSWORD: '<string>'
SERVER: '<string>'
REMOTE_PATH: '<string>'
LOCAL_PATH: '<string>'

DEBUG: '<boolean>'

EXTRA_ARGS: '<string>'

DELETE_FLAG: '<boolean>'

 

My first question would be: Can this FTP pipe run inside my existing script tag just below "dotnet build"? Or do I need to define a seperate step and set everything up there? And, in either scenario, how do I define my local path to point to wherever my .NET application is building too? As of right now I'm unclear where those build files live after the build completes.

Any assitance here will be much appricated and hopefully these are not completely stupid questions. Just trying to get my brain wrapped around this so I'm not manually uploading my app everytime.

Thanks!

1 answer

1 accepted

0 votes
Answer accepted

Figured this out myself with some trial and error and digging through the logs a bit. Here is the working version of my pipelines config file in hopes this will help someone else out who is trying to use FTP with ASP.NET Core builds.

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines
:
branches:
master:
- step:
caches:
- dotnetcore
script:
- export PROJECT_NAME=WebApplication
- dotnet restore
- dotnet build $PROJECT_NAME
- pipe: atlassian/ftp-deploy:0.3.1
variables:
USER: $PROD_USERNAME
PASSWORD: $PROD_PASSWORD
SERVER: $PROD_FTP
REMOTE_PATH: $PROD_PATH
LOCAL_PATH: $BUILD_PATH

Thank you, that was helpful for me :)

Hi @Chihab Jraoui, I'm glad this helped you out. One thing I ran into in my case that is not covered in this thread is that even though I was able to upload the new build via FTP, the DLLs remained loaded in memory on the server, so pushing a new build didn't update anything. If you control the server you can easily recycle the application pools, but in my case, it was a 3rd party hosting company that I had to submit a support ticket to get that done. I ended up finding a workaround by deleting all files, uploading an "app_offline.htm" file (which I guess tells IIS to release the app from memory), then upload the new build from there. I was not able to automate this in Pipelines (as of yet anyway) but was able to manually get the project deployed for my client without contacting support every time. I am hoping to double back on this when I have time to see if it can be fully automated.

I didn't run into this case yet, I'm trying to setup the pipelines to automate the workflow for my team. I will keep your advice in mind for sure. Thanks again.

Hi @Jason Miller  I'm exactly dealing with your case did you fully automated the pipeline ?is there any command to remove existing  files from server before pushing a new build?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events