Skip to content
Open

ci #26

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ci/build-golang-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

resources:

- name: go_script
type: git
source:
uri: https://github.com/mchirico/go_script.git
branch: next

###############################################################################

jobs:

- name: unit
plan:
- get: go_script
trigger: true
- task: unit
file: go_script/ci/unit-task.yml

- name: build
plan:
- get: go_script
trigger: true
passed: [unit]
- task: build
file: go_script/ci/build-task.yml
17 changes: 17 additions & 0 deletions ci/build-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

platform: linux

image_resource:
type: registry-image
source: {repository: golang}

inputs:
- name: go_script
path: gopath/src/gopath/src/github.com/mchirico/go_script

caches:
- path: depspath/
- path: gopath/pkg/

run:
path: gopath/src/gopath/src/github.com/mchirico/go_script/ci/build.sh
22 changes: 22 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e -u -x

export GOPATH=$PWD/depspath:$PWD/gopath
export PATH=$PWD/depspath/bin:$PWD/gopath/bin:$PATH

cd gopath/src/gopath/src/github.com/mchirico/go_script

#cd cmd/cake

echo
echo "Fetching dependencies..."
go get -v

echo
echo "Building..."
go build -v

echo
echo "Smoke test..."
#./cake
25 changes: 25 additions & 0 deletions ci/run_ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -eu

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
export fly_target=${fly_target:-mce}
echo "Concourse API target ${fly_target}"
echo "Tutorial $(basename $DIR)"

pushd $DIR
fly -t ${fly_target} set-pipeline -p go_script-pipeline -c build-golang-pipeline.yml -n
fly -t ${fly_target} unpause-pipeline -p go_script-pipeline
# fly -t ${fly_target} trigger-job -w -j tutorial-pipeline/job-hello-world
popd

echo -e "\n\n Common commands:"
echo -e "**************************************\n\n"
echo -e "\n"
echo -e " fly -t mce watch --job go_script-pipeline/unit"
echo -e " fly -t mce builds|grep 'go_script-pipeline'"
echo -e " fly -t mce destroy-pipeline -p go_script-pipeline -n"
echo -e " fly -t mce workers -d "
echo -e "\n"
echo -e "\n"

16 changes: 16 additions & 0 deletions ci/unit-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
platform: linux

image_resource:
type: registry-image
source: {repository: golang}

inputs:
- name: go_script
path: gopath/src/gopath/src/github.com/mchirico/go_script

caches:
- path: depspath/
- path: gopath/pkg/

run:
path: gopath/src/gopath/src/github.com/mchirico/go_script/ci/unit.sh
16 changes: 16 additions & 0 deletions ci/unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e -u -x

export GOPATH=$PWD/depspath:$PWD/gopath
export PATH=$PWD/depspath/bin:$PWD/gopath/bin:$PATH

cd gopath/src/gopath/src/github.com/mchirico/go_script

echo
echo "Fetching dependencies..."
go get -v -t ./...

echo
echo "Running tests..."
go test -v -race ./...