remove comps
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
[config]
|
||||
command = bash deploy.sh
|
||||
command = deploy.cmd
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
node_modules/
|
||||
public/components
|
||||
.sass-cache
|
||||
public/out
|
||||
public/dist
|
||||
public/components
|
||||
|
||||
3
app.js
3
app.js
@@ -7,5 +7,4 @@ var app = express();
|
||||
|
||||
require('./config/express')(app, config);
|
||||
|
||||
app.listen(config.port);
|
||||
|
||||
app.listen(process.env.PORT || config.port);
|
||||
|
||||
@@ -320,14 +320,14 @@
|
||||
</footer>
|
||||
<script src="/components/moment/min/moment.min.js" ></script>
|
||||
<script src="/components/jquery/dist/jquery.min.js"></script>
|
||||
<script src="/js/respond.js" ></script>
|
||||
<script src="/dist/respond.js" ></script>
|
||||
<script src="/components/mustache/mustache.js" ></script>
|
||||
<script src="/components/jquery-rss/dist/jquery.rss.min.js" ></script>
|
||||
<script src="/components/jquery.easing/js/jquery.easing.min.js" ></script>
|
||||
<script src="/components/lodestoneapi.min/index.js" ></script>
|
||||
<script src="/components/bootstrap/dist/js/bootstrap.min.js" ></script>
|
||||
<script src="/js/GithubActivity.js" ></script>
|
||||
<script src="/js/main.js"></script>
|
||||
<script src="/dist/GithubActivity.js" ></script>
|
||||
<script src="/dist/main.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ var config = {
|
||||
app: {
|
||||
name: 'about.tommyparnell'
|
||||
},
|
||||
port: 4000,
|
||||
port: 3000,
|
||||
},
|
||||
|
||||
test: {
|
||||
@@ -16,7 +16,7 @@ var config = {
|
||||
app: {
|
||||
name: 'about.tommyparnell'
|
||||
},
|
||||
port: 4000,
|
||||
port: 3000,
|
||||
},
|
||||
|
||||
production: {
|
||||
@@ -24,7 +24,7 @@ var config = {
|
||||
app: {
|
||||
name: 'about.tommyparnell'
|
||||
},
|
||||
port: 80,
|
||||
port: 3000,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
156
deploy.cmd
Normal file
156
deploy.cmd
Normal file
@@ -0,0 +1,156 @@
|
||||
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
|
||||
|
||||
:: ----------------------
|
||||
:: KUDU Deployment Script
|
||||
:: Version: 0.2.2
|
||||
:: ----------------------
|
||||
|
||||
:: Prerequisites
|
||||
:: -------------
|
||||
|
||||
:: Verify node.js installed
|
||||
where node 2>nul >nul
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
|
||||
goto error
|
||||
)
|
||||
|
||||
:: Setup
|
||||
:: -----
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
SET ARTIFACTS=%~dp0%..\artifacts
|
||||
|
||||
IF NOT DEFINED DEPLOYMENT_SOURCE (
|
||||
SET DEPLOYMENT_SOURCE=%~dp0%.
|
||||
)
|
||||
|
||||
IF NOT DEFINED DEPLOYMENT_TARGET (
|
||||
SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
|
||||
)
|
||||
|
||||
IF NOT DEFINED NEXT_MANIFEST_PATH (
|
||||
SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
|
||||
|
||||
IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
|
||||
SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
|
||||
)
|
||||
)
|
||||
|
||||
IF NOT DEFINED KUDU_SYNC_CMD (
|
||||
:: Install kudu sync
|
||||
echo Installing Kudu Sync
|
||||
call npm install kudusync -g --silent
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: Locally just running "kuduSync" would also work
|
||||
SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
|
||||
)
|
||||
goto Deployment
|
||||
|
||||
:: Utility Functions
|
||||
:: -----------------
|
||||
|
||||
:SelectNodeVersion
|
||||
|
||||
IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
|
||||
:: The following are done only on Windows Azure Websites environment
|
||||
call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
|
||||
SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
)
|
||||
|
||||
IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
|
||||
SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
)
|
||||
|
||||
IF NOT DEFINED NODE_EXE (
|
||||
SET NODE_EXE=node
|
||||
)
|
||||
|
||||
SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
|
||||
) ELSE (
|
||||
SET NPM_CMD=npm
|
||||
SET NODE_EXE=node
|
||||
)
|
||||
|
||||
goto :EOF
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Deployment
|
||||
:: ----------
|
||||
|
||||
:Deployment
|
||||
echo Handling node.js deployment.
|
||||
|
||||
:: 1. KuduSync
|
||||
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
|
||||
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
)
|
||||
|
||||
:: 2. Select node version
|
||||
call :SelectNodeVersion
|
||||
|
||||
:: 3. Install npm packages
|
||||
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
|
||||
pushd "%DEPLOYMENT_TARGET%"
|
||||
call :ExecuteCmd !NPM_CMD! install
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
popd
|
||||
)
|
||||
|
||||
:: 4. Install gulp
|
||||
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
|
||||
pushd "%DEPLOYMENT_TARGET%"
|
||||
call :ExecuteCmd !NPM_CMD! install gulp
|
||||
call .\node_modules\.bin\gulp compress
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
popd
|
||||
)
|
||||
|
||||
:: 4. Install gulp
|
||||
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
|
||||
pushd "%DEPLOYMENT_TARGET%"
|
||||
call :ExecuteCmd !NPM_CMD! install bower
|
||||
call .\node_modules\.bin\bower install
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
popd
|
||||
)
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:: Post deployment stub
|
||||
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
goto end
|
||||
|
||||
:: Execute command routine that will echo out when error
|
||||
:ExecuteCmd
|
||||
setlocal
|
||||
set _CMD_=%*
|
||||
call %_CMD_%
|
||||
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:error
|
||||
endlocal
|
||||
echo An error has occurred during web site deployment.
|
||||
call :exitSetErrorLevel
|
||||
call :exitFromFunction 2>nul
|
||||
|
||||
:exitSetErrorLevel
|
||||
exit /b 1
|
||||
|
||||
:exitFromFunction
|
||||
()
|
||||
|
||||
:end
|
||||
endlocal
|
||||
echo Finished successfully.
|
||||
142
deploy.sh
142
deploy.sh
@@ -1,142 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ----------------------
|
||||
# KUDU Deployment Script
|
||||
# Version: 0.2.2
|
||||
# ----------------------
|
||||
|
||||
# Helpers
|
||||
# -------
|
||||
|
||||
exitWithMessageOnError () {
|
||||
if [ ! $? -eq 0 ]; then
|
||||
echo "An error has occurred during web site deployment."
|
||||
echo $1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Prerequisites
|
||||
# -------------
|
||||
|
||||
# Verify node.js installed
|
||||
hash node 2>/dev/null
|
||||
exitWithMessageOnError "Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment."
|
||||
|
||||
# Setup
|
||||
# -----
|
||||
|
||||
SCRIPT_DIR="${BASH_SOURCE[0]%\\*}"
|
||||
SCRIPT_DIR="${SCRIPT_DIR%/*}"
|
||||
ARTIFACTS=$SCRIPT_DIR/../artifacts
|
||||
KUDU_SYNC_CMD=${KUDU_SYNC_CMD//\"}
|
||||
|
||||
if [[ ! -n "$DEPLOYMENT_SOURCE" ]]; then
|
||||
DEPLOYMENT_SOURCE=$SCRIPT_DIR
|
||||
fi
|
||||
|
||||
if [[ ! -n "$NEXT_MANIFEST_PATH" ]]; then
|
||||
NEXT_MANIFEST_PATH=$ARTIFACTS/manifest
|
||||
|
||||
if [[ ! -n "$PREVIOUS_MANIFEST_PATH" ]]; then
|
||||
PREVIOUS_MANIFEST_PATH=$NEXT_MANIFEST_PATH
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -n "$DEPLOYMENT_TARGET" ]]; then
|
||||
DEPLOYMENT_TARGET=$ARTIFACTS/wwwroot
|
||||
else
|
||||
KUDU_SERVICE=true
|
||||
fi
|
||||
|
||||
if [[ ! -n "$KUDU_SYNC_CMD" ]]; then
|
||||
# Install kudu sync
|
||||
echo Installing Kudu Sync
|
||||
npm install kudusync -g --silent
|
||||
exitWithMessageOnError "npm failed"
|
||||
|
||||
if [[ ! -n "$KUDU_SERVICE" ]]; then
|
||||
# In case we are running locally this is the correct location of kuduSync
|
||||
KUDU_SYNC_CMD=kuduSync
|
||||
else
|
||||
# In case we are running on kudu service this is the correct location of kuduSync
|
||||
KUDU_SYNC_CMD=$APPDATA/npm/node_modules/kuduSync/bin/kuduSync
|
||||
fi
|
||||
fi
|
||||
|
||||
# Node Helpers
|
||||
# ------------
|
||||
|
||||
selectNodeVersion () {
|
||||
if [[ -n "$KUDU_SELECT_NODE_VERSION_CMD" ]]; then
|
||||
SELECT_NODE_VERSION="$KUDU_SELECT_NODE_VERSION_CMD \"$DEPLOYMENT_SOURCE\" \"$DEPLOYMENT_TARGET\" \"$DEPLOYMENT_TEMP\""
|
||||
eval $SELECT_NODE_VERSION
|
||||
exitWithMessageOnError "select node version failed"
|
||||
|
||||
if [[ -e "$DEPLOYMENT_TEMP/__nodeVersion.tmp" ]]; then
|
||||
NODE_EXE=`cat "$DEPLOYMENT_TEMP/__nodeVersion.tmp"`
|
||||
exitWithMessageOnError "getting node version failed"
|
||||
fi
|
||||
|
||||
if [[ -e "$DEPLOYMENT_TEMP/.tmp" ]]; then
|
||||
NPM_JS_PATH=`cat "$DEPLOYMENT_TEMP/__npmVersion.tmp"`
|
||||
exitWithMessageOnError "getting npm version failed"
|
||||
fi
|
||||
|
||||
if [[ ! -n "$NODE_EXE" ]]; then
|
||||
NODE_EXE=node
|
||||
fi
|
||||
|
||||
NPM_CMD="\"$NODE_EXE\" \"$NPM_JS_PATH\""
|
||||
else
|
||||
NPM_CMD=npm
|
||||
NODE_EXE=node
|
||||
fi
|
||||
}
|
||||
|
||||
##################################################################################################################################
|
||||
# Deployment
|
||||
# ----------
|
||||
|
||||
echo Handling node.js deployment.
|
||||
|
||||
# 1. KuduSync
|
||||
if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then
|
||||
"$KUDU_SYNC_CMD" -v 50 -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh"
|
||||
exitWithMessageOnError "Kudu Sync failed"
|
||||
fi
|
||||
|
||||
# 2. Select node version
|
||||
selectNodeVersion
|
||||
|
||||
# 3. Install npm packages
|
||||
if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then
|
||||
$NPM_CMD cache clean
|
||||
cd "$DEPLOYMENT_TARGET"
|
||||
eval $NPM_CMD install
|
||||
exitWithMessageOnError "npm failed"
|
||||
cd - > /dev/null
|
||||
fi
|
||||
|
||||
# 4. Install bower packages
|
||||
if [ -e "$DEPLOYMENT_TARGET/bower.json" ]; then
|
||||
cd "$DEPLOYMENT_TARGET"
|
||||
eval $NPM_CMD install bower
|
||||
exitWithMessageOnError "installing bower failed"
|
||||
./node_modules/.bin/bower install
|
||||
exitWithMessageOnError "bower failed"
|
||||
cd - > /dev/null
|
||||
fi
|
||||
|
||||
|
||||
##################################################################################################################################
|
||||
|
||||
# Post deployment stub
|
||||
if [[ -n "$POST_DEPLOYMENT_ACTION" ]]; then
|
||||
POST_DEPLOYMENT_ACTION=${POST_DEPLOYMENT_ACTION//\"}
|
||||
cd "${POST_DEPLOYMENT_ACTION_DIR%\\*}"
|
||||
"$POST_DEPLOYMENT_ACTION"
|
||||
exitWithMessageOnError "post deployment action failed"
|
||||
fi
|
||||
|
||||
echo "Finished successfully."
|
||||
10
gulpfile.js
10
gulpfile.js
@@ -3,7 +3,8 @@ var gulp = require('gulp'),
|
||||
plumber = require('gulp-plumber'),
|
||||
livereload = require('gulp-livereload'),
|
||||
less = require('gulp-less'),
|
||||
concatCss = require('gulp-concat-css');
|
||||
concatCss = require('gulp-concat-css'),
|
||||
uglify = require('gulp-uglify');
|
||||
|
||||
gulp.task('less', function () {
|
||||
gulp.src('./public/css/*.less')
|
||||
@@ -36,6 +37,12 @@ gulp.task('develop', function () {
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('compress', function() {
|
||||
return gulp.src('public/js/*.js')
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('public/dist'));
|
||||
});
|
||||
|
||||
gulp.task('publish', [
|
||||
'less'
|
||||
]);
|
||||
@@ -43,5 +50,6 @@ gulp.task('publish', [
|
||||
gulp.task('default', [
|
||||
'less',
|
||||
'develop',
|
||||
'compress',
|
||||
'watch'
|
||||
]);
|
||||
|
||||
14
package.json
14
package.json
@@ -6,14 +6,15 @@
|
||||
"start": "node app.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "~4.12.0",
|
||||
"serve-favicon": "~2.2.0",
|
||||
"morgan": "~1.5.0",
|
||||
"cookie-parser": "~1.3.3",
|
||||
"body-parser": "~1.12.0",
|
||||
"compression": "~1.4.1",
|
||||
"cookie-parser": "~1.3.3",
|
||||
"express": "~4.12.0",
|
||||
"glob": "~5.0.3",
|
||||
"method-override": "~2.3.0",
|
||||
"glob": "~5.0.3"
|
||||
"morgan": "~1.5.0",
|
||||
"serve-favicon": "~2.2.0",
|
||||
"vash": "^0.9.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "~3.8.10",
|
||||
@@ -21,6 +22,7 @@
|
||||
"gulp-less": "~3.0.1",
|
||||
"gulp-livereload": "~3.8.0",
|
||||
"gulp-nodemon": "~2.0.2",
|
||||
"gulp-plumber": "~1.0.0"
|
||||
"gulp-plumber": "~1.0.0",
|
||||
"gulp-uglify": "^1.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user