I have a repository which consists mainly of a PHP application. But inside that application I have three Vue.js application which needs to be built.
What I currently do is, that I have a build.sh script in my repository with the necessary yarn commands to build those apps. Everything is deployed via SSH to DigitalOcean.
I do this with a provider called DeployHQ. Now I want to switch to CircleCI’s pipelines and have difficulties about the following scenario.
I can do this:
version: 2 jobs: build: docker: - image: circleci/node:12.15.0 parallelism: 1 working_directory: ~/sw steps: - checkout - run: ./build.sh - run: mkdir -p dist - persist_to_workspace: root: dist paths: .
In that case I should get the whole repository checked out and the Vue application’s are built inside my node container. But how can I transfer the files to my server and implement atomic deployments?
I know that one option is to put a deploy.sh script inside my repo and call this via SSH inside of my workflow. But in that case, the deploy.sh script usually checks out the latest git commit, which does not include my files which are built in my container.
What I can think of is, that I built the releases/ and symlinks to current inside of my workflow with ssh commands and transfer evrything from my container above to that folder. Is this the right way of doing what I want to do?
One other thing that I have in mind is not to transfer everything from my repo to my server, but to copy the previous release into a new folder and copy the files which have changed into the folder, but even here - how do I do this with CircleCI as with the example above I get all files, right?
Appreciate if someone can bring some clarity… thanks!