I've been working at this for a lot longer than I want to admit, but I cannot get my deploy to staging job to succeed. I've looked over as much documentation as I could find, and tried to follow any examples, but still no dice. At this point I get a lot of permission denied errors when removing files, and I have set the runner to be in the same group with rwx permissions as the destination and source directories. Here is my gitlab-ci.yml file,
stages:
- build
- deploy
build:
stage: build
tags:
- Build PWA
script:
- echo "Building Deploy Package"
- npm install
- npm run build
- echo "Build successful"
artifacts:
expire_in: 1 hour
paths:
- build
only:
- master
deploy_staging:
stage: deploy
tags:
- Deploy Staging
script:
- echo "Deploying to server"
- rsync -av --delete /home/gitlab-runner/builds/qRT2eXnz/0/AssemblersInc/developers/fubar /home/root1/example/
- echo "Deployed"
environment:
name: staging
url: <redacted>
only:
- master
And here is what I get as the response:
[0K[0K[36;1mGetting source from Git repository[0;m
[0;m[32;1mFetching changes with git depth set to 50...[0;m
Reinitialized existing Git repository in /home/gitlab-runner/builds/qRT2eXnz/0/AssemblersInc/developers/fubar/.git/
[32;1mChecking out f941bda3 as master...[0;m
Removing .next/
Removing node_modules/
[32;1mSkipping Git submodules setup[0;m
section_end:1609962749:get_sources
[0Ksection_start:1609962749:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m
[0;m[32;1m$ echo "Deploying to server"[0;m
Deploying to server
[32;1m$ rsync -av --delete /home/gitlab-runner/builds/qRT2eXnz/0/AssemblersInc/developers/fubar /home/root1/example/[0;m
sending incremental file list
rsync: chgrp "/home/root1/example/fubar" failed: Operation not permitted (1)
rsync: delete_file: unlink(fubar/node_modules/zenscroll/zenscroll.js) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/zenscroll/zenscroll-min.js) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/zenscroll/package.json) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/zenscroll/README.md) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/zenscroll/LICENSE) failed: Permission denied (13)
cannot delete non-empty directory: fubar/node_modules/zenscroll
rsync: delete_file: rmdir(fubar/node_modules/zenscroll) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/path-exists/readme.md) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/path-exists/package.json) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/path-exists/license) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/path-exists/index.js) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/path-exists/index.d.ts) failed: Permission denied (13)
cannot delete non-empty directory: fubar/node_modules/yargs/node_modules/path-exists
rsync: delete_file: rmdir(fubar/node_modules/yargs/node_modules/path-exists) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/p-try/readme.md) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/p-try/package.json) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/p-try/license) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/p-try/index.js) failed: Permission denied (13)
rsync: delete_file: unlink(fubar/node_modules/yargs/node_modules/p-try/index.d.ts) failed: Permission denied (13)
cannot delete non-empty directory: fubar/node_modules/yargs/node_modules/p-try
Any help you can give would be greatly appreciated.
question from:
https://stackoverflow.com/questions/65602784/i-cannot-get-my-ci-cd-deploy-job-to-complete-successfully 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…