This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
72 lines (59 loc) · 3.23 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
sudo: required
services:
- docker
env:
global:
- secure: YdYgoOCsfP8etDVdbURY/HCqZhGUrWzOsgQcfBCnkbBueU0ugt48rX/BFTtrq/qIJp/N9YqDpw7Vz3X1mhfT3EMpNJRDkbHaMM1YxWX++PmGdVu71ZCiONd2/Q8h8uZP7MLgeD7nnMhls8LBgiCqqWUK0NXfMQwzALYechV42nw=
- secure: a5ZD5zp0Nu1GQUMJeTL9fCNxbtKfRzXOafWsrCipP/qg+uKrbNVS5sbhCBu7WB/Qf1x8cQapyXgRcFX/13bTkB+SWYEcUeRK5FH0hByaWLbjxuQNx5QjoRZEgi7lgvEbgyFPnsqAKLPoKmauRGGAlkhZOwnLRFpdha/+b2lKRs8=
- secure: D/lV1ExPr9QJci0sVGbXhyaESFC1fxwxFQ6u/CG0o8MuFMi+LHgp64Ga6BkKBy5xVhhMLOtW+wlYps7SBHUY/taWArhNBmuaIx567+2i0fAccM7QB3YcwPLeZLtu9aE+VF0QF5+4QolREqT7CWScW0Xwg4QsYkP+FXHxoTSnAyk=
- secure: mgJrLXgbKE3nBR3CdjD1jL3ygxEtRiOATOqbzzOwAMjcfNffwrs1G/pWrDNn+Ogn5rX+9cK1tkCi98gcLWaCgyUNPs2VB6BYGY4ADXpxQDmM2ihyw2/bLqbyFxGJ/sIQ7H/lmi+bB7CCFwT5Ej/fBPn9Cj7qu2Z4KW9nTPK9LK0=
cache:
directories:
- "$HOME/.m2/repository"
- "$HOME/.sbt"
- "$HOME/.ivy2"
language: scala
scala:
- 2.12.1
jdk:
- oraclejdk8
addons:
hostname: localhost
script:
- sbt compile test:compile
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sbt "set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)" "project core" test; else sbt "set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)" "project core" coverage test ; fi
- find $HOME/.sbt -name "*.lock" | xargs rm
before_install:
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_48ebb0d1c0b9_key -iv $encrypted_48ebb0d1c0b9_iv -in secrets.tar.enc -out secrets.tar -d; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then tar xvf secrets.tar; fi
- docker run -td --name powerapi-influxdb -e INFLUXDB_ADMIN_USER=powerapi -e INFLUXDB_ADMIN_PASSWORD=powerapi -p 8086:8086 influxdb:1.4
after_success:
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt "project core" coverageReport; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt "project core" coveralls; fi
before_deploy:
- sbt "project cpuSampling" stage
- tar -C powerapi-sampling-cpu/target/universal/stage -cvzf powerapi-sampling-cpu-$TRAVIS_TAG.tgz --transform "s/\./powerapi-sampling-cpu-$TRAVIS_TAG/" .
- sbt "project cli" stage
- tar -C powerapi-cli/target/universal/stage -cvzf powerapi-cli-$TRAVIS_TAG.tgz --transform "s/\./powerapi-cli-$TRAVIS_TAG/" .
deploy:
provider: releases
api_key:
secure: Wa5OZQqXWkVuoDr8QXiCbsRmJcgxnpr36/CcDzQMjrBEGxfO5NMql0eHBnJ8DwoL109aBO48AQUoz/zwPXPCgx1l152ccMfAvtilVcTKXR52TRZKMRe/qsirxcQ6tvI1AuJ0IpRgdeH5qOp3f8EgbBKGgIilo80OlHy0LcKn+Bc=
file:
- powerapi-sampling-cpu-$TRAVIS_TAG.tgz
- powerapi-cli-$TRAVIS_TAG.tgz
skip_cleanup: true
on:
tags: true
repo: Spirals-Team/powerapi
after_deploy:
- sbt "project core" publishSigned sonatypeRelease
- docker login -u $DOCKER_USER -p $DOCKER_PWD
- docker build -f docker/sampling/Dockerfile -t spirals/powerapi-sampling-cpu:$TRAVIS_TAG .
- docker push spirals/powerapi-sampling-cpu:$TRAVIS_TAG
- docker build -f docker/cli/Dockerfile -t spirals/powerapi-cli:$TRAVIS_TAG .
- docker push spirals/powerapi-cli:$TRAVIS_TAG
- docker tag spirals/powerapi-sampling-cpu:$TRAVIS_TAG spirals/powerapi-sampling-cpu:latest
- docker push spirals/powerapi-sampling-cpu:latest
- docker tag spirals/powerapi-cli:$TRAVIS_TAG spirals/powerapi-cli:latest
- docker push spirals/powerapi-cli:latest