There is a bash script that contains commands for unpacking the repository to the project directory, builds and runs the application (node-js):
git archive --remote=/git-repo/repositories/test/myProject.git master | tar -x -C /myProject/ forever stop "myProject" node --use_strict bin/init forever start -a --uid "myProject" --minUptime 20000 --spinSleepTime 20000 bin/start --use_strict When it works, I get in the console:
tar: app/import/files/price: Функция utime завершилась с ошибкой: Операция не позволена tar: app/import/files/price: Невозможно изменить права доступа на rwxr-xr-x: Операция не позволена tar: app/import/files/staticPages: Функция utime завершилась с ошибкой: Операция не позволена tar: app/import/files/staticPages: Невозможно изменить права доступа на rwxr-xr-x: Операция не позволена Rights to project directories:
drwxrwxrwx 8 www-data www-data 4096 app drwxrwxrwx 2 www-data www-data 4096 bin -rw-r--r-- 1 node www-data 7 CHANGELOG drwxrwxrwx 5 www-data www-data 4096 config drwxrwxrwx 7 www-data www-data 4096 core drwxrwxrwx 7 testUser testUser 4096 gen drwxrwxrwx 652 testUser testUser 20480 node_modules -rw-r--r-- 1 node www-data 2100 package.json -rw-r--r-- 1 node www-data 696 README.md This script works when you push to the repository using gitlab-ci-runner, i.e. from under the gitlab-runner user, this command - sudo su -c /myProject/bin/myStartScript.sh node executed - sudo su -c /myProject/bin/myStartScript.sh node
What do I need to do with permissions so that everything works as expected (unpacking the git archive repository, building and running the application so that it has rights not only to read but to write files - the application process will be added to forever.js from the node user)?