Permalink
Browse files

[testing] setting up CI (#210)

* add circle.yml

* docker: update go version to 1.9

* add comments and organize steps

* temporarily remove go test step

* add ponzu install step

* add generate, build, run and test
  • Loading branch information...
nilslice committed Dec 20, 2017
1 parent 1124d6a commit 4813ff8e0a25cb8ebc30c9cf5c6393e2726dbcd4
Showing with 67 additions and 1 deletion.
  1. +15 −0 .circleci/config.yml
  2. +25 −0 .circleci/test-run.sh
  3. +26 −0 .circleci/test-setup.sh
  4. +1 −1 Dockerfile
View
@@ -0,0 +1,15 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.9
steps:
- checkout
# generate and build project to test
- run: curl https://raw.githubusercontent.com/ponzu-cms/ponzu/ponzu-dev/.circleci/test-setup.sh | sh
# run tests
- run: curl https://raw.githubusercontent.com/ponzu-cms/ponzu/ponzu-dev/.circleci/test-run.sh | sh
View
@@ -0,0 +1,25 @@
#!/bin/bash
# Test that the configuration runs.
set -ex
cd /go/src/github.com/ponzu-cms/ci/test-project
ponzu run --dev-https &
# Smoke test
sleep 2
curl -Lk https://localhost:10443/admin | grep https://www.bosssauce.it
# Run unit tests
touch cookies
# Create initial admin user
curl -v --cookie-jar cookies \
-d "name=Test&domain=localhost&email=test@ponzu-cms.org&password=ponzu" \
-X POST localhost:8080/admin/init
#Test that content types were generated
curl -b cookies -c cookies http://localhost:8080/admin/contents?type=Person \
| grep Person
View
@@ -0,0 +1,26 @@
#!/bin/bash
# Set up test environment
set -ex
# Install Ponzu CMS
go get -u github.com/ponzu-cms/ponzu/...
# test install
ponzu
# create a project and generate code
ponzu new github.com/ponzu-cms/ci/test-project
cd /go/src/github.com/ponzu-cms/ci/test-project
ponzu gen content person name:string hashed_secret:string
ponzu gen content message from:@person,hashed_secret to:@person,hashed_secret
# build and run dev http/2 server with TLS
ponzu build
View
@@ -1,6 +1,6 @@
# Base our image on an official, minimal image of our preferred golang
FROM golang:1.8.1
FROM golang:1.9
# Note: The default golang docker image, already has the GOPATH env variable set.
# GOPATH is located at /go

0 comments on commit 4813ff8

Please sign in to comment.