Deprecate deploying to jordaneldredge.com

This commit is contained in:
Jordan Eldredge 2018-03-14 21:00:47 -07:00
parent 21b445b81d
commit ff36afedc3
5 changed files with 5 additions and 86 deletions

View file

@ -1,12 +0,0 @@
# JSMediaTags, which we use for parsing ID3 tags, requires some additional
# headers be enabled when accessing the media file from another origin. Since
# the media files, in our case, are served from a CDN, Amazon CloudFront, on
# a different domain, we are subject to the CORS restrictions.
#
# CloudFront is just a caching layer that sits in front of jordaneldredge.com,
# so we must serve these original files with the correct headers in order for
# CloudFront to return the correct headers.
#
# https://github.com/aadsm/jsmediatags#http-access-control-cors
Header add Access-Control-Allow-Headers "if-modified-since, range"
Header set Access-Control-Allow-Origin "*"

View file

@ -90,15 +90,9 @@ Open the local ip/port that is output to the console in your browser.
## Deploying
These commands assume you have an SSH key to my server, which you probably
don't have. Feel free to adapt them to your own server.
[Travis](https://travis-ci.org/) runs the build and then pushes the contents of `./built` to the `gh-pages` branch of this repository. GitHub Pages then serve that directory as <https://webamp.org>. CloudFlare sits in front of GitHub pages to provide the SSL certificate.
npm run deploy
### Reverting
npm run revert # Reverts quickly to the previous deploy
HASH=<SOME_GIT_HASH> npm run deploy # Runs a new deploy at a given hashlike.
In short, deploying should be as simple as pushing a commit to master which builds, lints and passes all tests.
### Advanced Usage
@ -156,9 +150,9 @@ Nullsoft, the code within this project is released under the [MIT
License](LICENSE.txt). That being said, if you do anything interesting with
this code, please let me know. I'd love to see it.
[TechCrunch]: https://techcrunch.com/2018/02/09/whip-the-llamas-ass-with-this-javascript-winamp-emulator/
[Motherboard]: https://motherboard.vice.com/en_us/article/qvebbv/winamp-2-mp3-music-player-emulator
[Gizmodo]: https://gizmodo.com/winamp-2-has-been-immortalized-in-html5-for-your-pleasu-1655373653
[techcrunch]: https://techcrunch.com/2018/02/09/whip-the-llamas-ass-with-this-javascript-winamp-emulator/
[motherboard]: https://motherboard.vice.com/en_us/article/qvebbv/winamp-2-mp3-music-player-emulator
[gizmodo]: https://gizmodo.com/winamp-2-has-been-immortalized-in-html5-for-your-pleasu-1655373653
[1]: https://news.ycombinator.com/item?id=8565665
[2]: https://news.ycombinator.com/item?id=15314629
[3]: https://news.ycombinator.com/item?id=16333550

View file

@ -13,8 +13,6 @@
"test": "jest --coverage",
"travis-tests": "jest --coverage && npm run lint && npm run build",
"tdd": "jest --watch",
"deploy": "ssh jordaneldredge.com HASH=$HASH sh < scripts/deploy.sh",
"revert": "ssh jordaneldredge.com sh < scripts/revert.sh",
"format": "prettier --write experiments/**/*.js js/**/*.js css/**/*.css webpack.config.js webpack.production.config.js",
"build-skin": "rm skins/base-2.91.wsz && cd skins/base-2.91 && zip -x .* -x 'Skining Updates.txt' -r ../base-2.91.wsz .",
"skin-info": "unzip -vl skins/base-2.91.wsz"

View file

@ -1,47 +0,0 @@
#!/usr/bin/env bash
# Bail on errors
set -e
cd /var/www/jordaneldredge.com/
# Generate a new directory to clone to
NEW_CLONE=repos/winamp2-js-`date +%s`
# Do the clone
echo "Cloning Winamp2-js..."
if [ -z "$HASH" ]; then
echo "Using master"
git clone --depth=1 git@github.com:captbaritone/winamp2-js.git $NEW_CLONE > /dev/null
else
git clone git@github.com:captbaritone/winamp2-js.git $NEW_CLONE > /dev/null
echo "Checking out hash $HASH"
( cd $NEW_CLONE && git checkout --quiet $HASH )
fi
echo "Installing Node requirements"
( cd $NEW_CLONE && yarn install )
echo "Run tests"
( cd $NEW_CLONE && yarn run test )
echo "Build the webpack bundle"
( cd $NEW_CLONE && CDN_URL=https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/ yarn run build )
echo "Cleaning up node_modules/ to save space"
( cd $NEW_CLONE && rm -r node_modules )
echo "Cleaning up coverage/ to save space"
( cd $NEW_CLONE && rm -r coverage )
PREVIOUS=$(readlink -f public_html/projects/winamp2-js)
echo "The previous build was: $PREVIOUS"
echo "Creating 'previous' link to enable reverts"
ln -snf $PREVIOUS repos/previous
echo "Linking new Winamp2-js into place"
ln -snf `pwd`/$NEW_CLONE/ public_html/projects/winamp2-js
echo "Done!"

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
# Bail on errors
set -e
echo "Reverting..."
cd /var/www/jordaneldredge.com/
PREVIOUS=$(readlink -f repos/previous)
echo "Rolling back to $PREVIOUS"
ln -snf $PREVIOUS public_html/projects/winamp2-js
echo "Done!"