yavscd in prod

This commit is contained in:
2019-12-11 16:42:07 +00:00
parent 9e742818ef
commit ae5e85bf9d
21 changed files with 75 additions and 137 deletions

View File

@ -1,3 +0,0 @@
namespace Yavsc.contrib
{
omg, daB4C0|)3DA!!!

View File

@ -1 +0,0 @@
dnu build --configuration Debug ./project.json

View File

@ -1,7 +0,0 @@

insert into "Blog" ("AuthorId",bcontent,modified,photo,posted,rate,title,visible)
select 'dcfd1730-7dc8-4db8-8db4-20da0a6b07fe',bcontent,modified,photo,posted,rate,title,visible
from "BlogOld"

View File

@ -1,42 +0,0 @@
ALTER TABLE estimate
DROP CONSTRAINT estimate_username_fkey;
ALTER TABLE estimate
DROP CONSTRAINT estimate_client_fkey;
ALTER TABLE estimate RENAME TO old_estimate;
ALTER TABLE blog DROP CONSTRAINT bloguser;
ALTER TABLE blog RENAME TO old_blog;
ALTER TABLE activity RENAME TO old_activity;
ALTER TABLE tag RENAME TO old_tag;
ALTER TABLE tagged RENAME TO old_tagged;
ALTER TABLE writtings RENAME TO old_writtings;
drop table blfiles;
drop table blog_access;
drop table circle;
drop table circle_members;
drop table commandes;
drop table comment;
drop table histoestim;
drop table histowritting;
drop table hr;
drop table comment;
drop table product;
drop table profiledata;
drop table satisfaction;
drop table stocksymbols;
drop table taskdeps;
drop table tasks;
drop table userskills;
drop table wrfiles ;
drop table wrtags ;
drop table passwrecovery;
drop table projet;
drop table skill;
drop table usersroles;
drop table roles;
drop table users;
drop table profiles;
drop TABLE postheader;

View File

