Merge pull request #53 from etienne-napoleone/travis

Update Travis
This commit is contained in:
Tuna 2018-06-26 09:31:45 +07:00 committed by GitHub
commit 0ee57ba8d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 30 deletions

View file

@ -1,11 +1,14 @@
sudo: required
language: go language: go
go_import_path: github.com/ethereum/go-ethereum go_import_path: github.com/ethereum/go-ethereum
sudo: false services: skip
matrix: before_install: skip
jobs:
include: include:
- os: linux - stage: Build and test
os: linux
dist: trusty dist: trusty
sudo: required
go: 1.9.x go: 1.9.x
script: script:
- sudo modprobe fuse - sudo modprobe fuse
@ -15,7 +18,6 @@ matrix:
- go run build/ci.go test -coverage - go run build/ci.go test -coverage
- os: linux - os: linux
dist: trusty dist: trusty
sudo: required
go: '1.10' go: '1.10'
script: script:
- sudo modprobe fuse - sudo modprobe fuse
@ -23,23 +25,37 @@ matrix:
- sudo chown root:$USER /etc/fuse.conf - sudo chown root:$USER /etc/fuse.conf
- go run build/ci.go install - go run build/ci.go install
- go run build/ci.go test -coverage - go run build/ci.go test -coverage
- os: osx - stage: Lint
go: '1.10' os: linux
script: sudo: false
- unset -f cd
- brew update
- brew cask install osxfuse
- go run build/ci.go install
- go run build/ci.go test -coverage
- os: linux
dist: trusty dist: trusty
go: '1.10' go: '1.10'
env:
- lint
git: git:
submodules: false submodules: false
script: script:
- go run build/ci.go lint - go run build/ci.go lint
- stage: Build and push Docker image
services:
- docker
before_install:
- docker build -t tomochain/tomochain .
- docker run tomochain/tomochain
deploy:
provider: script
script: bash docker_push.sh
on:
branch: master
- stage: Trigger rebuild of infrastructure image
sudo: false
script: bash docker_rebuild.sh
stages:
- name: Build and test
- name: Lint
- name: Build and push Docker image
if: type != pull_request AND branch = master
- name: Trigger rebuild of infrastructure image
if: type != pull_request AND branch = master
notifications: notifications:
slack: slack:

View file

@ -1,11 +0,0 @@
version: "3.4"
services:
sut:
build: .
volumes:
- "./docker/docker_tests.sh:/test/docker_tests.sh"
entrypoint:
- /bin/sh
- /test/docker_tests.sh

View file

@ -1,3 +0,0 @@
#!/bin/sh
$(tomo --help | grep -q tomo)

7
docker_push.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker tag tomochain/tomochain tomochain/tomochain:latest
docker tag tomochain/tomochain tomochain/tomochain:$TRAVIS_BUILD_ID
docker push tomochain/tomochain:latest
docker push tomochain/tomochain:$TRAVIS_BUILD_ID

1
docker_rebuild.sh Normal file
View file

@ -0,0 +1 @@
curl -X POST $INFRA_IMAGE_REBUILD_HOOK