docs(README): mention fail-with-body in curl
This commit is contained in:
@@ -115,18 +115,21 @@ PUT /{page}/
|
|||||||
# create archive from 'dist' dir and upload it to /my-project/
|
# create archive from 'dist' dir and upload it to /my-project/
|
||||||
tar -czC dist -f dist.tar.gz .
|
tar -czC dist -f dist.tar.gz .
|
||||||
curl -X PUT \
|
curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
--data-binary "@dist.tar.gz" \
|
--data-binary "@dist.tar.gz" \
|
||||||
https://stapler-host/my-project/
|
https://stapler-host/my-project/
|
||||||
|
|
||||||
# same thing but one-liner
|
# same thing but one-liner
|
||||||
tar -czC dist . | curl -X PUT \
|
tar -czC dist . | curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
--data-binary @- \
|
--data-binary @- \
|
||||||
https://stapler-host/my-project/
|
https://stapler-host/my-project/
|
||||||
|
|
||||||
# make stapler server identify myproject.example.com and /my-project/
|
# make stapler server identify myproject.example.com and /my-project/
|
||||||
tar -czC dist . | curl -X PUT \
|
tar -czC dist . | curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
--data-binary @- \
|
--data-binary @- \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
-H 'X-Host: myproject.example.com' \
|
-H 'X-Host: myproject.example.com' \
|
||||||
@@ -134,6 +137,7 @@ tar -czC dist . | curl -X PUT \
|
|||||||
|
|
||||||
# make stapler server identifiers myproject.example.com only
|
# make stapler server identifiers myproject.example.com only
|
||||||
tar -czC dist . | curl -X PUT \
|
tar -czC dist . | curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
--data-binary @- \
|
--data-binary @- \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
-H 'X-Host-Only: myproject.example.com' \
|
-H 'X-Host-Only: myproject.example.com' \
|
||||||
@@ -141,6 +145,7 @@ tar -czC dist . | curl -X PUT \
|
|||||||
|
|
||||||
# make a SPA site at /my-project/index.html
|
# make a SPA site at /my-project/index.html
|
||||||
tar -czC dist . | curl -X PUT \
|
tar -czC dist . | curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
--data-binary @- \
|
--data-binary @- \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
-H 'X-SPA: index.html' \
|
-H 'X-SPA: index.html' \
|
||||||
@@ -163,12 +168,14 @@ PUT /{page}/
|
|||||||
```bash
|
```bash
|
||||||
# create /my-project/ that redirects to https://github.com/my-project
|
# create /my-project/ that redirects to https://github.com/my-project
|
||||||
curl -X PUT \
|
curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
-H 'X-Redirect: https://github.com/my-project' \
|
-H 'X-Redirect: https://github.com/my-project' \
|
||||||
https://stapler-host/my-project/
|
https://stapler-host/my-project/
|
||||||
|
|
||||||
# simple redirect from root host to www
|
# simple redirect from root host to www
|
||||||
curl -X PUT \
|
curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
-H 'X-Proxy: https://www.my-website.com' \
|
-H 'X-Proxy: https://www.my-website.com' \
|
||||||
-H 'X-Host: my-website.com' \
|
-H 'X-Host: my-website.com' \
|
||||||
@@ -188,6 +195,7 @@ PUT /{page}/
|
|||||||
```bash
|
```bash
|
||||||
# create /my-website/ that proxies to http://host.containers.internal:8000
|
# create /my-website/ that proxies to http://host.containers.internal:8000
|
||||||
curl -X PUT \
|
curl -X PUT \
|
||||||
|
--fail-with-body \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
-H 'X-Proxy: http://host.containers.internal:8000' \
|
-H 'X-Proxy: http://host.containers.internal:8000' \
|
||||||
https://stapler-host/my-project/
|
https://stapler-host/my-project/
|
||||||
@@ -203,6 +211,7 @@ DELETE /{page}/
|
|||||||
```bash
|
```bash
|
||||||
# delete /my-project/
|
# delete /my-project/
|
||||||
curl -X DELETE \
|
curl -X DELETE \
|
||||||
|
--fail-with-body \
|
||||||
-H 'X-Token: <TOKEN>' \
|
-H 'X-Token: <TOKEN>' \
|
||||||
https://stapler-host/my-project/
|
https://stapler-host/my-project/
|
||||||
```
|
```
|
||||||
@@ -229,7 +238,7 @@ curl -X DELETE \
|
|||||||
run: tar -czC dist -f dist.tar.gz .
|
run: tar -czC dist -f dist.tar.gz .
|
||||||
- name: Deploy to Stapler server
|
- name: Deploy to Stapler server
|
||||||
run: |
|
run: |
|
||||||
curl -X PUT --data-binary "@dist.tar.gz" \
|
curl -X PUT --fail-with-body --data-binary "@dist.tar.gz" \
|
||||||
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
||||||
-H 'X-Host: ${{ vars.TARGET_HOST }}' \
|
-H 'X-Host: ${{ vars.TARGET_HOST }}' \
|
||||||
${{ vars.STAPLER_URL }}
|
${{ vars.STAPLER_URL }}
|
||||||
|
|||||||
Reference in New Issue
Block a user