The New Base 60 numbering system was designed for URL shortening with a limited easy to read character set.
The New Base 60 is ideal for creating archive based URLS
Based on a date-time stamp
- Date: year-month-day will convert to and from 3 chars
- Time: hours:minutes:seconds will convert to and from 3 chars
The newBase60 library provides function for handling dates and times to and from base60
Note: When using URL shorteners, you should also provide a canonical link element in your html documents if the document can be reached using the expanded archive URL
WIP TODO! ...
This repo contains some bash scripts, and uses common gnu utilities, included in most mac and nix based distros.
- docker: - to run fresh eXist instances
- git, grep, sed
- make: - to build and test
- prove: - to run tests
- curl: - to make http request to eXist
Thats about it, in fact the build and tests, occur in a simple stock travis (docker 'language c') setup.
├── .env
├── content
│ └── newBase60.xqm => build/content/newBase60.xqm => into archive xar
│ - the xQuery library named after this repo name
└── unit-tests
└── t-newBase60.xqm
Apart from these 2 files, we have a couple of 'easy to tinker with' boilerplate includes in the inc directory
├── .env
├── Makefile
├── inc
│ ├── expath-pkg.mk: => build/xpath-pkg.xml => into archive xar
│ └── repo.mk => build/xpath-pkg.xml => into archive xar
The above mentioned 4 file are the only source code files the remainder files are just scaffolding put in place to build the deployable archive xar
├── .env
├── docker-compose.yml
├── Makefile => run `make` calls bash scripts in bin
├── bin
│ ├── exStartUp => `make up`
│ ├── semVer
│ ├── xQcompile
│ ├── xQdeploy
NOTE:
If you haven't got the docker image it has to be downloaded first
This will happen auto magically when you call make up
TODO! ....
The container port is set in the .env file
├── .env
├── docker-compose.yml
├── Makefile => run `make test` calls `prove -v bin/xQtest`
├── bin
│ ├── xQtest
make
make test
make release
- set version to a bumped latest
git tag
- rebuild so version is based on this next version
- create tagged commit
- push to origin
- set version to a bumped latest
The build on Travis also uses the same Makefile to
- create and deploy into running eXist instance
- test the library
In addition, if the Travis sees a push tagged commit it will create a downloadable release asset ( the xar file ), which will be available as github release.
In the deploy section in the travis file, you can see the deploy trigger only occurs on master branch when a tagged commit to master occurs.
In the deploy section in the travis file, you can also see the secret key is secret api-key.
If all goes well, the build succeeds and the tests pass then a release asset in the form of xar file will be available on github.
When this downloadable xar file become available a webhook is is triggered. Github will post a request, containing the release details in the sent json body, to my designated endpoint URL.
My server receives the request. After authenticating the request, the sever install and deploy the library to my production eXist server.