要使我的CircleCI实现正常工作,我遇到了一些麻烦。
从现在起,我一直在使用BitbucketPipelins,但是我们想转移到CircleCI。我想要将我的位桶管道文件“转换”到一个circleCI。我得到了这个错误:要签出的目录(/)不是空的,不是git存储库。
我的bitbucket管道:
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这就是我对CircleCI所做的:
version: 2.1
orbs :
node : circleci/node@5.0.0
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 发布于 2022-10-24 15:46:41
您正在将整个作业的工作目录设置为/。正因为如此,它正试图将回购文件克隆到/路径中,该路径(如错误所示)并不是空的。如果您没有特定的需要,最好不要覆盖默认的工作目录。如果确实需要覆盖整个作业的工作目录,则应该对每次都保证为空的路径(即/tmp/mydir)执行此操作。
https://stackoverflow.com/questions/71296348
复制相似问题