diff --git a/.htaccess b/.htaccess deleted file mode 100644 index 2b290bf3..00000000 --- a/.htaccess +++ /dev/null @@ -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 "*" diff --git a/README.md b/README.md index 40ed37b4..b599f6f0 100755 --- a/README.md +++ b/README.md @@ -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 . 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= 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 diff --git a/package.json b/package.json index 9bc5c859..d5d61503 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100755 index f1e239b2..00000000 --- a/scripts/deploy.sh +++ /dev/null @@ -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!" diff --git a/scripts/revert.sh b/scripts/revert.sh deleted file mode 100755 index 11462b27..00000000 --- a/scripts/revert.sh +++ /dev/null @@ -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!"