Skip to content

Commit

Permalink
Additional permission tweaks for staging and production environment (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
howard-e authored Sep 23, 2024
1 parent 1335362 commit 20354a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy/roles/application/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
line: 'aria-bot ALL=(ALL) NOPASSWD:{{source_dir}}/deploy/scripts/export-and-exec.sh'
validate: 'visudo -cf %s'
become: yes
when: deployment_mode == 'sandbox'
when: deployment_mode != 'development'

# TODO: these permissions changes are a workaround solution

Expand Down
8 changes: 7 additions & 1 deletion server/services/TestService.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ async function runImportScript(git_hash) {
let importScriptDirectoryPrefix = isDevelopmentProcess ? '.' : './server';
let command = `${deployDirectoryPrefix}/deploy/scripts/export-and-exec.sh ${process.env.IMPORT_CONFIG} node ${importScriptDirectoryPrefix}/scripts/import-tests/index.js`;
if (git_hash) command += ` -c ${git_hash}`;
if (process.env.ENVIRONMENT === 'sandbox') command = `sudo ${command}`;
if (
process.env.ENVIRONMENT === 'sandbox' ||
process.env.ENVIRONMENT === 'staging' ||
process.env.ENVIRONMENT === 'production'
) {
command = `sudo ${command}`;
}
exec(command, (error, stdout, stderr) => {
if (error) {
reject(error);
Expand Down

0 comments on commit 20354a5

Please sign in to comment.