Reputation: 820
I have a simple php project on github. And I want to set up Continuous Integration with Bamboo.
Step 1: I've set up "Plan" with "Default Job". "Default Job" has just one task: Source Code Checkout.
Step 1.1: After run build I see the source code in /Users/serhiit/bamboo-agent-home/xml-data/build-dir/LOCPR-WEB-JOB1.
Step 2: Also I've set up "Deploy" with just one task: Clean working directory task.
Step 2.1: After run deploy I see the empty folder /Users/serhiit/bamboo-agent-home/xml-data/build-dir/786434-851970.
Question: How can I move my code to directory /var/www/myproject?
Upvotes: 2
Views: 1931
Reputation: 1721
I would suggest to create ZIP Artifact, upload it to your server and unzip it.
Step 1: Add new task to your default job - "Script", and inside body add a zip command to create zip file out of your code.
Step 2: Go to Artifacts tab, and define your artifact. Make sure to Share this artifact.
Step 3: Add new tasks to your Deploy - first Artifact download, and select your new created artifact.
Step 4: Add new task - SCP task. It will allow you to copy your zip file to your server. Specify your server credentials and remote path.
Step 5: Add new task - SSH task. Add a simple unzip command to unpack your files.
Upvotes: 5