Skip to content

Commit

Permalink
Travis and Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Muravya committed Apr 9, 2021
1 parent 213d36a commit 4a7720b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 64 deletions.
104 changes: 52 additions & 52 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
# Matrix build runs 4 parallel builds
matrix:
include:
- language: go # Build and Test
sudo: required
services:
- docker
script:
- export GO111MODULE=on
- go mod vendor # Download dependencies
- make build # Build application
- test -f bin/linux_amd64/honeypot # Test for presence of binary built in previous step
- make all-container # Make all Docker containers
- docker images | grep "^docker.pkg.github.com/kyberorg/honeypot/honeypot.*__linux_amd64" # Check presence of created images
- make test # Runs tests inside test image

- language: go # SonarCloud
addons:
sonarcloud:
organization: kyberorg
token:
secure: "<token-here>"
before_script:
- ./reports.sh # Creates directories and files for reports
- export GO111MODULE=on
- go mod vendor # Download dependencies
- make ci # Run tests and generate reports (See `ci` step in Makefile)
script:
- sonar-scanner # Run analysis using SonarCloud scanner plugin

- language: go # CodeClimate
before_script:
- ./reports.sh # Create directories and files for reports
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter # Download CodeClimate test reporter
- chmod +x ./cc-test-reporter # Make it executable
- ./cc-test-reporter before-build # Notify CodeClimate of pending report
script:
- export GO111MODULE=on
- go mod vendor # Download dependencies
- make ci # Run tests and generate reports (See `ci` step in Makefile)
after_script:
- ./cc-test-reporter after-build -t gocov --exit-code $TRAVIS_TEST_RESULT # Send report to CodeClimate or notify it of failing build based on exit code

- language: go # Push if on trunk
services:
- docker
if: branch = trunk
script:
- export GO111MODULE=on
- go mod vendor # Download dependencies
- echo "$DOCKER_PASSWORD" | docker login docker.pkg.github.com -u "$DOCKER_USERNAME" --password-stdin # Login to GitHub Registry using Travis environment variables
- make container # Create dirty and latest images
- make push # Push image to registry

