#50 from travis-ci/meat-rm-stopped
master Merge pull requestSend all stopped instances for deletion
.travis.yml
language: bash
dist: xenial
group: edge
env:
global:
- TRAVIS_COMMIT_SHORT="$(echo $TRAVIS_COMMIT | cut -b1-7)"
- TRAVIS_COMMIT_LESSSHORT="$(echo $TRAVIS_COMMIT | cut -b1-9)"
jobs:
include:
- stage: test
name: linux
before_script:
- eval "$(gimme 1.11.4)"
script:
- make copyright
- git diff --exit-code
- git diff --cached --exit-code
- make
addons:
artifacts:
paths:
- "./build/linux/amd64/gcloud-cleanup"
- "./build/darwin/amd64/gcloud-cleanup"
- "./build.tar.gz"
target_paths:
- travis-ci/gcloud-cleanup/$TRAVIS_BRANCH
- travis-ci/gcloud-cleanup/$TRAVIS_COMMIT
- travis-ci/gcloud-cleanup/$TRAVIS_COMMIT_SHORT
- travis-ci/gcloud-cleanup/$TRAVIS_COMMIT_LESSSHORT
after_success:
- bash <(curl -s https://codecov.io/bash)
- tar -czvf build.tar.gz build Procfile Makefile
- name: docker
if: type != 'pull_request'
script:
- export DOCKER_IMAGE_REPO=travisci/gcloud-cleanup
- export VERSION_VALUE=$(git describe --always --dirty --tags 2>/dev/null)
- export DOCKER_DEST=$DOCKER_IMAGE_REPO:$VERSION_VALUE
- docker build -t $DOCKER_DEST .
- docker run --rm -it $DOCKER_DEST gcloud-cleanup --help
- script/docker-push $DOCKER_DEST
addons:
apt:
packages:
- docker-ce
Build Config
{
"os": [
"linux"
],
"env": {
"global": [
"TRAVIS_COMMIT_SHORT=\"$(echo $TRAVIS_COMMIT | cut -b1-7)\"",
"TRAVIS_COMMIT_LESSSHORT=\"$(echo $TRAVIS_COMMIT | cut -b1-9)\""
]
},
"dist": "xenial",
"group": "edge",
"matrix": {
"include": [
{
"name": "linux",
"stage": "test",
"addons": {
"artifacts": {
"paths": [
"./build/linux/amd64/gcloud-cleanup",
"./build/darwin/amd64/gcloud-cleanup",
"./build.tar.gz"
],
"enabled": true,
"target_paths": [
"travis-ci/gcloud-cleanup/$TRAVIS_BRANCH",
"travis-ci/gcloud-cleanup/$TRAVIS_COMMIT",
"travis-ci/gcloud-cleanup/$TRAVIS_COMMIT_SHORT",
"travis-ci/gcloud-cleanup/$TRAVIS_COMMIT_LESSSHORT"
]
}
},
"script": [
"make copyright",
"git diff --exit-code",
"git diff --cached --exit-code",
"make"
],
"after_success": [
"bash <(curl -s https://codecov.io/bash)",
"tar -czvf build.tar.gz build Procfile Makefile"
],
"before_script": [
"eval \"$(gimme 1.11.4)\""
]
},
{
"if": "type != 'pull_request'",
"name": "docker",
"addons": {
"apt": {
"packages": [
"docker-ce"
]
}
},
"script": [
"export DOCKER_IMAGE_REPO=travisci/gcloud-cleanup",
"export VERSION_VALUE=$(git describe --always --dirty --tags 2>/dev/null)",
"export DOCKER_DEST=$DOCKER_IMAGE_REPO:$VERSION_VALUE",
"docker build -t $DOCKER_DEST .",
"docker run --rm -it $DOCKER_DEST gcloud-cleanup --help",
"script/docker-push $DOCKER_DEST"
]
}
]
},
"language": "shell"
}