forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
164 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
ROOT:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
server: | ||
python -m SimpleHTTPServer | ||
|
||
watch: | ||
sass styles:static --watch | ||
|
||
dist: | ||
@echo clean dist | ||
@rm -rf dist/index.html | ||
@rm -rf dist/static | ||
@echo "compile styles/*.scss" | ||
@sass styles/base.scss static/base.css | ||
@ruby scripts/compile.rb | ||
cp -R ./static dist/static/ | ||
cp index.html dist/index.html | ||
sed -E -e "/ASSETS/,/\/ASSETS/ d" -ibak dist/index.html | ||
sed -E -e "s#<\/body>#<script src=\"static/application.min.js\"></script></body>#" -ibak dist/index.html | ||
rm dist/index.htmlbak | ||
@sh -c "'$(ROOT)/scripts/dist.sh'" | ||
|
||
.PHONY: server watch dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/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 directory | ||
cd "$DIR" | ||
|
||
# Generate the tag | ||
DEPLOY="../pkg/web_ui" | ||
|
||
rm -rf $DEPLOY | ||
mkdir -p $DEPLOY | ||
|
||
bundle check >/dev/null 2>&1 || bundle install | ||
bundle exec sass styles/base.scss static/base.css | ||
|
||
bundle exec ruby scripts/compile.rb | ||
|
||
# Copy into deploy | ||
shopt -s dotglob | ||
cp -r $DIR/static/* $DEPLOY/ | ||
cp index.html $DEPLOY/ | ||
|
||
# Magic scripting | ||
sed -E -e "/ASSETS/,/\/ASSETS/ d" -ibak $DEPLOY/index.html | ||
sed -E -e "s#<\/body>#<script src=\"static/application.min.js\"></script></body>#" -ibak $DEPLOY/index.html | ||
|
||
# Remove the backup file from sed | ||
rm $DEPLOY/index.htmlbak | ||
|
||
pushd $DEPLOY >/dev/null 2>&1 | ||
zip ../web_ui.zip ./* | ||
popd >/dev/null 2>&1 |