Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated testing and deployment of the license list to license-list-data repo #592

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a278460
Test data only, please ignore
goneall Oct 30, 2016
472daa6
Merge remote-tracking branch 'upstream/master'
goneall Jan 19, 2017
4f530f8
Changing README back
goneall Jan 19, 2017
a74b9d7
Add deprecated license eCos-2.0
goneall Jan 19, 2017
53daa61
Merge remote-tracking branch 'upstream/master'
goneall Feb 1, 2017
1b9c0a6
Merge branch 'master' of https://github.com/goneall/license-list-XML
goneall Feb 2, 2017
dbd6300
Merge remote-tracking branch 'upstream/master'
goneall Feb 14, 2017
718234e
Merge branch 'master' of https://github.com/spdx/license-list-XML
goneall Dec 4, 2017
2aeee5d
Add travis-CI build files
goneall Dec 14, 2017
3425d5b
Fix parse error in travis config file
goneall Dec 14, 2017
e2e70a7
Make shell script executable
goneall Dec 14, 2017
e1a070b
Update the continuous testing to test license XML files against the o…
goneall Dec 15, 2017
afe8b2c
Add new test case for added license
goneall Dec 16, 2017
31d12f9
Add CLDA-Sharing-1.0 to tests
goneall Dec 18, 2017
3bc8691
Merge upstream changes
goneall Dec 18, 2017
7e50369
Add both the node and java based tests to Travis
goneall Dec 18, 2017
57047e2
Fix bad spacing in travis file
goneall Dec 18, 2017
0b583c9
Add test files for BSD-1-Clause and EPL-2.0
goneall Dec 21, 2017
13172d0
Fix issues identified in license list XML PR #513
goneall Dec 27, 2017
278cc3a
Merge branch 'master' of https://github.com/spdx/license-list-XML
goneall Dec 27, 2017
e10d699
Add license tests for the new licenses added
goneall Dec 28, 2017
28666b0
Merge branch 'master' of https://github.com/spdx/license-list-XML
goneall Dec 28, 2017
1857ff6
Add missing copyright to test file
goneall Dec 29, 2017
9ed696b
Update travis for license publishing
goneall Dec 30, 2017
a8c3cd0
Merge upstream travis file
goneall Dec 30, 2017
5bf6f59
Add license publishing functionality to Travis-CI
goneall Jan 1, 2018
3343c57
Add proper location of the publish license list script
goneall Jan 1, 2018
8dbd6ba
Update file permissions
goneall Jan 1, 2018
8d90e69
Remove unused script
goneall Jan 1, 2018
51c4de4
Add test only for pull requests - don't publish unless it is a merge …
goneall Jan 1, 2018
48c1976
Test the pull requests only test the license list and do not push
goneall Jan 1, 2018
98f484a
Debugging PR pushing to repo
goneall Jan 1, 2018
c7f65cd
Check for branch and only update license list data if coming from the…
goneall Jan 2, 2018
e8fd82d
Fix missing dot in file name
goneall Jan 2, 2018
1b8f716
Add output directory for test files
goneall Jan 2, 2018
c933364
Merge pull request #1 from goneall/testpr
goneall Jan 2, 2018
be6c60c
Merge branch 'master' of https://github.com/spdx/license-list-XML
goneall Jan 2, 2018
7dca80b
Merge branch 'master' of https://github.com/goneall/license-list-XML
goneall Jan 2, 2018
595cdc8
Address review comments for pull request
goneall Jan 2, 2018
2c1c392
Add changes per @wking pull request to goneall/license-test-files PR #1
goneall Jan 2, 2018
b5ebc6a
Add execution permission to testPublish script
goneall Jan 2, 2018
8d3d39b
Add execution permission to testBuild script
goneall Jan 2, 2018
c1a1dd9
Reverting BitTorrent-1.0 test file to commit 7c61df0f9. The test fil…
goneall Jan 3, 2018
d83fe80
Add checksum validation to tools jar download
goneall Jan 3, 2018
a57d829
Comment out tagging releases for the license list publishing
goneall Jan 3, 2018
10d9a73
Remove section g to match cononical license text
goneall Jan 16, 2018
cc92a1c
Add missing quote to the Apache 1.0 license
goneall Jan 16, 2018
94faa5c
Merge remote-tracking branch 'upstream/master'
goneall Jan 16, 2018
a4dc1f1
Update to version 2.1.9 of the SPDX tools and set the switch to use l…
goneall Jan 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.DS_Store
# Ignore all hidden files/dirs except .gitignore and .travis.yml
# Ignore all hidden files/dirs except .gitignore, .travis and .travis.yml
.*
!/.gitignore
!/.travis.yml
!/.travis