@ -16,21 +16,15 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CONFIGS="/etc/kestrel/*.webenv"
DNX_USER_HOME=/srv/www/dnx
DNXRUNTIMEVERSION=$(cat /srv/www/dnx/alias/default.alias)
. /home/paul/mono46/mono-env
MONO_BINARY=`which mono`
# fix issue with DNX exception in case of two env vars with the same name but different case
TMP_SAVE_runlevel_VAR=$runlevel
unset runlevel
running() {
if [ -f $PIDFILE ]
then
DNXPID=$(cat $PIDFILE)
if kill -0 $DNXPID 2>/dev/null
PID=$(cat $PIDFILE)
if kill -0 $PID 2>/dev/null
then
return 0
fi
@ -45,15 +39,12 @@ setdnxenv() {
# reset all except the name to default values
export ASPNET_ENV=$NAME
export WWW_USER=www-data
DNXEXE=${DNX_USER_HOME}/runtimes/${DNXRUNTIMEVERSION}/bin/ndnx
DNXRUNTIME=${DNX_USER_HOME}/runtimes/${DNXRUNTIMEVERSION}/bin/Microsoft.Dnx.Host.Mono.dll
YAVSCBIN=/usr/local/bin/yavscd
PROJECT=approot/Web
CONFIGURATION=Release
ROOT=/srv/www/yavsc
DESC="$NAME"
PIDFILE=/var/run/kestrel-${NAME}.pid
export MONO_OPTIONS="--server"
export MONO_PATH=$MONO_PATH:${DNX_USER_HOME}/runtimes/${DNXRUNTIMEVERSION}/bin
LOGDIR=/var/log
# reset to specified values
. $env
@ -65,7 +56,7 @@ status() {
setdnxenv "$env"
if running;
then
echo "Service running $DESC ($NAME; pid: $DNXPID)"
echo "Service running $DESC ($NAME; pid: $PID)"
else
echo "Service stopped $DESC ($NAME)"
fi
@ -82,7 +73,7 @@ start() {
log_end_msg 0
else
log_daemon_msg "Starting service $NAME for user $WWW_USER"
if ! start-stop-daemon -SbmCv --user $WWW_USER -p $PIDFILE -d $ROOT -g www-data -x $DNXEXE -- --project $PROJECT --configuration $CONFIGURATION $NAME > "${LOGDIR}/kestrel-${NAME}.log"
if ! start-stop-daemon -SbmCv -u $WWW_USER -p $PIDFILE -d $ROOT -g www-data -x $YAVSCBIN -- --project $PROJECT --configuration $CONFIGURATION $NAME > "${LOGDIR}/kestrel-${NAME}.log"
then
log_daemon_msg "Could not start $NAME : $?, see ${LOGDIR}/kestrel-${NAME}.log"
log_end_msg 2

View File

@ -16,18 +16,15 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CONFIGS="/etc/kestrel/*.prewebenv"
DNX_USER_HOME=/srv/www/dnx
DNXRUNTIMEVERSION=$(cat /srv/www/dnx/alias/default.alias)
# fix issue with DNX exception in case of two env vars with the same name but different case
TMP_SAVE_runlevel_VAR=$runlevel
unset runlevel
running() {
if [ -f $PIDFILE ]
then
DNXPID=$(cat $PIDFILE)
if kill -0 $DNXPID 2>/dev/null
PID=$(cat $PIDFILE)
if kill -0 $PID 2>/dev/null
then
return 0
fi
@ -41,14 +38,13 @@ setdnxenv() {
. $env
# reset all except the name to default values
export ASPNET_ENV=$NAME
WWW_USER=www-data
DNXRUNTIME=${DNX_USER_HOME}/runtimes/${DNXRUNTIMEVERSION}/bin/Microsoft.Dnx.Host.Mono.dll
export WWW_USER=www-data
YAVSCBIN=/usr/local/bin/yavscd-pre
PROJECT=approot/Web
CONFIGURATION=Release
ROOT=/srv/www/yavscpre
DESC="$NAME"
PIDFILE=/var/run/kestrel-${NAME}.pid
export MONO_OPTIONS="--server"
LOGDIR=/var/log
# reset to specified values
. $env
@ -60,7 +56,7 @@ status() {
setdnxenv "$env"
if running;
then
echo "Service running $DESC ($NAME; pid: $DNXPID)"
echo "Service running $DESC ($NAME; pid: $PID)"
else
echo "Service stopped $DESC ($NAME)"
fi
@ -76,8 +72,8 @@ start() {
echo "Service already running $DESC" "$NAME"
log_end_msg 0
else
log_daemon_msg "Starting service $NAME"
if ! start-stop-daemon -SbmCv -u $WWW_USER -p $PIDFILE -d $ROOT -x /usr/bin/mono $DNXRUNTIME -- --project $PROJECT --configuration $CONFIGURATION $NAME >${LOGDIR}/kestrel-${NAME}.log
log_daemon_msg "Starting service $NAME for user $WWW_USER"
if ! start-stop-daemon -SbmCv -u $WWW_USER -p $PIDFILE -d $ROOT -g www-data -x $YAVSCBIN -- --project $PROJECT --configuration $CONFIGURATION $NAME > "${LOGDIR}/kestrel-${NAME}.log"
then
log_daemon_msg "Could not start $NAME : $?, see ${LOGDIR}/kestrel-${NAME}.log"
log_end_msg 2

View File

@ -1,23 +0,0 @@
#!/bin/bash
export FSPATH=/srv/www/yavscpre
ssh root@localhost rm -rf $FSPATH/approot
(
set -e
ssh root@localhost systemctl stop kestrel-pre
cd bin/output/
echo "sync to $FSPATH"
rsync -ravu wwwroot approot root@localhost:$FSPATH
sleep 1
ssh root@localhost sync
sleep 1
ssh root@localhost systemctl start kestrel-pre
)
echo "Now, go and try <https://yavscpre.pschneider.fr>"
echo "Then, feel free to launch contrib/rsync-to-prod.sh"

View File

@ -1,18 +0,0 @@
#!/bin/bash
export FSPATH=/srv/www/yavsc
(
set -e
ssh root@localhost systemctl stop kestrel
ssh root@localhost rm -rf $FSPATH/approot
cd bin/output/
sleep 1
echo "Sync: > $FSPATH"
rsync -ravu wwwroot approot root@localhost:$FSPATH
sleep 1
ssh root@localhost sync
sleep 1
ssh root@localhost systemctl start kestrel
)