vagrant/scripts/website_push_www.sh
oss-core-libraries-dashboard[bot] ea57f40b89
Some checks failed
/ sync-acceptance (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.1 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.2 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.3 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.4 (push) Has been cancelled
[COMPLIANCE] Update Copyright and License Headers (#13752)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2025-12-04 17:07:40 +05:30

43 lines
958 B
Bash
Executable file

#!/bin/bash
# Copyright IBM Corp. 2010, 2025
# SPDX-License-Identifier: BUSL-1.1
# 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 /tmp/vagrant-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/www/* $DEPLOY/
# Change into that directory
cd $DEPLOY
# Ignore some stuff
touch .gitignore
echo ".sass-cache" >> .gitignore
echo "build" >> .gitignore
echo "vendor" >> .gitignore
# Add everything
git init .
git add .
git commit -q -m "Deploy by $USER"
git remote add heroku git@heroku.com:vagrantup-www-2.git
git push -f heroku main
# Cleanup the deploy
rm -rf $DEPLOY