Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Commit

Permalink
Update Travis CI build
Browse files Browse the repository at this point in the history
Make better use of cli.yml config.  Add --ignore-lint option to build
script.
  • Loading branch information
David Dooling committed Aug 10, 2017
1 parent fcc9318 commit e4756fc
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 12 deletions.
24 changes: 22 additions & 2 deletions .atomist/build/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,29 @@ remote_repositories:
rug:
publish: false
url: "https://atomist.jfrog.io/atomist/rugs"
team:
staging:
publish: true
url: "${MAVEN_BASE_URL}/${TEAM_ID}"
url: "${MAVEN_BASE_URL}/T1L0VDKJP"
authentication:
username: "${MAVEN_USER}"
password: "${MAVEN_TOKEN}"
staging-ghe:
publish: true
url: "${MAVEN_BASE_URL}/T6G4G4B4G"
authentication:
username: "${MAVEN_USER}"
password: "${MAVEN_TOKEN}"
release:
publish: true
url: "${MAVEN_BASE_URL}/rugs-release"
authentication:
username: "${MAVEN_USER}"
password: "${MAVEN_TOKEN}"
configuration:
options:
disable_console_log: true
error: true
quiet: true
resolver_report: true
timer: true
update: true
42 changes: 33 additions & 9 deletions .atomist/build/travis-build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

set -o pipefail

declare Pkg=travis-build
declare Version=0.9.0
declare Pkg=travis-build-rug
declare Version=1.0.0

function msg() {
echo "$Pkg: $*"
Expand All @@ -16,6 +16,19 @@ function err() {

# usage: main "$@"
function main () {
local arg ignore_lint
for arg in "$@"; do
case "$arg" in
--ignore-lint | --ignore-lin | --ignore-li | --ignore-l)
ignore_lint=1
;;
-*)
err "unknown option: $arg"
return 2
;;
esac
done

local formula_url=https://raw.githubusercontent.com/atomist/homebrew-tap/master/Formula/rug-cli.rb
local formula
formula=$(curl -s -f "$formula_url")
Expand Down Expand Up @@ -56,8 +69,7 @@ function main () {
return 1
fi
fi
rug="$rug --timer --quiet --update --resolver-report --error --settings=$PWD/.atomist/build/cli.yml"
export TEAM_ID=T1L0VDKJP
rug="$rug --settings=$PWD/.atomist/build/cli.yml"

msg "running npm install"
if ! ( cd .atomist && npm install ); then
Expand All @@ -66,8 +78,19 @@ function main () {
fi

msg "running lint"
if ! ( cd .atomist && npm run lint ); then
err "tslint failed"
( cd .atomist && npm run lint )
local lint_status=$?
if [[ $lint_status -eq 0 ]]; then
:
elif [[ $lint_status -eq 2 ]]; then
err "TypeScript failed to pass linting"
if [[ $ignore_lint ]]; then
err "ignoring linting failure"
else
return 1
fi
else
err "tslint errored"
return 1
fi

Expand Down Expand Up @@ -106,14 +129,15 @@ function main () {
err "failed to extract archive version from $pkg_json: $archive_version"
return 1
fi
local teams=staging,staging-ghe
local project_version
if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ $archive_version != $TRAVIS_TAG ]]; then
err "archive version ($archive_version) does not match git tag ($TRAVIS_TAG)"
return 1
fi
project_version=$TRAVIS_TAG
TEAM_ID=rugs-release
teams=$teams,release
else
local timestamp
timestamp=$(date +%Y%m%d%H%M%S)
Expand All @@ -127,8 +151,8 @@ function main () {
msg "archive version: $project_version"

if [[ $TRAVIS_BRANCH == master || $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
msg "publishing archive to $TEAM_ID"
if ! $rug publish -a "$project_version"; then
msg "publishing archive to $teams"
if ! $rug publish -a "$project_version" -i "$teams"; then
err "failed to publish archive $project_version"
git diff
return 1
Expand Down
4 changes: 3 additions & 1 deletion .atomist/tests/project/UpdateSupportFilesTest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ Feature: Keep TypeScript support and build files up to date
Then directory at .atomist/node_modules should not exist
Then file at .atomist/tslint.json should exist
Then file at .atomist/build/cli.yml should exist
Then file at .atomist/build/cli.yml should contain staging
Then file at .atomist/build/cli.yml should contain release
Then there should not be deprecated CLI config files
Then file at .atomist/build/travis-build.bash should contain export TEAM_ID=
Then file at .atomist/build/travis-build.bash should contain local teams=
Then file at .gitattributes should contain .atomist.yml linguist-generated=true
Then file at CODE_OF_CONDUCT.md should exist
Then file at CONTRIBUTING.md should exist
Expand Down

0 comments on commit e4756fc

Please sign in to comment.