Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

893 views 16 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you