A
A
Al2017-02-12 03:24:31
linux
Al, 2017-02-12 03:24:31

NodeJS + GIT + Linux - what's wrong with file permissions?

There is a bash script that contains commands to unpack the repository into the project directory, build it, and launch 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 fires, 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: Операция не позволена

Permissions for 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 is triggered when pushing to the repository using gitlab-ci-runner, i.e. from under the user gitlab-runner, the following command is executed
- sudo su -c /myProject/bin/myStartScript.sh node
What do I need to do with the rights so that everything works as it should (unpack the git archive repository, build and run the application so that it has the rights to not only read but write files - the application process will be added to forever.js from the node user)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2017-02-12
@vitali1995

What do I need to do with the rights so that everything works as it should?

Set write permissions for your user (probably testUser).
Rights are established by the one who has them, i.e. root (and possibly gitlab-runner)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question