- Add `TestIgnoreFolder` function to test ignoring specific folders during SCP
- Initialize and terminate `ssh-agent` if `SSH_AUTH_SOCK` is set
- Lookup user `drone-scp` and handle potential errors
- Configure `Plugin` with specific settings for SCP operation
- Execute `plugin.Exec()` and assert no errors
- Verify that certain files do not exist in the target directory after SCP operation
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* feat: enhance plugin networking capabilities
- Enable SSH server to listen on all interfaces by uncommenting relevant lines in `sshd_config`
- Add new `protocol` and `proxy.protocol` flags to `main.go` with usage information and default values
- Change the `Port` field type from `string` to `int` in `plugin.go` and `plugin_test.go`
- Refactor variable name from `host` to `h` and add `port` variable in `plugin.go` loop
- Remove commented-out code and refactor `hostPort` function in `plugin.go`
- Add import for `io` package in `plugin_test.go`
- Add new test function `TestPlugin_hostPort` with multiple test cases in `plugin_test.go`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* update
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* update
Signed-off-by: appleboy <appleboy.tw@gmail.com>
---------
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Modify `rmcmd` and `mkdircmd` to remove unneeded quotes
- Update `buildUnTarArgs` in `plugin.go` to use target without quotes
- Add `Exec` function to `plugin.go` with `strings.Replace` call
- Update tests in `plugin_test.go` to use target without quotes
ref: https://github.com/appleboy/scp-action/issues/112
- Change the `go` keyword to `gofmt` in line 259
- Add a new function `hostPort` to the `Plugin` struct
- Modify the `hostPort` function to set the port if it is specified in the host string
- Add 2 tests for `hostPort` function to `plugin_test.go`
ref https://github.com/appleboy/scp-action/issues/98
- Add a test for a target folder with spaces in the name
- Fix a bug in the `buildUnTarArgs` function that caused it to fail when receiving a target with spaces
- Remove unused code in the `TestRemoveDestFile` function
ref https://github.com/appleboy/scp-action/issues/85
- Change the `rmcmd` and `mkdircmd` functions to accept an OS parameter
- Remove `command_windows.go` file
- Modify `removeDestFile` and `Exec` functions to use the OS parameter
- Add OS detection logic to `removeAllDestFile` and `Exec` functions
- Modify `TestRemoveDestFile` function to use the OS parameter
fix https://github.com/appleboy/drone-scp/pull/119