# nodeJS
node_modules/
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
language: node_js
node_js:
- "node"
matrix:
include:
- language: java
before_install:
- wget https://dl.bintray.com/spdx/spdx-tools/org/spdx/spdx-tools/2.1.9/spdx-tools-2.1.9-jar-with-dependencies.jar
- echo '1f39ef01ab1bf0cc587f4c745f3857cab9f0a17465361f15ecc5ad48e0648d63 spdx-tools-2.1.9-jar-with-dependencies.jar' | sha256sum --check
script:
- 'if [[ "$TRAVIS_PULL_REQUEST" = "false" && "master" = "$TRAVIS_BRANCH" ]]; then ./.travis/testPublishLicenseList.sh; else ./.travis/testBuildLicenseList.sh; fi'
- language: node_js
node_js:
- "node"
20 changes: 20 additions & 0 deletions .travis/testBuildLicenseList.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
TOOLSJAR=spdx-tools-2.1.9-jar-with-dependencies.jar
LICENSE_XML_DIR=./
TEST_DIR=./test/original
LICENSE_OUTPUT_DIR=.OUTPUTFILES
VERSION=$(git describe)
if [[ $? != 0 ]]; then VERSION="UNKNOWN"; fi
RELEASE_DATE=$(date -I)
mkdir $LICENSE_OUTPUT_DIR
# Create a file to skip expected warnings
IGNORE_WARNINGS="\"Duplicates licenses: AGPL-3.0-or-later, AGPL-3.0-only\",\"Duplicates licenses: GFDL-1.1-or-later, GFDL-1.1-only\",\"Duplicates licenses: GFDL-1.2-or-later, GFDL-1.2-only\",\"Duplicates licenses: GFDL-1.3-or-later, GFDL-1.3-only\",\"Duplicates licenses: GPL-1.0-or-later, GPL-1.0-only\",\"Duplicates licenses: GPL-2.0-or-later, GPL-2.0-only\",\"Duplicates licenses: GPL-3.0-or-later, GPL-3.0-only\",\"Duplicates licenses: LGPL-2.0-or-later, LGPL-2.0-only\",\"Duplicates licenses: LGPL-2.1-or-later, LGPL-2.1-only\",\"Duplicates licenses: LGPL-3.0-or-later, LGPL-3.0-only\",\"Duplicates licenses: MPL-2.0, MPL-2.0-no-copyleft-exception\""
WARNINGS_FILE="TEMP-WARNINGS"
echo $IGNORE_WARNINGS > $WARNINGS_FILE
# Test and generate the output files
PUBLISH_CMD="LicenseRDFAGenerator $LICENSE_XML_DIR $LICENSE_OUTPUT_DIR $VERSION $RELEASE_DATE $TEST_DIR $WARNINGS_FILE"
echo running SPDX Tool command $PUBLISH_CMD
java -jar -DLocalFsfFreeJson=true $TOOLSJAR $PUBLISH_CMD
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
rm $WARNINGS_FILE
echo License list has been validated.
60 changes: 60 additions & 0 deletions .travis/testPublishLicenseList.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
# NOTE: $GITHUB_TOKEN must be defined as an external system variable (e.g. in the Travis-CI respository settings https://docs.travis-ci.com/user/environment-variables#Defining-Variables-in-Repository-Settings)
#TODO Update user and email before PR to spdx/license-list-XML
GIT_USERNAME="License Publisher (maintained by Gary O'Neall)"
GIT_EMAIL="gary@sourceauditor.com"
LICENSE_DATA_REPO="https://github.com/goneall/license-list-data.git"
LICENSE_DATA_REPO_NO_SCHEME="${LICENSE_DATA_REPO#*://}"
LICENSE_DATA_URL="https://${GITHUB_TOKEN}@${LICENSE_DATA_REPO_NO_SCHEME}"
TOOLSJAR=spdx-tools-2.1.9-jar-with-dependencies.jar
LICENSE_XML_DIR=./
TEST_DIR=./test/original
LICENSE_OUTPUT_DIR=.OUTPUTFILES
VERSION=$(git describe --always || echo 'UNKNOWN')
RELEASE_DATE=$(date -I)
# Clone the release
echo Cloning license list data repository, this could take a while...
git clone $LICENSE_DATA_URL $LICENSE_OUTPUT_DIR --quiet --depth 1
# Clean out the old data directories
rm -r $LICENSE_OUTPUT_DIR/html
rm -r $LICENSE_OUTPUT_DIR/json
rm -r $LICENSE_OUTPUT_DIR/rdfa
rm -r $LICENSE_OUTPUT_DIR/rdfnt
rm -r $LICENSE_OUTPUT_DIR/rdfturtle
rm -r $LICENSE_OUTPUT_DIR/rdfxml
rm -r $LICENSE_OUTPUT_DIR/template
rm -r $LICENSE_OUTPUT_DIR/text
rm -r $LICENSE_OUTPUT_DIR/website
rm $LICENSE_OUTPUT_DIR/licenses.md
# Create a file to skip expected warnings
IGNORE_WARNINGS="\"Duplicates licenses: AGPL-3.0-or-later, AGPL-3.0-only\",\"Duplicates licenses: GFDL-1.1-or-later, GFDL-1.1-only\",\"Duplicates licenses: GFDL-1.2-or-later, GFDL-1.2-only\",\"Duplicates licenses: GFDL-1.3-or-later, GFDL-1.3-only\",\"Duplicates licenses: GPL-1.0-or-later, GPL-1.0-only\",\"Duplicates licenses: GPL-2.0-or-later, GPL-2.0-only\",\"Duplicates licenses: GPL-3.0-or-later, GPL-3.0-only\",\"Duplicates licenses: LGPL-2.0-or-later, LGPL-2.0-only\",\"Duplicates licenses: LGPL-2.1-or-later, LGPL-2.1-only\",\"Duplicates licenses: LGPL-3.0-or-later, LGPL-3.0-only\",\"Duplicates licenses: MPL-2.0, MPL-2.0-no-copyleft-exception\""
WARNING_SFILE="TEMP-WARNINGS"
echo $IGNORE_WARNINGS > $WARNING_SFILE
# Test and generate the output files
PUBLISH_CMD="LicenseRDFAGenerator $LICENSE_XML_DIR $LICENSE_OUTPUT_DIR $VERSION $RELEASE_DATE $TEST_DIR $WARNING_SFILE"
echo running SPDX Tool command $PUBLISH_CMD
java -jar -DLocalFsfFreeJson=true $TOOLSJAR $PUBLISH_CMD
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
rm $WARNING_SFILE
cd $LICENSE_OUTPUT_DIR
# Configure git
git config user.email "$GIT_EMAIL"
git config user.name "$GIT_USERNAME"
# Commit and push the changes back to the license data repository
# Create the push URL including the authentication token
git add -A
COMMIT_MSG="Automatic update of license list data from license XML repository version $VERSION"
git commit -m "$COMMIT_MSG"
# Check to see if we should add a tag
#if [[ $VERSION =~ .+-g[a-f0-9]{7} ]]
#then
# Just push without adding a tag
echo Pushing updates to the license list data repository. This could take a while...
git push origin --quiet
#else
# Add a tag and push with the tags
# git tag -a $VERSION -m "Adding release mathing the license list XML tag $VERSION"
# echo Pushing new version to the license list data repository. This could take a while...
# git push origin --tags --quiet
#fi
exit 0
Loading