Skip to content

Commit 882221b

Browse files
author
David Collins
committed
Travis CI adjustments for new continuous integration
- Removed daily builds, which are scheduled to be replaced by Maven SNAPSHOT artifacts - Removed Javadoc publication to the World Wind website, which is now handled independently by the website itself - Modularized the change log script for interoperability with other World Wind repositories - Simplified Travis CI deployment tasks to reduce redundancy
1 parent 3938883 commit 882221b

File tree

5 files changed

+59
-326
lines changed

5 files changed

+59
-326
lines changed

.travis.yml

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,40 @@ sudo: required
88
# Set up to run the Java build script per the Travis CI documentation
99
language: java
1010

11+
# Configure the build to use Oracle JDK 8
1112
jdk:
12-
# Configure the build to use Oracle JDK 8
1313
- oraclejdk8
1414

15-
before_install:
16-
# Decrypt and un-archive the files wwstore and keystore.properties which are used to sign the Web Start distribution
17-
- openssl aes-256-cbc -K $encrypted_1799be77f389_key -iv $encrypted_1799be77f389_iv -in keystore.tar.enc -out keystore.tar -d
18-
- tar -xf keystore.tar
19-
# Install Apache ANT v1.9.7 in order to get the most ANT junit features required by the World Wind build script. As of
20-
# December 2016 the Travis CI environment provided ANT v1.8.x.
21-
- curl -o ${HOME}/apache-ant-1.9.7-bin.tar.gz https://mirrors.ocf.berkeley.edu/apache/ant/binaries/apache-ant-1.9.8-bin.tar.gz
22-
- tar -xf ${HOME}/apache-ant-1.9.7-bin.tar.gz -C ${HOME}
23-
- export PATH=${HOME}/apache-ant-1.9.7/bin:${PATH}
24-
2515
before_script:
26-
# Install the jq shell filter so we can extract data from GitHub API JSON results
27-
# See apt configuration: https://docs.travis-ci.com/user/ci-environment/#apt-configuration
28-
- sudo apt-get install -qq jq
29-
- jq --version
30-
# Ensure scripts can be executed (required if scripts are authored in Windows)
31-
- chmod +x ./travis/*.sh
16+
# Decrypt the keystore used to sign the Web Start distribution
17+
- 'if [[ -n "${$encrypted_1799be77f389_key}" ]]; then openssl aes-256-cbc -K "${$encrypted_1799be77f389_key}" -iv "${$encrypted_1799be77f389_iv}" -in keystore.tar.enc -out keystore.tar -d && tar -xf keystore.tar; fi'
3218
# Use xvfb to run tests that require a GUI
3319
- "export DISPLAY=:99.0"
3420
- "sh -e /etc/init.d/xvfb start"
3521
- sleep 3 # give xvfb some time to start
3622

23+
# Build the project
3724
script:
38-
# Build the project
3925
- ant build
4026

41-
after_success:
42-
# Push the daily tag when this build is a cron job
43-
- ./travis/add_daily_tag.sh
44-
# Push build artifacts to GitHub releases, push documentation and Web Start distribution to GitHub pages
45-
- ./travis/update_release.sh
46-
- ./travis/update_website.sh
47-
27+
# Deploy build artifacts. Travis does not invoke this step for pull request builds
28+
deploy:
29+
# Create CHANGELOG.md in the current directory
30+
- provider: script
31+
script: 'source ./travis/changelog.sh && changelog "${TRAVIS_TAG}" "https://api.github.com/repos/${TRAVIS_REPO_SLUG}" >> CHANGELOG.md'
32+
skip_cleanup: true
33+
on:
34+
tags: true
35+
# Create a GitHub release and publish CHANGELOG.md to the release assets
36+
- provider: releases
37+
api_key: $GITHUB_API_KEY
38+
file: CHANGELOG.md
39+
skip_cleanup: true
40+
on:
41+
tags: true
42+
43+
# Notify the World Wind services mailing list on every build
4844
notifications:
49-
# Notify the World Wind services mailing list on every build
5045
email:
5146
recipients:
5247
secure: OM6MdC79yU5Q7DCaYeABrRf2feKRvJ8UsYzs9YtmMdiwR2a2Aw6yPUunp8EtGD2/SzI/kJibeL6SMrbgI9LZRDnSM6PtpxzC023ogw02WfYegCUc10j5cN6GLzdV81ZTu8FxKvfyQMAEqsgCibHPRyBTk98NbwKHzsvxZm+wjK1hNEP76J05dBn5MjOMdTPtXsy0zS/iyPq76Y8BN/+jsPn5jUY3rTeOvmt5aCW6rXyjBeoJvsyjhuxacTnGUif334LE5yzVSKv4Nmy8UQRhKTDn/BuFikaMtEi4xKpgoQyc7A6wNG0QlxsYY9yRk6dl952q4PHz3xoXJ8LApb8ymbMxXHceOdipecwAWTmlfZPv6EMOrjITPpygtVZjz23QZm07/HMEiE/4NpIE4/ie0kiIPH59qEpKfNQ72iyWS5Zg4FD+l8ofqpGUWLlBaLzGEl6XgXH6oiFm//+wfSI9OWCZKDEYK6P24X0Ncv1Gi2zY2wVZsajqesXiWRCBEEFmjVQ1iNLX7AYsZQMd3ah8++2o3/Ti5eDagPsAVWpR8ULHFNk2+R6H7OQ6acHYVWnbzYuvIkzXYMNVvQ6PZRUvbJNdfwBw15V+s1D0PvPs1Nbc/Jq7RgWMEMUnqWNxFRXEhhbjmV/i2keSA1QPBxADSUAIkZNNkzCD+3KL/rRFDug=

travis/add_daily_tag.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

travis/changelog.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Writes a change log to stdout using the GitHub API and the milestone associated with the specified Git tag
4+
function changelog() {
5+
6+
# Give function arguments meaningful names
7+
GIT_TAG="$1"
8+
GITHUB_API_URL="$2"
9+
10+
# Write Markdown headers for the Git tag and release date
11+
echo "##${GIT_TAG}"
12+
echo "######Released on $(date '+%Y-%m-%d')"
13+
14+
# Query GitHub API for a milestone matching the Git tag
15+
MILESTONE_ARRAY=( \
16+
$(curl --silent "${GITHUB_API_URL}/milestones?state=all" \
17+
| jq --arg title "${GIT_TAG}" '.[] | select(.title == $title) | .number') \
18+
) > /dev/null
19+
20+
# When GitHub has a milestone matching the Git tag, write milestone related information to the change log
21+
if [[ "${#MILESTONE_ARRAY[@]}" -ne 0 ]]; then
22+
# Write the milestone description to the change log
23+
MILESTONE_DESCRIPTION=( \
24+
$(curl --silent "${GITHUB_API_URL}/milestones/${MILESTONE_ARRAY[0]}" \
25+
| jq .description) \
26+
) > /dev/null
27+
MILESTONE_DESCRIPTION=${MILESTONE_DESCRIPTION[*]#\"}
28+
echo ${MILESTONE_DESCRIPTION[*]%\"}
29+
30+
# Write the milestone's associated issues to the change log with each issue on a separate line with the issue
31+
# title, issue number, and a link to the issue on GitHub.com, all in markdown format: .title ([#.number](.html_url))
32+
ISSUE_ARRAY=$(curl --silent "${GITHUB_API_URL}/issues?state=all&milestone=${MILESTONE_ARRAY[0]}" | jq -c '.[] | [.title, .number, .html_url]') >> /dev/null
33+
while read line
34+
do
35+
echo ${line} | sed 's#\["\(.*\)",\(.*\),"\(.*\)"\]#- \1 ([\#\2](\3))#'
36+
done <<< "${ISSUE_ARRAY[*]}"
37+
fi
38+
}

travis/update_release.sh

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)