Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ steps:
from_secret: developer_host
sftp_user:
from_secret: sftp_user
GITHUB_TOKEN:
from_secret: github_token
commands:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
Expand All @@ -30,11 +32,13 @@ steps:
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create server sftp host $developer_host user $sftp_user port 22
- "[ -z "$${DRONE_PULL_REQUEST}" ] && export TARGET=public_html || export TARGET=wildcard.manual.joomlacode.org/sites/pr-$${DRONE_PULL_REQUEST}"
- rclone --dry-run -v sync build server:$TARGET
- if [ -z "$${DRONE_PULL_REQUEST}" ]; then export TARGET=public_html; else export TARGET=wildcard.manual.joomlacode.org/sites/pr-$${DRONE_PULL_REQUEST}; fi
- rclone -v sync build server:$TARGET
- chmod +x test.sh
- if [ ! -z "$${DRONE_PULL_REQUEST}" ]; then /bin/add_github_status.sh "Preview" "Generated preview for this pull request" "http://pr-$${DRONE_PULL_REQUEST}.manual.joomlacode.org" ; fi;
when:
branch:
- main
main
status:
- success
event:
Expand All @@ -43,6 +47,6 @@ steps:

---
kind: signature
hmac: 348c8ac11879e5515a5b167c9af1a7d6bba2f3bd66408a291f4f9f6ff27d8204
hmac: 3d1303abd175ffda3aec141c6ea71d541f50f3c3e0752a68330fde5560386a58

...
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ $ npm run build

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Preview for pull request

As part of the documentation validation we create a subdomain for previewing your pull request.
The Link will be added to the "checks" section in the pull request as "preview". The url used
is http://pr-[prnumber].manual.joomlacode.org

## How to use

Expand Down
16 changes: 16 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

HEADLINE="$1"
DESCRIPTION="$2"
TARGETURL="$3"

if [ -z "$TARGETURL" ];
then
echo "Headline, description and targeturl is need."
exit 1
fi

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\": \"success\", \"context\": \"$HEADLINE\", \"description\": \"$DESCRIPTION\", \"target_url\": \"$TARGETURL\"}" > /dev/null