- language: go
sudo: required
services:
- docker
script:
- export GO111MODULE=on
- go mod vendor
- make build
- test -f bin/linux_amd64/honeypot
- make all-container
- docker images | grep "^docker.pkg.github.com/kyberorg/honeypot/honeypot.*__linux_amd64"
- make test
- language: go
addons:
sonarcloud:
organization: kyberorg
token:
secure: fV8p83gaDNUamGYZZOmJiIenRo/1sTBxQs/6dkzauBIn6YI5v7xZJqI4j1ibID12TXaQQoHIlGDsoaNQbJQXHINaIah5C4BIK6GORbM1ElJpzPaa87zkC9Fpm68DVigJSthFz6IwYxQn2zlxYeN6xkcxBo/9OlnPKDJ06QpqQYdkyPvI5nYAcM0wQ0Yrw04mONFjQnQcMDuo4O+F/SZsRYFmda5p4waPbFSKOExmGmQS/vftCeaXge0u6fm7LpW87ixdYWYMgkjXu5D8NuqA/9WdLSVLi/YpnnU7J/DOtNeh2UFf4F7X4cB3mwULu88GuJocHbruC9vt2t0BbWy0rGBmjVrze7EjWKSzs5ASbsj6qflGtt13OxGTzJAEP0FV1Ikcr3xikUG6798IBDk2HGnggtPE2US9EpUI3QsfGrOzRIfv3l67SHUv8Wc1ks8HT9tXoX9blJN2mP7CPDjaNEvkHzkGviJPg381mT5QYbSx5bqYUkGdUxGRNk/YtP1J+i8N895N8NQpjy7uTGILafCR0ahEYb3ZQg96UU/l9IvriaxM/pZPlj0ADHry6dDbWHguS4txp+7AmxMFOq77ez76f82OFZ9iDl0dwFeQEun10zH9IL0LqrXeno+Fz0dg+ykOlSUcnlUDSNIsBRjB4UgY+umtqyNlxR84FDACpXY=
before_script:
- "./reports.sh"
- export GO111MODULE=on
- go mod vendor
- make ci
script:
- sonar-scanner
- language: go
before_script:
- "./reports.sh"
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
> ./cc-test-reporter
- chmod +x ./cc-test-reporter
- "./cc-test-reporter before-build"
script:
- export GO111MODULE=on
- go mod vendor
- make ci
after_script:
- "./cc-test-reporter after-build -t gocov --exit-code $TRAVIS_TEST_RESULT"
- language: go
services:
- docker
if: branch = trunk
script:
- export GO111MODULE=on
- go mod vendor
- echo "$DOCKER_PASSWORD" | docker login docker.pkg.github.com -u "$DOCKER_USERNAME"
--password-stdin
- make container
- make push
notifications:
email: false
env:
global:
secure: fV8p83gaDNUamGYZZOmJiIenRo/1sTBxQs/6dkzauBIn6YI5v7xZJqI4j1ibID12TXaQQoHIlGDsoaNQbJQXHINaIah5C4BIK6GORbM1ElJpzPaa87zkC9Fpm68DVigJSthFz6IwYxQn2zlxYeN6xkcxBo/9OlnPKDJ06QpqQYdkyPvI5nYAcM0wQ0Yrw04mONFjQnQcMDuo4O+F/SZsRYFmda5p4waPbFSKOExmGmQS/vftCeaXge0u6fm7LpW87ixdYWYMgkjXu5D8NuqA/9WdLSVLi/YpnnU7J/DOtNeh2UFf4F7X4cB3mwULu88GuJocHbruC9vt2t0BbWy0rGBmjVrze7EjWKSzs5ASbsj6qflGtt13OxGTzJAEP0FV1Ikcr3xikUG6798IBDk2HGnggtPE2US9EpUI3QsfGrOzRIfv3l67SHUv8Wc1ks8HT9tXoX9blJN2mP7CPDjaNEvkHzkGviJPg381mT5QYbSx5bqYUkGdUxGRNk/YtP1J+i8N895N8NQpjy7uTGILafCR0ahEYb3ZQg96UU/l9IvriaxM/pZPlj0ADHry6dDbWHguS4txp+7AmxMFOq77ez76f82OFZ9iDl0dwFeQEun10zH9IL0LqrXeno+Fz0dg+ykOlSUcnlUDSNIsBRjB4UgY+umtqyNlxR84FDACpXY=
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Honeypot

[![Build Status](https://travis-ci.com/kyberorg/honeypot.svg?branch=master)](https://travis-ci.com/kyberorg/honeypot)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=MartinHeinz_go-project-honeypot&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=MartinHeinz_go-project-honeypot)
[![Test Coverage](https://api.codeclimate.com/v1/badges/ec7ebefe63609984cb5c/test_coverage)](https://codeclimate.com/github/kyberorg/honeypot/test_coverage)
[![Build Status](https://travis-ci.com/kyberorg/honeypot.svg?branch=trunk)](https://travis-ci.com/kyberorg/honeypot)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=kyberorg_honeypot&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=kyberorg_honeypot)
[![Maintainability](https://api.codeclimate.com/v1/badges/51bc8dc67c396a7b87c4/maintainability)](https://codeclimate.com/github/kyberorg/honeypot/maintainability)
[![Go Report Card](https://goreportcard.com/badge/github.com/kyberorg/honeypot)](https://goreportcard.com/report/github.com/kyberorg/honeypot)

## More Information About This Repo
Expand Down
14 changes: 5 additions & 9 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
sonar.projectKey=<proj_key>
sonar.organization=<org>
sonar.projectName=<name>
sonar.projectVersion=<version>
sonar.projectKey=kyberorg_honeypot
sonar.organization=kyberorg
sonar.projectName=honeypot
sonar.projectVersion=1.0

sonar.login=<login>
sonar.login=bd0ab89610198904d8be92fae7dcb2db28499cc0
sonar.password=

sonar.links.homepage=
sonar.links.ci=
sonar.links.scm=

sonar.sources=cmd
sonar.tests=cmd
sonar.binaries=cmd/bin/linux_amd64
Expand Down

0 comments on commit 4a7720b

Please sign in to comment.