Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Commit

Permalink
Adds Travis build.
Browse files Browse the repository at this point in the history
Builds docker image, starts container does some basic sanity checks.
  • Loading branch information
schnatterer committed Mar 11, 2019
1 parent a0a993c commit 7d243f1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
- docker

before_install:
- docker build --no-cache -t gollum-galore .
# Don't deamonize, because we want to see the logs
- docker run --rm --name gollum-galore -p 8080:80 -e GOLLUM_PARAMS="--allow-uploads --live-preview" -e CADDY_PARAMS="-conf /gollum/config/Caddyfile" -v $(pwd)/test/Caddyfile:/gollum/config/Caddyfile gollum-galore&
# Wait for gollum-galore to startup
- sleep 5
- echo "Finish sleeping"

# Do some basic sanity checks with the container
script:
- chmod +x test/test.sh
- test/test.sh
12 changes: 12 additions & 0 deletions test/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import /app/Caddyfile

jwt {
path /
redirect /login
allow sub bob
}

login {
success_url /
simple bob=secret,alice=secret
}
25 changes: 25 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail


main() {

loginAndCreatePage

}

loginAndCreatePage() {

TOKEN=$(curl "http://localhost:8080/login" --data "username=bob&password=secret")
EXPECTED_CONTENT="ThisIsOurContent"
curl "http://localhost:8080/create" --data \
"page=Home&path="%"2F&format=markdown&content=${EXPECTED_CONTENT}&message=Created+Home+"%"28markdown"%"29" -H "Cookie: jwt_token=$TOKEN"
curl "http://localhost:8080/Home" -H "Cookie: jwt_token=$TOKEN" | grep ${EXPECTED_CONTENT}

}

main "$@"



0 comments on commit 7d243f1

Please sign in to comment.