2016-05-21 01:13:16 +02:00
|
|
|
machine:
|
|
|
|
environment:
|
2018-03-13 21:57:55 +01:00
|
|
|
CPATH: "${HOME}/.go_workspace/src/github.com/ansible-semaphore"
|
2018-03-07 23:09:25 +01:00
|
|
|
node:
|
|
|
|
version: 8.2.0
|
|
|
|
|
2016-05-21 01:13:16 +02:00
|
|
|
|
2016-01-05 00:32:53 +01:00
|
|
|
dependencies:
|
|
|
|
pre:
|
2018-03-13 21:57:55 +01:00
|
|
|
- sudo apt-get install rpm
|
2018-03-07 23:09:25 +01:00
|
|
|
- rm -rf ${CPATH} && mkdir -p ${CPATH}
|
|
|
|
- ln -sfn ${HOME}/${CIRCLE_PROJECT_REPONAME} ${CPATH}
|
2016-12-21 10:36:54 +01:00
|
|
|
- sudo rm -rf /usr/local/go
|
2018-03-05 18:16:48 +01:00
|
|
|
- sudo curl -L https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz > /tmp/go.tar.gz
|
2016-12-21 10:36:54 +01:00
|
|
|
- sudo tar -C /usr/local -xzf /tmp/go.tar.gz
|
2018-03-07 23:02:15 +01:00
|
|
|
- go get -u -v github.com/go-task/task/cmd/task
|
2018-03-11 01:52:31 +01:00
|
|
|
- go get github.com/schrej/godacov
|
2018-03-11 15:22:50 +01:00
|
|
|
- cd ${CPATH}/${CIRCLE_PROJECT_REPONAME} && task deps
|
2016-01-05 00:32:53 +01:00
|
|
|
override:
|
2018-03-07 23:09:25 +01:00
|
|
|
- task compile
|
2016-01-05 00:32:53 +01:00
|
|
|
|
|
|
|
test:
|
|
|
|
pre:
|
2018-03-07 23:09:25 +01:00
|
|
|
- |
|
|
|
|
cat > config.json <<EOF
|
2018-03-07 23:02:15 +01:00
|
|
|
{
|
|
|
|
"mysql": {
|
|
|
|
"host": "127.0.0.1:3306",
|
|
|
|
"user": "ubuntu",
|
|
|
|
"pass": "",
|
|
|
|
"name": "circle_test"
|
|
|
|
},
|
|
|
|
"session_db": "127.0.0.1:6379",
|
|
|
|
"port": ":8010",
|
|
|
|
"email_alert": false
|
|
|
|
}
|
|
|
|
EOF
|
2018-03-07 23:09:25 +01:00
|
|
|
- go run cli/main.go --migrate -config config.json
|
2016-01-05 00:32:53 +01:00
|
|
|
override:
|
2018-03-11 01:52:31 +01:00
|
|
|
- cd ${CPATH}/${CIRCLE_PROJECT_REPONAME} && task test
|
2018-03-07 23:02:15 +01:00
|
|
|
- task build
|
2018-03-11 01:52:31 +01:00
|
|
|
- task ci:artifacts
|
|
|
|
post:
|
|
|
|
# We don't export the coverage secret to forks so we need this to always return successfully
|
2018-03-13 21:57:55 +01:00
|
|
|
- godacov -t "${CODACY_TOKEN}" -r ./coverage.out -c "${CIRCLE_SHA1}" || true
|
|
|
|
|
|
|
|
deployment:
|
|
|
|
tag:
|
|
|
|
tag: /v[0-9]+(\.[0-9]+)*(-.*)*/
|
|
|
|
owner: ansible-semaphore
|
|
|
|
commands:
|
|
|
|
- curl -sL https://git.io/goreleaser | bash
|