Commit 2c27f830 authored by Wen Wei Li's avatar Wen Wei Li

test for scp with host volumes

parent ae07ae52
Pipeline #4738 failed with stage
...@@ -5,19 +5,15 @@ name: default ...@@ -5,19 +5,15 @@ name: default
steps: steps:
- name: show env - name: security scan
image: prlab/drone_plugin image: prlab/drone_plugin
volumes:
- name: cache
path: /tmp/drone_reports/
commands: commands:
- echo $(python3 /plugin/main.py) - echo $(python3 /plugin/main.py)
- python3 /usr/local/src/scan --src ./src -o /drone/reports - python3 /usr/local/src/scan --src ./src -o /tmp/reports
- mkdir ~/.ssh
- chmod 700 ~/.ssh
- echo $KEY > ./key
- echo "-----BEGIN RSA PRIVATE KEY-----" > ~/.ssh/id_rsa
- sed 's/ /\n/g' ./key >> ~/.ssh/id_rsa
- echo "-----END RSA PRIVATE KEY-----" >> ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- scp -r /drone/reports $USERNAME@$HOST:~/drone_reports/
settings: settings:
host: host:
- 192.168.0.22 - 192.168.0.22
...@@ -28,3 +24,26 @@ steps: ...@@ -28,3 +24,26 @@ steps:
from_secret: ssh_username from_secret: ssh_username
HOST: HOST:
from_secret: ssh_host from_secret: ssh_host
steps:
- name: scp
image: appleboy/drone-scp
volumes:
- name: cache
path: /tmp/reports
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_username
password:
from_secret: ssh_password
port : 22
target: ~/drone_reports
source: /tmp/reports
volumes:
- name: cache
host:
path: /tmp/reports
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment