File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ The following dependencies are assumed to be available on the target system and
2121
2222* ` bash `
2323* ` composer `
24+ * ` curl `
2425* ` git `
2526* ` mail `
2627* ` mysql `
Original file line number Diff line number Diff line change 3030 " db-sample-data" ,
3131 " deploy" ,
3232 " docs-generate" ,
33+ " docs-post" ,
3334 " email" ,
3435 " folder-delete-items-older-than-days" ,
3536 " git-currentbranch" ,
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # POST a zip of generated docs or coverage reports to loadsysdev.
3+
4+ # @TODO: Enforce first and second args.
5+ PROJECT_NAME=${1:- eu-mk2}
6+ TOKEN=${2:- foobar}
7+ DEST_URL=http://docs.loadsysdev.com/docs-manager.php
8+
9+ # @TODO: Add shortcut args for "docs" and "coverage" that set paths appropriately.
10+ # @TODO: Run the appropriate command to generate docs if output path is not already populated.
11+
12+ SRC_DIR=tmp/coverage/html
13+ PROJECT_NAME=${PROJECT_NAME} -coverage
14+
15+ # This ensures no intermediate directories are stored in the ZIP file.
16+ cd " $SRC_DIR " > /dev/null 2>&1
17+
18+ # Send the POST request, using ZIP data fed from stdin
19+ zip -rq8 - * | curl \
20+ -F " authToken=$TOKEN " \
21+ -F " projectName=$PROJECT_NAME " \
22+ -F " file=@-;filename=upload.zip;type=application/zip" \
23+ $DEST_URL
24+
25+ # Clean up json output from curl with an extra newline.
26+ echo ' '
You can’t perform that action at this time.
0 commit comments