'Translate Bitbucket Pipeline to circleCI
I'm in some troubles to get my CircleCI implementation working.
Since now, I've been using BitbucketPipelins but we would like to move to CircleCI. I would like to "translate" my bitbucketpipeline file to a circleCI. I'm getting this error : Directory (/) you are trying to checkout to is not empty and not a git repository.
My bitbucket pipeline :
image:
name: kuara/node-caprover:2.0
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
email: $DOCKER_HUB_EMAIL
definitions:
caches:
node : node-modules
pipelines:
branches:
main:
- step:
name: Build React App
caches:
- node
script:
- npm install
- CI=false npm run build
- tar -cvf deploy.tar --exclude='*.map' --exclude="node-modules/*" captain-definition build/*
artifacts:
- deploy.tar
- step:
name: Deploy to Caprover
deployment: Production
script:
- caprover deploy --caproverUrl $CAPROVER_URL --caproverPassword $CAPROVER_PASSWORD --caproverApp $CAPROVER_APP -t deploy.tar
And this is what I've done with CircleCI :
version: 2.1
orbs :
node : circleci/[email protected]
executors :
my-executor :
docker :
- image : kuara/node-caprover:2.0
auth :
username : kuara
password : $DOCKERHUB_PASSWORD
jobs :
build_react_app :
working_directory: /
executor : my-executor
steps :
- checkout
- restore_cache:
keys :
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run :
name : Installing dependencies
command : npm install --production
- save_cache:
paths:
- node_modules
- ~/.npm
- ~/.cache
key: v1-dependencies-{{ checksum "package.json" }}
- run :
name : Building
command : CI=false npm run build
- run :
name : Creating .tar file
command : tar -cvf deploy.tar --exclude='*.map' --exclude="node-modules/*" captain-definition build/*
- persist_to_workspace:
root: /
paths:
- deploy.tar
deploy_to_kuara :
working_directory: /
executor : my-executor
steps :
- checkout
- attach_workspace:
at: /
- run: |
if [ -f "/deploy.tar" ]; then
echo "It worked!";
else
echo "Nope!"; exit 1
fi
workflows:
build_deploy :
jobs :
- build_react_app:
context: Kuara Caprover
- deploy_to_kuara:
context: Kuara Caprover
requires:
- build_react_app
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
