Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sync files when deploy on the FTP server

Deleted user August 19, 2019

Hi, I've have two project on the my free bitbucket account.

Once the codes are compiled, I want to send them to another server. (.net core project)

But I have a 2 project. I wanna publish another location per folder.

This is possible?

 

My bitbucket-pipelines.yml is: 

script:
- pipe: atlassian/ftp-deploy:0.2.1
variables:
USER: 'ftp-user-name'
PASSWORD: 'ftp-password'
SERVER: 'XX.XX.XX.XXXX'
REMOTE_PATH: '/www/1st-project'
LOCAL_PATH: '1st-project' 

script:
- pipe: atlassian/ftp-deploy:0.2.1
variables:
USER: 'ftp-user-name'
PASSWORD: 'ftp-password'
SERVER: 'XX.XX.XX.XXXX'
REMOTE_PATH: '/www/2nd-project'
LOCAL_PATH: '2nd-project' 

 

How  can I do?

2 answers

0 votes
Deleted user August 20, 2019

Hi Alexander, thank you for your response.

That answer is good enough for me. But there are issues I'm curious about. For example, this is a .net core project. I can publish this with visual studio. Visual Studio gives me compiled files.
I am then transferring those files to my ftp folder.

 

Can I use the same scenario? Where will my compiled publish files be? What file path do I use for the FTP deploy?

Thanks.

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2019

@[deleted] I don't have much experience with .net, however, it seems to me that this scenario is also fine. Your files should reside on your server under the folder that your specify via the REMOTE_PATH variable.

Deleted user August 20, 2019

Hello, 

I partially solved the problem. Had very little.

I am getting error when publishing to my ftp server.

 

Status: Downloaded newer image for bitbucketpipelines/ftp-deploy:0.2.1INFO: Starting FTP deployment to XX.XX.XX.XX:/ftproot...mirror: Access failed: /dist: No such file or directory.

How can I do.

Yes, "dist" folder no such file, but where does deploy it?

 

pipelines:
default:
- step:
name: Build and deploy to test
image: microsoft/dotnet:sdk
script:
- export PROJECT_NAME=Client
- dotnet restore
- dotnet build $PROJECT_NAME
- dotnet publish $PROJECT_NAME --configuration Release --output /dist --verbosity normal
artifacts:
- dist/**
- step:
name: Deploy
script:
- pipe: atlassian/ftp-deploy:0.2.1
variables:
USER: 'user'
PASSWORD: 'xxxx'
SERVER: 'ip'
REMOTE_PATH: '/ftproot'
LOCAL_PATH: '/dist/'

 

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2019

First, you should remove leading slash in LOCAL_PATH to be just dist/. Second, your files will be uploaded to the /ftproot directory as specified in the REMOTE_PATH. 

Like Deleted user likes this
Deleted user August 21, 2019

I am getting error while publishing.

 

mirror: Access failed: /opt/atlassian/pipelines/agent/build/dist: No such file or directory

Like # people like this
0 votes
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 19, 2019

Hi @[deleted] . Yes, this is totally possible and your pipe configuration are valid. Make sure the remote directories exist on your remote server. I would also recommend to use separate pipelines steps to upload your code to different location. Let me know if you have any further questions.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events