Skip to content
Snippets Groups Projects
Commit e5443546 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

CI: also deploy a simple shell launcher

parent fc97a7d3
Branches
Tags
No related merge requests found
Pipeline #88430 passed
......@@ -25,6 +25,7 @@ build:
- ls -al ./server/build/libs/Server.jar
- mkdir ./dist
- cp ./server/build/libs/Server.jar ./dist
- cp .gitlab-ci/launcher/* ./dist
artifacts:
paths:
- dist
......@@ -45,6 +46,8 @@ build:
- echo "${DEPLOY_KEY}" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
# Inject config
- cp "$ENV" ./dist/env.sh
# Deploy
- cd .gitlab-ci
- composer install
......
* make sure mongodb is running
* fill out `env.sh`
* run `./run.sh` to start the campus-qr server
# Mongo DB Config
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
MONGO_DB_NAME="campus-qr"
MONGO_DB_USER=""
MONGO_DB_PWD=""
MONGO_AUTH_SOURCE="campus-qr"
# Either "tugraz" or "meduni"
CAMPUSQR_QRTHEME="tugraz"
# Wethere QR codes for locations with multiple seats should be printed as A5
CAMPUSQR_MULTI_SEAT_A5=1
# The public URL
CAMPUSQR_BASE_URL="https://campusqr-dev.tugraz.at"
# The token for API access
CAMPUSQR_API_TOKEN=""
#!/bin/bash
set -e
DIR="$( cd "$( dirname "$0" )" && pwd )"
. "$DIR/env.sh"
MONGO_URI="mongodb://$MONGO_DB_USER:$MONGO_DB_PWD@$MONGO_HOST:$MONGO_PORT/$MONGO_DB_NAME?authSource=$MONGO_AUTH_SOURCE"
# Test if we can connect to the DB
mongo --eval "connect('$MONGO_URI');"
# Update the config
mongo --eval "$(cat << EOF
let db = connect('$MONGO_URI');
let config = [
{
_id: "multiSeatLocationsUseSmallCheckinPages",
stringValue: null,
intValue: $CAMPUSQR_MULTI_SEAT_A5,
},
{
_id: "baseUrl",
stringValue: '$CAMPUSQR_BASE_URL',
intValue: null,
},
{
_id: "authSharedSecret",
stringValue: '$CAMPUSQR_API_TOKEN',
intValue: null,
},
];
config.forEach((item) => {
db.configurations.updateOne(
{ _id: item._id },
{ \$set: { stringValue: item.stringValue, intValue: item.intValue } },
{ upsert: true }
);
});
EOF
)"
# Run the Server
export THEME="$CAMPUSQR_QRTHEME"
export MONGO_URI
DEBUG=false java -jar "$DIR/Server.jar"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment