This repository has been archived by the owner on Aug 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Builds docker image, starts container does some basic sanity checks.
- Loading branch information
1 parent
a0a993c
commit 7d243f1
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" | ||
|
||
|
||
|