Skip to content

Commit d674f8c

Browse files
committed
Initial stab at POSTing generated docs to a waiting doc-management script.
Intended to feed ZIPs of PHPDoc and PHPUnit code coverage directories to https://github.com/beporter/docs-manager.
1 parent a7e60d8 commit d674f8c

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"db-sample-data",
3131
"deploy",
3232
"docs-generate",
33+
"docs-post",
3334
"email",
3435
"folder-delete-items-older-than-days",
3536
"git-currentbranch",

docs-post

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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://localhost/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+
TMP_FILE=tmp/upload.zip
14+
PROJECT_NAME=${PROJECT_NAME}-coverage
15+
16+
zip -rq9 "$TMP_FILE" "$SRC_DIR"
17+
curl \
18+
-FauthToken=$TOKEN \
19+
-FprojectName=$PROJECT_NAME \
20+
-Ffile=@"$TMP_FILE;type=application/zip" \
21+
$DEST_URL
22+
rm $TMP_FILE

0 commit comments

Comments
 (0)