Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog and versions #174

Merged
merged 12 commits into from
May 31, 2018
Merged
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
87 changes: 58 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
version: 2

onlyTag: &onlyTag
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/

runOnMachine: &runOnMachine
machine:
docker_layer_caching: true
working_directory: ~/.go_workspace/src/github.com/mesg-foundation/core

jobs:
test:
"build_docker":
<<: *runOnMachine
steps:
- checkout
- run: docker pull mesg/daemon:latest
- run: docker build -t mesg/daemon:$CIRCLE_SHA1 .

"test":
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/mesg-foundation/core
Expand All @@ -9,13 +29,29 @@ jobs:
- setup_remote_docker
- run: go get -t ./...
- run: docker swarm init
- run: env DAEMON.IMAGE=mesg/daemon:local go test -timeout 60s -p 1 -coverprofile=coverage.txt ./...
- run: env DAEMON.IMAGE=mesg/daemon:$CIRCLE_SHA1 go test -timeout 60s -p 1 -coverprofile=coverage.txt ./...
- run: bash <(curl -s https://codecov.io/bash)

cli_build_deploy:
machine:
docker_layer_caching: true
working_directory: ~/.go_workspace/src/github.com/mesg-foundation/core
"publish_docker_version":
<<: *runOnMachine
steps:
- checkout
- run: docker pull mesg/daemon:latest
- run: docker build -t mesg/daemon:$CIRCLE_TAG .
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker push mesg/daemon:$CIRCLE_TAG

"publish_docker_latest":
<<: *runOnMachine
steps:
- checkout
- run: docker pull mesg/daemon:latest
- run: docker build -t mesg/daemon:latest .
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker push mesg/daemon:latest

"release_cli":
<<: *runOnMachine
steps:
- checkout
- run: go get ./...
Expand All @@ -24,32 +60,25 @@ jobs:
- run: cd bin; xgo --targets=darwin/386,darwin/amd64,linux/386,linux/amd64,windows/386,windows/amd64 -out mesg-core ../cli
- run: sudo chmod +x ./bin/*
- run: go get -u github.com/tcnksm/ghr
- run: ghr -u mesg-foundation -r core -delete release-dev ./bin

docker_build_deploy:
machine:
docker_layer_caching: true
working_directory: ~/.go_workspace/src/github.com/mesg-foundation/core
steps:
- checkout
- run: docker build -t mesg/daemon .
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker push mesg/daemon
- run: ghr -u mesg-foundation -r core -delete $CIRCLE_TAG ./bin

workflows:
version: 2
test_build_deploy:
build_n_deploy:
jobs:
- test
- docker_build_deploy:
- "build_docker"
- "test":
requires:
- "build_docker"
- "publish_docker_version":
<<: *onlyTag
requires:
- "test"
- "publish_docker_latest":
<<: *onlyTag
requires:
- test
filters:
branches:
only: dev
- cli_build_deploy:
- "test"
- "release_cli":
<<: *onlyTag
requires:
- test
filters:
branches:
only: dev
- "publish_docker_latest"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

## [Unreleased]

#### Changed
- (#174) Update CI to build version based on tags

#### Added
- (#174) Add CHANGELOG.md file

#### Removed

#### Fixed
2 changes: 1 addition & 1 deletion dev-daemon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

build/test-daemon.sh
scripts/build-test-daemon.sh
env DAEMON.IMAGE=mesg/daemon:local go run cli/main.go daemon start
env DAEMON.IMAGE=mesg/daemon:local go run cli/main.go daemon logs
env DAEMON.IMAGE=mesg/daemon:local go run cli/main.go daemon stop
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions service/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"testing"
"time"

"github.com/mesg-foundation/core/container"
"github.com/stvp/assert"
Expand Down Expand Up @@ -108,6 +109,7 @@ func TestStartStopStart(t *testing.T) {
}
service.Start()
service.Stop()
time.Sleep(10 * time.Second)
dockerServices, err := service.Start()
assert.Nil(t, err)
assert.Equal(t, len(dockerServices), 1)
Expand Down