diff --git a/scripts/upload.sh b/scripts/upload.sh deleted file mode 100755 index 284724bab..000000000 --- a/scripts/upload.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Get the parent directory of where this script is. -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" - -# Change into that dir because we expect that -cd $DIR - -# Get the version from the command line -VERSION=$1 -if [ -z $VERSION ]; then - echo "Please specify a version." - exit 1 -fi - -# Make sure we have a bintray API key -if [ -z $BINTRAY_API_KEY ]; then - echo "Please set your bintray API key in the BINTRAY_API_KEY env var." - exit 1 -fi - -for ARCHIVE in ./pkg/dist/*; do - ARCHIVE_NAME=$(basename ${ARCHIVE}) - - echo Uploading: $ARCHIVE_NAME - curl \ - -T ${ARCHIVE} \ - -umitchellh:${BINTRAY_API_KEY} \ - "https://api.bintray.com/content/mitchellh/packer/packer/${VERSION}/${ARCHIVE_NAME}" -done diff --git a/scripts/website_push.sh b/scripts/website_push.sh deleted file mode 100755 index a51c9c9b1..000000000 --- a/scripts/website_push.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# Set the tmpdir -if [ -z "$TMPDIR" ]; then - TMPDIR="/tmp" -fi - -# Create a temporary build dir and make sure we clean it up. For -# debugging, comment out the trap line. -DEPLOY=`mktemp -d $TMPDIR/packer-www-XXXXXX` -trap "rm -rf $DEPLOY" INT TERM EXIT - -# Get the parent directory of where this script is. -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" - -# Copy into tmpdir -shopt -s dotglob -cp -r $DIR/website/* $DEPLOY/ - -# Change into that directory -pushd $DEPLOY &>/dev/null - -# Ignore some stuff -touch .gitignore -echo ".sass-cache" >> .gitignore -echo "build" >> .gitignore -echo "vendor" >> .gitignore - -# Add everything -git init -q . -git add . -git commit -q -m "Deploy by $USER" - -git remote add heroku git@heroku.com:packer-www.git -git push -f heroku master - -# Go back to our root -popd &>/dev/null diff --git a/website/.buildpacks b/website/.buildpacks deleted file mode 100644 index f85b304c3..000000000 --- a/website/.buildpacks +++ /dev/null @@ -1,2 +0,0 @@ -https://github.com/heroku/heroku-buildpack-ruby.git -https://github.com/hashicorp/heroku-buildpack-middleman.git diff --git a/website/.ruby-version b/website/.ruby-version deleted file mode 100644 index b1b25a5ff..000000000 --- a/website/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.2.2 diff --git a/website/Gemfile b/website/Gemfile index 14f80e508..467f1ba4e 100644 --- a/website/Gemfile +++ b/website/Gemfile @@ -1,7 +1,5 @@ source "https://rubygems.org" -ruby "2.2.2" - gem "middleman-hashicorp", github: "hashicorp/middleman-hashicorp" gem "middleman-breadcrumbs" -gem "htmlbeautifier" \ No newline at end of file +gem "htmlbeautifier" diff --git a/website/Gemfile.lock b/website/Gemfile.lock index 450e67853..69d09b5b9 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/hashicorp/middleman-hashicorp.git - revision: 15cbda0cf1d963fa71292dee921229e7ee618272 + revision: 953baf8762b915cf57553bcc82bc946ad777056f specs: middleman-hashicorp (0.2.0) bootstrap-sass (~> 3.3) @@ -21,18 +21,18 @@ GIT GEM remote: https://rubygems.org/ specs: - activesupport (4.2.4) + activesupport (4.2.5) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - autoprefixer-rails (6.0.3) + autoprefixer-rails (6.2.3) execjs json - bootstrap-sass (3.3.5.1) - autoprefixer-rails (>= 5.0.0.1) - sass (>= 3.3.0) + bootstrap-sass (3.3.6) + autoprefixer-rails (>= 5.2.1) + sass (>= 3.3.4) builder (3.2.2) capybara (2.4.4) mime-types (>= 1.16) @@ -40,11 +40,11 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - chunky_png (1.3.4) + chunky_png (1.3.5) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.9.1.1) + coffee-script-source (1.10.0) commonjs (0.2.7) compass (1.0.3) chunky_png (~> 1.2) @@ -63,7 +63,7 @@ GEM eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) erubis (2.7.0) - eventmachine (1.0.8) + eventmachine (1.0.9) execjs (2.6.0) ffi (1.9.10) git-version-bump (0.15.1) @@ -81,23 +81,23 @@ GEM less (2.6.0) commonjs (~> 0.2.7) libv8 (3.16.14.13) - listen (3.0.3) + listen (3.0.5) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) - middleman (3.4.0) + middleman (3.4.1) coffee-script (~> 2.2) compass (>= 1.0.0, < 2.0.0) compass-import-once (= 1.0.5) execjs (~> 2.0) haml (>= 4.0.5) kramdown (~> 1.2) - middleman-core (= 3.4.0) + middleman-core (= 3.4.1) middleman-sprockets (>= 3.1.2) sass (>= 3.4.0, < 4.0) uglifier (~> 2.5) middleman-breadcrumbs (0.2.0) middleman (>= 3.3.5) - middleman-core (3.4.0) + middleman-core (3.4.1) activesupport (~> 4.1) bundler (~> 1.1) capybara (~> 2.4.4) @@ -109,7 +109,7 @@ GEM rack (>= 1.4.5, < 2.0) thor (>= 0.15.2, < 2.0) tilt (~> 1.4.1, < 2.0) - middleman-livereload (3.4.3) + middleman-livereload (3.4.6) em-websocket (~> 0.5.1) middleman-core (>= 3.3) rack-livereload (~> 0.3.15) @@ -121,15 +121,17 @@ GEM sprockets (~> 2.12.1) sprockets-helpers (~> 1.1.0) sprockets-sass (~> 1.3.0) - middleman-syntax (2.0.0) - middleman-core (~> 3.2) + middleman-syntax (2.1.0) + middleman-core (>= 3.2) rouge (~> 1.0) - mime-types (2.6.2) - mini_portile (0.6.2) - minitest (5.8.1) + mime-types (3.0) + mime-types-data (~> 3.2015) + mime-types-data (3.2015.1120) + mini_portile2 (2.0.0) + minitest (5.8.3) multi_json (1.11.2) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) + nokogiri (1.6.7.1) + mini_portile2 (~> 2.0.0.rc2) padrino-helpers (0.12.5) i18n (~> 0.6, >= 0.6.7) padrino-support (= 0.12.5) @@ -148,13 +150,13 @@ GEM rack-ssl-enforcer (0.2.9) rack-test (0.6.3) rack (>= 1.0) - rb-fsevent (0.9.6) + rb-fsevent (0.9.7) rb-inotify (0.9.5) ffi (>= 0.5.0) - redcarpet (3.3.3) + redcarpet (3.3.4) ref (2.0.0) rouge (1.10.1) - sass (3.4.19) + sass (3.4.21) sprockets (2.12.4) hike (~> 1.2) multi_json (~> 1.0) diff --git a/website/Procfile b/website/Procfile deleted file mode 100644 index 58361e473..000000000 --- a/website/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: bundle exec thin start -p $PORT diff --git a/website/packer.json b/website/packer.json new file mode 100644 index 000000000..b230c7e51 --- /dev/null +++ b/website/packer.json @@ -0,0 +1,41 @@ +{ + "variables": { + "aws_access_key_id": "{{ env `AWS_ACCESS_KEY_ID` }}", + "aws_secret_access_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}", + "aws_region": "{{ env `AWS_REGION` }}", + "fastly_api_key": "{{ env `FASTLY_API_KEY` }}" + }, + "builders": [ + { + "type": "docker", + "image": "ruby:2.3-slim", + "commit": "true" + } + ], + "provisioners": [ + { + "type": "file", + "source": ".", + "destination": "/app" + }, + { + "type": "shell", + "environment_vars": [ + "AWS_ACCESS_KEY_ID={{ user `aws_access_key_id` }}", + "AWS_SECRET_ACCESS_KEY={{ user `aws_secret_access_key` }}", + "AWS_REGION={{ user `aws_region` }}", + "FASTLY_API_KEY={{ user `fastly_api_key` }}" + ], + "inline": [ + "apt-get update", + "apt-get install -y build-essential curl git libffi-dev s3cmd wget", + "cd /app", + + "bundle check || bundle install --jobs 7", + "bundle exec middleman build", + + "/bin/bash ./scripts/deploy.sh" + ] + } + ] +} diff --git a/website/scripts/deploy.sh b/website/scripts/deploy.sh new file mode 100755 index 000000000..8f94d43fc --- /dev/null +++ b/website/scripts/deploy.sh @@ -0,0 +1,88 @@ +#!/bin/bash +set -e + +PROJECT="packer" +PROJECT_URL="www.packer.io" +FASTLY_SERVICE_ID="7GrxRJP3PVBuqQbyxYQ0MV" + +# Ensure the proper AWS environment variables are set +if [ -z "$AWS_ACCESS_KEY_ID" ]; then + echo "Missing AWS_ACCESS_KEY_ID!" + exit 1 +fi + +if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then + echo "Missing AWS_SECRET_ACCESS_KEY!" + exit 1 +fi + +# Ensure the proper Fastly keys are set +if [ -z "$FASTLY_API_KEY" ]; then + echo "Missing FASTLY_API_KEY!" + exit 1 +fi + +# Ensure we have s3cmd installed +if ! command -v "s3cmd" >/dev/null 2>&1; then + echo "Missing s3cmd!" + exit 1 +fi + +# Get the parent directory of where this script is and change into our website +# directory +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$(cd -P "$( dirname "$SOURCE" )/.." && pwd)" + +# Delete any .DS_Store files for our OS X friends. +find "$DIR" -type f -name '.DS_Store' -delete + +# Upload the files to S3 - we disable mime-type detection by the python library +# and just guess from the file extension because it's surprisingly more +# accurate, especially for CSS and javascript. We also tag the uploaded files +# with the proper Surrogate-Key, which we will later purge in our API call to +# Fastly. +if [ -z "$NO_UPLOAD" ]; then + echo "Uploading to S3..." + + # Check that the site has been built + if [ ! -d "$DIR/build" ]; then + echo "Missing compiled website! Run 'make build' to compile!" + exit 1 + fi + + s3cmd \ + --quiet \ + --delete-removed \ + --guess-mime-type \ + --no-mime-magic \ + --acl-public \ + --recursive \ + --add-header="Cache-Control: max-age=31536000" \ + --add-header="x-amz-meta-surrogate-key: site-$PROJECT" \ + sync "$DIR/build/" "s3://hc-sites/$PROJECT/latest/" +fi + +# Perform a soft-purge of the surrogate key. +if [ -z "$NO_PURGE" ]; then + echo "Purging Fastly cache..." + curl \ + --fail \ + --silent \ + --output /dev/null \ + --request "POST" \ + --header "Accept: application/json" \ + --header "Fastly-Key: $FASTLY_API_KEY" \ + --header "Fastly-Soft-Purge: 1" \ + "https://api.fastly.com/service/$FASTLY_SERVICE_ID/purge/site-$PROJECT" +fi + +# Warm the cache with recursive wget. +if [ -z "$NO_WARM" ]; then + echo "Warming Fastly cache..." + wget \ + --recursive \ + --delete-after \ + --quiet \ + "https://$PROJECT_URL/" +fi diff --git a/website/source/assets/images/arrow-left.png b/website/source/assets/images/arrow-left.png index ad35bbf10..6d9e7b799 100644 Binary files a/website/source/assets/images/arrow-left.png and b/website/source/assets/images/arrow-left.png differ diff --git a/website/source/assets/images/arrow-right.png b/website/source/assets/images/arrow-right.png index df2a87470..124185855 100644 Binary files a/website/source/assets/images/arrow-right.png and b/website/source/assets/images/arrow-right.png differ diff --git a/website/source/assets/images/divider.png b/website/source/assets/images/divider.png index ed3f713bd..cd173195f 100644 Binary files a/website/source/assets/images/divider.png and b/website/source/assets/images/divider.png differ diff --git a/website/source/assets/images/docs/atlas-workflow.png b/website/source/assets/images/docs/atlas-workflow.png index e519ee004..aead95f46 100644 Binary files a/website/source/assets/images/docs/atlas-workflow.png and b/website/source/assets/images/docs/atlas-workflow.png differ diff --git a/website/source/assets/images/down_arrow.png b/website/source/assets/images/down_arrow.png index 8f986c926..6c13350ad 100644 Binary files a/website/source/assets/images/down_arrow.png and b/website/source/assets/images/down_arrow.png differ diff --git a/website/source/assets/images/hero_image.jpg b/website/source/assets/images/hero_image.jpg index c0990a936..5e73a1d7a 100644 Binary files a/website/source/assets/images/hero_image.jpg and b/website/source/assets/images/hero_image.jpg differ diff --git a/website/source/assets/images/logo-header.png b/website/source/assets/images/logo-header.png index 91b0f8a49..697c0a564 100644 Binary files a/website/source/assets/images/logo-header.png and b/website/source/assets/images/logo-header.png differ diff --git a/website/source/assets/images/logo-header@2x.png b/website/source/assets/images/logo-header@2x.png index 6a8088f9b..fe8901a95 100644 Binary files a/website/source/assets/images/logo-header@2x.png and b/website/source/assets/images/logo-header@2x.png differ diff --git a/website/source/assets/images/logo_footer.png b/website/source/assets/images/logo_footer.png index ca0112ebc..02fc58b94 100644 Binary files a/website/source/assets/images/logo_footer.png and b/website/source/assets/images/logo_footer.png differ diff --git a/website/source/assets/images/logo_nav.png b/website/source/assets/images/logo_nav.png index 1d7863c9b..a8e209612 100644 Binary files a/website/source/assets/images/logo_nav.png and b/website/source/assets/images/logo_nav.png differ diff --git a/website/source/assets/images/packer-signed-urls.png b/website/source/assets/images/packer-signed-urls.png index 4e9e17010..56dd1cc0f 100644 Binary files a/website/source/assets/images/packer-signed-urls.png and b/website/source/assets/images/packer-signed-urls.png differ diff --git a/website/source/assets/images/screenshots/vmware_and_virtualbox.png b/website/source/assets/images/screenshots/vmware_and_virtualbox.png index 174b3a12c..2147446c5 100644 Binary files a/website/source/assets/images/screenshots/vmware_and_virtualbox.png and b/website/source/assets/images/screenshots/vmware_and_virtualbox.png differ diff --git a/website/source/assets/images/user_bbc.png b/website/source/assets/images/user_bbc.png index fbc8c4e40..261ee48d5 100644 Binary files a/website/source/assets/images/user_bbc.png and b/website/source/assets/images/user_bbc.png differ diff --git a/website/source/assets/images/user_disqus.png b/website/source/assets/images/user_disqus.png index 8710fd14c..720c198ee 100644 Binary files a/website/source/assets/images/user_disqus.png and b/website/source/assets/images/user_disqus.png differ diff --git a/website/source/assets/images/user_edgecast.png b/website/source/assets/images/user_edgecast.png index e73e4b841..2438e0424 100644 Binary files a/website/source/assets/images/user_edgecast.png and b/website/source/assets/images/user_edgecast.png differ diff --git a/website/source/assets/images/user_expedia.png b/website/source/assets/images/user_expedia.png index 6fabee773..00f761822 100644 Binary files a/website/source/assets/images/user_expedia.png and b/website/source/assets/images/user_expedia.png differ diff --git a/website/source/assets/images/works_with_aws.png b/website/source/assets/images/works_with_aws.png index 0a353cf88..dce9a1d58 100644 Binary files a/website/source/assets/images/works_with_aws.png and b/website/source/assets/images/works_with_aws.png differ diff --git a/website/source/assets/images/works_with_virtual.png b/website/source/assets/images/works_with_virtual.png index dbfa8c737..21c251571 100644 Binary files a/website/source/assets/images/works_with_virtual.png and b/website/source/assets/images/works_with_virtual.png differ diff --git a/website/source/assets/images/works_with_vmware.png b/website/source/assets/images/works_with_vmware.png index 63f190d3b..fad9d1568 100644 Binary files a/website/source/assets/images/works_with_vmware.png and b/website/source/assets/images/works_with_vmware.png differ