Skip to content

Commit

Permalink
setting up travis to deploy securely to docs website
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-mcginty committed Apr 22, 2020
1 parent ac468f1 commit 7567737
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 28 deletions.
52 changes: 29 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
os:
- linux
- linux
dist:
- xenial
- xenial
language: node_js
node_js:
- "10"
- '10'
before_install:
- sudo add-apt-repository ppa:longsleep/golang-backports -y
- sudo apt-get update
- sudo apt-get install -y golang-go
- sudo apt-get install -y libev-dev
- go env | grep GOPATH > gopath.env
- source gopath.env
- export PATH=$PATH:$GOPATH/bin
- go get -u github.com/tsenart/vegeta
- npm install -g esy
- openssl aes-256-cbc -K $encrypted_dfdcfd5172af_key -iv $encrypted_dfdcfd5172af_iv
-in deploy_key.enc -out ./deploy_key -d
- ssh-add ./deploy_key
- sudo add-apt-repository ppa:longsleep/golang-backports -y
- sudo apt-get update
- sudo apt-get install -y golang-go
- sudo apt-get install -y libev-dev
- go env | grep GOPATH > gopath.env
- source gopath.env
- export PATH=$PATH:$GOPATH/bin
- go get -u github.com/tsenart/vegeta
- npm install -g esy
install:
- esy install -q
- esy @libev install -q
- esy install -q
- esy @libev install -q
before_script:
- npm run build
- npm run build
jobs:
include:
- stage: "Test - Standard"
script: /bin/bash ci/test-standard.sh
- stage: "Test - Libev"
if: branch = master
script: /bin/bash ci/test-libev.sh
- stage: "Load Test - Libev"
if: branch = master
script: /bin/bash ci/test-under-load.sh
- stage: Test - Standard
script: "/bin/bash ci/test-standard.sh"
- stage: Test - Libev
if: branch = master
script: "/bin/bash ci/test-libev.sh"
- stage: Load Test - Libev
if: branch = master
script: "/bin/bash ci/test-under-load.sh"
- stage: Deploy Docs
if: branch = master
script: "/bin/bash ci/deploy-docs.sh"
7 changes: 7 additions & 0 deletions ci/deploy-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e
npm run build-docs
cd docs-src
npm run load-docs
npm run generate
scp -i ../deploy_key -r dist naboris-docs@shawnmcginty.com:~/www
Binary file added deploy_key.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion docs-src/content/docs/guides/sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ val setSessionConfig: ?maxAge: int -> ?sidKey: string -> string option -> 'sessi
```

* `sidKey` - `string` (optional) - The key used to store the session id in browser cookies. Defaults to `"nab.sid"`.
* `maxAge` - `int` (optional) - The max age of session cookies in seconds. Defaults to `2592000` (30 days.)
* `maxAge` - `int` (optional) - The max age of session cookies in seconds. Defaults to `2592000` (30 days).
* `mapSession` - covered in the section below.

#### <a name="session-mapping" href="#session-mapping">#</a> Session Mapping
Expand Down
4 changes: 2 additions & 2 deletions docs-src/content/docs/quick-start/static-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ let addStaticMiddleware: (list(string), string, t('sessionData)) => t('sessionDa
val addStaticMiddleware: string list -> string -> 'sessionData t -> 'sessionData t
```

* `list(string)` - Will match against the `Route.path` of each incoming request
* `list(string)` - Will match against the `Route.path` of each incoming request.
* `string` - Path to a local directory which will have the rest of the path applied to.
* `t` - Current `Naboris.ServerConfig`
* `t` - Current `Naboris.ServerConfig`.

The rest of the incoming request will be applied to the local path
e.g. given inputs `["static"], "/path/to/public"` a request for `/static/images/logo.png` would map to `/path/to/public/images/logo.png`.
Expand Down
2 changes: 1 addition & 1 deletion docs-src/pages/guides/_page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{{ previousPage.title }}
</a>
</div>
<div v-if="nextPage !== null" class="column">
<div v-if="nextPage !== null" class="column has-text-right">
<a :href="nextPage.href">
Next:
{{ nextPage.title }}
Expand Down
2 changes: 1 addition & 1 deletion docs-src/pages/quick-start/_page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{{ previousPage.title }}
</a>
</div>
<div v-if="nextPage !== null" class="column">
<div v-if="nextPage !== null" class="column has-text-right">
<a :href="nextPage.href">
Next:
{{ nextPage.title }}
Expand Down

0 comments on commit 7567737

Please sign in to comment.