Skip to content

Commit

Permalink
concourse configs (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsinrahman authored and tamalsaha committed Apr 21, 2018
1 parent ff9d8e9 commit d317210
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hack/concourse/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.10-stretch

RUN apt-get update && \
apt-get install -y git python python-pip && \
pip install git+https://github.com/ellisonbg/antipackage.git#egg=antipackage && \
pip install pyyaml

COPY pharmer /bin/
COPY kubectl /bin/
35 changes: 35 additions & 0 deletions hack/concourse/e2e_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -x -e

mkdir -p $GOPATH/src/github.com/appscode
cp -r stash $GOPATH/src/github.com/appscode
cd $GOPATH/src/github.com/appscode/stash

NAME=stash-$(git rev-parse HEAD) #name of the cluster

cat > cred.json <<EOF
{
"token" : "$TOKEN"
}
EOF

function cleanup {
pharmer get cluster
pharmer delete cluster $NAME
pharmer get cluster
sleep 300
pharmer apply $NAME
pharmer get cluster
}
trap cleanup EXIT

pharmer create credential --from-file=cred.json --provider=DigitalOcean cred
pharmer create cluster $NAME --provider=digitalocean --zone=nyc3 --nodes=2gb=1 --credential-uid=cred --kubernetes-version=v1.9.0
pharmer apply $NAME
pharmer use cluster $NAME
kubectl get nodes

./hack/builddeps.sh
./hack/make.py
./hack/make.py test e2e --v=3 --rbac=true --webhook=true --kubeconfig=/root/.kube/config
109 changes: 109 additions & 0 deletions hack/concourse/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
resource_types:
- name: pull-request
type: docker-image
source:
repository: tahsin/git-pull-resource
tag: show-stderr

resources:
- name: stash
type: git
source:
uri: https://github.com/appscode/stash
branch: tahsin

- name: pull-request
type: pull-request
source:
owner: appscode
repo: stash
label: ok-to-test
org: appscode
access_token: ((access_token))

jobs:
- name: unit-test-stash
plan:
- get: stash
trigger: true
- task: run-unit-test
file: stash/hack/concourse/task_unit_test.yml

- name: unit-test-pr
plan:
- get: pull-request
version: every
trigger: true
- put: pull-request
params:
path: pull-request
status: pending
- task: run-unit-test
file: pull-request/hack/concourse/task_unit_test_pr.yml
on_success:
put: pull-request
params:
path: pull-request
status: success
on_failure:
put: pull-request
params:
path: pull-request
status: failure

- name: e2e-test-stash
plan:
- get: stash
trigger: true
passed: [unit-test-stash]
- task: run-e2e-test
config:
platform: linux
image_resource:
type: docker-image
source:
repository: tahsin/voyager-e2e
tag: latest
inputs:
- name: stash
run:
path: stash/hack/concourse/e2e_test.sh
params:
TOKEN: ((digitaloceanToken))

- name: e2e-test-pr
plan:
- get: pull-request
trigger: true
version: every
passed: [unit-test-pr]
- put: pull-request
params:
path: pull-request
status: pending
- task: run-e2e-test
config:
platform: linux
image_resource:
type: docker-image
source:
repository: tahsin/voyager-e2e
tag: latest
inputs:
- name: pull-request
path: stash
run:
path: stash/hack/concourse/e2e_test.sh
params:
TOKEN: ((digitaloceanToken))
on_success:
put: pull-request
params:
path: pull-request
status: success
on_failure:
put: pull-request
params:
path: pull-request
status: failure

13 changes: 13 additions & 0 deletions hack/concourse/task_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
platform: linux

image_resource:
type: docker-image
source:
repository: tahsin/voyager-e2e
tag: latest

inputs:
- name: stash

run:
path: stash/hack/concourse/unit_test.sh
14 changes: 14 additions & 0 deletions hack/concourse/task_unit_test_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
platform: linux

image_resource:
type: docker-image
source:
repository: tahsin/voyager-e2e
tag: latest

inputs:
- name: pull-request
path: stash

run:
path: stash/hack/concourse/unit_test.sh
13 changes: 13 additions & 0 deletions hack/concourse/unit_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -x -e

mkdir -p $GOPATH/src/github.com/appscode
cp -r stash $GOPATH/src/github.com/appscode
pushd $GOPATH/src/github.com/appscode/stash

./hack/builddeps.sh
./hack/make.py
./hack/make.py test unit

popd

0 comments on commit d317210

Please sign in to comment.