I have a bitbucket repository with a lot of files, and as it is right now, everytime I make som changes, pipelines puts all files in a .zip and deploys that .zip to my server. I use webpack to save my project in a .zip with only 2 files, which is saved in a /build folder in my bitbucket repository.
This is how I want it to be: - Every time I make some changes in my code and commits it, Pipelines should run the 'npm run build' command which triggers webpack modules to update the /build/.zip file and then pipelines should deploy only that .zip file to my ftp.
Anyone who knows the answer for this? Thanks in advance!
This is how my pipelines.yml file looks:
image: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install zip curl
- zip -r $BITBUCKET_REPO_SLUG.zip . -x *.git* *.yml
- curl -T $BITBUCKET_REPO_SLUG.zip ftp://<my_server_name> --user $FTP_USERNAME:$FTP_PASSWORD
Can you use any other protocol besides plain FTP? Is SCP an option for your host, or even SFTP?
No, unfortunately I have to use plain FTP.
The only thing I need the .yaml file to do, is to go to a folder in my repo, and then upload only that .zip file inside the folder.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you got any solution?
I have the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@edwardo040 Unfortunately I didn't manage to get pipelines to run the 'npm run build' command, but I ended up with a solution, where webpack deploys a .zip file with the files in the build folder, and then when a commit is pushed to the repository, pipelines deploy only the webpack packed .zip file to my ftp server. Code below:
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install zip curl
- mkdir $BITBUCKET_REPO_SLUG
- cp -R build/*.js $BITBUCKET_REPO_SLUG/
- cp -R build/*.qext $BITBUCKET_REPO_SLUG/
- zip -r $BITBUCKET_REPO_SLUG.zip $BITBUCKET_REPO_SLUG/
- curl -T $BITBUCKET_REPO_SLUG.zip ftp://<server_name>/ --user $FTP_USERNAME:$FTP_PASSWORD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.