Skip to content

Commit 20354a5

Browse files
authored
Additional permission tweaks for staging and production environment (#1218)
1 parent 1335362 commit 20354a5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

deploy/roles/application/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
line: 'aria-bot ALL=(ALL) NOPASSWD:{{source_dir}}/deploy/scripts/export-and-exec.sh'
1818
validate: 'visudo -cf %s'
1919
become: yes
20-
when: deployment_mode == 'sandbox'
20+
when: deployment_mode != 'development'
2121

2222
# TODO: these permissions changes are a workaround solution
2323

server/services/TestService.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ async function runImportScript(git_hash) {
1111
let importScriptDirectoryPrefix = isDevelopmentProcess ? '.' : './server';
1212
let command = `${deployDirectoryPrefix}/deploy/scripts/export-and-exec.sh ${process.env.IMPORT_CONFIG} node ${importScriptDirectoryPrefix}/scripts/import-tests/index.js`;
1313
if (git_hash) command += ` -c ${git_hash}`;
14-
if (process.env.ENVIRONMENT === 'sandbox') command = `sudo ${command}`;
14+
if (
15+
process.env.ENVIRONMENT === 'sandbox' ||
16+
process.env.ENVIRONMENT === 'staging' ||
17+
process.env.ENVIRONMENT === 'production'
18+
) {
19+
command = `sudo ${command}`;
20+
}
1521
exec(command, (error, stdout, stderr) => {
1622
if (error) {
1723
reject(error);

0 commit comments

Comments
 (0)