Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/daily-update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Update LicenseDB with latest updates from scancode-toolkit develop daily
on:
schedule:
- cron: '0 16 * * 0-6'
- cron: '0 16 * * 1-5'
workflow_dispatch:

jobs:
Expand All @@ -21,15 +21,13 @@ jobs:
with:
python-version: 3.8

- name: Give execute access to the script
run: chmod u+x ./etc/scripts/check_commit_run_update.sh

- name: Run script
run: ./etc/scripts/check_commit_run_update.sh

- name: Commit and Push to Publish
run: |
git config --global user.name 'LicenseDB Update GitHub Action'
git config --global user.email 'asmahapatra@nexb.com'
git commit -am "Automated LicenseDB update with latest from scancode-toolkit develop"
git add docs/* etc/*
git commit -m "Automated LicenseDB update with latest from scancode-toolkit develop"
git push
21 changes: 3 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,15 @@ conf:
@venv/bin/pip install -e ./scancode-toolkit/
@venv/bin/scancode-reindex-licenses

restore:
clean:
@echo "-> Restoring the repository to a clean state"
git clean -fd
rm -rf scancode-toolkit/
git restore --worktree docs/

clean:
# Remove the whole content of docs/ except for the CNAME file
# Remove the whole content of scancode-toolkit/
find docs/* ! -name 'CNAME' -exec git rm -r {} +
find scancode-toolkit/* -exec git rm -r {} +

html:
licensedb:
@echo "-> Generate the HTML content"
@venv/bin/scancode-license-data --path docs/
@echo "Available at docs/index.html"

build: conf html

publish:
@echo "-> Add changes to git"
@git add .
git commit -m "Upgrade with latest updates from ScanCode-toolkit develop"
@echo "-> Push changes to main repo"
@git push

.PHONY: conf clean html build publish
.PHONY: conf clean licensedb
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ Support
Build
-----

To re/generate the HTML and API content use this command::
To re/generate the HTML and API content run the following script::

$ make restore conf html
$ ./etc/scripts/check_commit_run_update.sh


License
Expand Down
4 changes: 2 additions & 2 deletions etc/scripts/check_commit_run_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# Clear the repository
make restore
make clean

# Create a virtualenv and clone scancode
make conf
Expand All @@ -19,7 +19,7 @@ cd ../
venv/bin/python ./etc/scripts/check_commit.py --commit "$COMMIT_LATEST"

# build docs
make html
make licensedb

# delete cloned scancode as only the doc updates should be commited
rm -rf scancode-toolkit/