Adding artifacts step to drone

This commit is contained in:
Hannes Papenberg 2023-05-18 18:01:39 +02:00
parent b674c4f836
commit a780693f1d
1 changed files with 23 additions and 1 deletions

View File

@ -57,6 +57,28 @@ steps:
- cd /drone/src
- npx cypress run --browser=firefox --e2e --config baseUrl=http://localhost/mysql,screenshotsFolder=/drone/src/tests/cypress/output/screenshots
- name: artifacts-system-tests
image: joomlaprojects/docker-images:packager
depends_on:
- phpmin-system-mysql
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
GITHUB_TOKEN:
from_secret: github_token
commands:
- export PLUGIN_DEST_DIR=/artifacts/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://ci.joomla.org$PLUGIN_DEST_DIR
- rclone config create artifacts ftp host ci.joomla.org user $FTP_USERNAME port 21 pass $FTP_PASSWORD
- rclone mkdir artifacts:$PLUGIN_DEST_DIR
- rclone copy tests/cypress/output/ artifacts:$PLUGIN_DEST_DIR
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://ci.joomla.org$PLUGIN_DEST_DIR\"}" > /dev/null'
when:
status:
- failure
volumes:
- name: weblinks_cache
host:
@ -100,6 +122,6 @@ services:
---
kind: signature
hmac: ad29978b3f7eacbddcd91dfbb02485e3919fb364bf62e98f95b58da948b5803e
hmac: b2d4dd23da55c06ea35eaa184db5172624d15edfa7cdcf5659cce885cd96242b
...