drone-scp icon indicating copy to clipboard operation
drone-scp copied to clipboard

When the configuration parameter rm is true, an error will be generated

Open shuyudao opened this issue 2 years ago • 2 comments

settings.rm: true #If true : Process exited with status 1 ; If false : ✅ Successfully...

settings:
    host: ***
    port: 22
    username: root
    password: 
      from_secret: root_password
    strip_components: 1
    overwrite: true
    rm: true #If true : Process exited with status 1
    source: ./dist/*
    target: /target

console logs

tar all files into /tmp/297369615/ZOqVuExJPx.tar
scp file to server.
Remove target folder: ***
drone-scp error:  Process exited with status 1
drone-scp rollback: remove all target tmp file
remove file ZOqVuExJPx.tar
2022/10/30 20:19:41 Process exited with status 1

shuyudao avatar Oct 30 '22 20:10 shuyudao

I will take it.

appleboy avatar Apr 09 '23 01:04 appleboy

As a note to future readers, as I just had the same issue:

The rm: true option deletes the entire target directory and not only its contents (see also #128). Because of this, the user (defined by username) also needs write access to the parent directory of target.

In my use-case I could solve the issue by adding another subdirectory (target: /target/build), so I did not have to adjust permissions of the parent directory.

sfeilmeier avatar Oct 30 '23 13:10 sfeilmeier