Compare commits

...

10 Commits

Author SHA1 Message Date
13829c5e6c Update build.sh 2022-11-18 11:42:01 +02:00
9047e6c47d Update log 2022-11-18 11:35:18 +02:00
77da298944 Update log 2022-11-18 11:03:12 +02:00
c25e34bc37 Update log 2022-11-18 10:57:19 +02:00
9a25f16924 Update log 2022-11-18 10:33:53 +02:00
473f94fcbb Update log 2022-11-18 10:28:21 +02:00
9245373625 Update log 2022-11-18 10:21:32 +02:00
75d0e3aee7 exe right for build.sh 2022-10-31 22:26:08 +00:00
30ac997634 Merge pull request 'added build.sh' (#14) from temp-build into develop
Reviewed-on: #14
2022-10-31 22:22:20 +00:00
5aea138f6a added build.sh 2022-10-31 12:17:07 +02:00
4 changed files with 50 additions and 1 deletions

View File

1
.gitignore vendored
View File

@ -1 +1,2 @@
/node_modules
/dist

2
app.js
View File

@ -154,7 +154,7 @@ peers.on('connection', async socket => {
try {
// We can continue with the room creation process only if we have a callId
if (callId) {
console.log(`[createRoom] socket.id ${socket.id} callId ${callId}`);
console.log(`[createRoom] --🟥-- socket.id ${socket.id} callId ${callId}`);
if (!videoCalls[callId]) {
console.log('[createRoom] callId', callId);
videoCalls[callId] = { router: await worker.createRouter({ mediaCodecs }) }

48
build.sh Executable file
View File

@ -0,0 +1,48 @@
#/!bin/bash
## PREBUILD PROCESS
# check dist dir to be present and empty
if [ ! -d "dist" ]; then
## MAKE DIR
mkdir "dist"
echo "Directory dist created."
else
## CLEANUP
rm -fr dist/*
fi
# Install dependencies
#npm install
## PROJECT NEEDS
echo "Building app... from $(git rev-parse --abbrev-ref HEAD)"
#npm run-script build
cp .env.example .env
cp -r {.env,app.js,package.json,server,public} dist/
#Add version control for pm2
cd dist
#Add version control for pm2
version=$(git describe)
file_pkg="package.json"
key=" \"version\": \""
count=$(echo ${version%%-*} | grep -o "\." | wc -l)
if (( $count > 1 )); then
version=${version%%-*}
else
version="${version%%-*}.0"
fi
if [ -f "$file_pkg" ] && [ ! -z "$version" ]; then
version=" \"version\": \"$version\","
sed -i "s|^.*$key.*|${version//\//\\/}|g" $file_pkg
text=$(cat $file_pkg | grep -c "$version")
if [ $text -eq 0 ]; then
echo "Version couldn't be set"
else
echo "Version $version successfully applied to App"
fi
fi
## POST BUILD
cd -
rm .env