File tree 3 files changed +87
-3
lines changed
3 files changed +87
-3
lines changed Original file line number Diff line number Diff line change
1
+ language : scala
2
+
3
+ jdk : oraclejdk8
4
+
5
+ env :
6
+ global :
7
+ # GITHUB_OAUTH_TOKEN (for GitHub user scala-jenkins, same token as scabot)
8
+ secure : " ErMvEJv2oDyQqclA0IM78thPkZG+0kjBSIKbDtI/PIoaoxMKi+gtsYH92/JFU26oNfDwgqh3B0QwU2niyK3TO0P0xjmrYsvlMXjDwgHX/w+hw7GuIXUp4r8/V1nyNF+9OGlHtNbtbDtFilThI2osS+/G304cNsE4GVa9LRxhzpQ="
9
+
10
+ script :
11
+ - source scripts/common
12
+ - if [[ "$scala_sha" != "" ]]; then postCommitStatus "pending"; fi
13
+ - scripts/jobs/release/smoketest
14
+
15
+ after_script :
16
+ - |
17
+ if [[ "$scala_sha" != "" ]]; then
18
+ if [[ "$TRAVIS_TEST_RESULT" == "0" ]]; then
19
+ local state="success"
20
+ else
21
+ local state="failure"
22
+ fi
23
+ postCommitStatus $state
24
+ fi
25
+
26
+ cache :
27
+ directories :
28
+ - $HOME/.ivy2/cache
29
+ - $HOME/.sbt
30
+ before_cache :
31
+ - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
32
+ - find $HOME/.sbt -name "*.lock" -print -delete
Original file line number Diff line number Diff line change
1
+ # https://github.com/travis-ci/docs-travis-ci-com/issues/949
2
+ function travis_fold_start() {
3
+ echo ""
4
+ echo -e "travis_fold:start:$1\033[33;1m$2\033[0m"
5
+ }
6
+
7
+ function travis_fold_end() {
8
+ echo -e "\ntravis_fold:end:$1\r"
9
+ echo ""
10
+ }
11
+
12
+ # Params:
13
+ # - state: pending / success / failed / error
14
+ function postCommitStatus() {
15
+ local jsonTemplate='{ "state": "%s", "target_url": "%s", "description": "%s", "context": "%s"}'
16
+ local json=$(printf "$jsonTemplate" "$1" "https://travis-ci.org/scala/scala-dist-smoketest/builds/$TRAVIS_BUILD_ID" "$1" "travis/scala-dist-smoketest/$version")
17
+
18
+ local curlStatus=$(curl \
19
+ -s -o /dev/null -w "%{http_code}" \
20
+ -H "Accept: application/vnd.github.v3+json" \
21
+ -H "Authorization: token $GITHUB_OAUTH_TOKEN" \
22
+ -d "$json" \
23
+ https://api.github.com/repos/scala/scala/statuses/$scala_sha)
24
+
25
+ [[ "$curlStatus" == "201" ]] || {
26
+ echo "Failed to publish GitHub commit status"
27
+ exit 1
28
+ }
29
+ }
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -ex
2
2
3
- # This script requires sbtDistVersionOverride=-Dproject.version=...
3
+ function ensureVersion() {
4
+ local verPat=" [0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
5
+ [[ " $version " =~ $verPat ]] || {
6
+ echo " Not a valid Scala version: '$version '"
7
+ exit 1
8
+ }
9
+ }
10
+
11
+ clearIvyCache () {
12
+ rm -fv $HOME /.ivy2/exclude_classifiers $HOME /.ivy2/exclude_classifiers.lock
13
+ rm -rfv $HOME /.ivy2/cache/org.scala-lang $HOME /.ivy2/cache/org.scala-lang.modules
14
+ rm -rfv $HOME /.ivy2/local/org.scala-lang $HOME /.ivy2/local/org.scala-lang.modules
15
+ if [ -d $HOME /.ivy2 ]; then find $HOME /.ivy2 -name " *compiler-interface*$version *" | xargs rm -rfv; fi
16
+ if [ -d $HOME /.sbt ]; then find $HOME /.sbt -name " *compiler-interface*$version *" | xargs rm -rfv; fi
17
+ }
18
+
19
+ if [[ " $TRAVIS_EVENT_TYPE " == " api" ]]; then
20
+ ensureVersion
21
+ else
22
+ # Use some recent version to validate changes in smoketest itself
23
+ version=" 2.12.4"
24
+ fi
25
+
26
+ clearIvyCache
4
27
5
- rm -rf $WORKSPACE /ivy2
28
+ sbtDistVersionOverride= " -Dproject.version= $version "
6
29
7
30
integrationRepoUrl=${integrationRepoUrl-" https://scala-ci.typesafe.com/artifactory/scala-integration/" }
8
31
9
- sbt -Dsbt.log.noformat=true -Dsbt.ivy.home= $WORKSPACE /ivy2 \
32
+ sbt -Dsbt.log.noformat=true \
10
33
" set resolvers += \" scala-integration\" at \" $integrationRepoUrl \" " \
11
34
$sbtDistVersionOverride \
12
35
clean run
You can’t perform that action at this time.
0 commit comments