How do I build a meteor app (do 'meteor build .') in a GitLab custom hook? The custom hook is run by the user git who does not seem to have any possibility to run meteor build.
Therefore I want to change the user in the script to someone who is known to be able to build the app.
This is my bash file until now:
#!/bin/sh
#
# The deployed directory
DEPLOYDIR=/var/www/site/
echo " - Starting checkout"
GIT_WORK_TREE="$DEPLOYDIR" git checkout -f
echo " - Finished checkout"
echo " - Starting meteor build"
#not working yet
sudo su - nodejs
cd "$DEPLOYDIR"
meteor build .
su - user
starts an interactive shell with the useruser
. You're going to want to use the following:Dissection:
su
:su
executable-c "COMMAND"
: runCOMMAND
as another usernodejs
:nodejs
user