jeff1evesque / LeQue

Activate installed microphone, and analyze sound input
13 stars 2 forks source link

Add grunt to bash_loader #275

Closed jeff1evesque closed 10 years ago

jeff1evesque commented 10 years ago

While we are using grunt instead of our own bash script, we will add the grunt operation to our bash_loader script. This will require us to create a new directory called grunt with the script that runs the command grunt.

jeff1evesque commented 10 years ago

We've determined by using grunt, our environment is no longer production, and therefore, adds another layer of complexity.

jeff1evesque commented 10 years ago

06300fb: We rebooted our Ubuntu 11.04 virtual machine, and checked out bash logs:

+ shopt -s extglob
+ haystack=(./@(audio|git|build)/*)
+ true ./audio/converter_wav_rate ./audio/converter_wav_text ./build/grunt ./git/local_ignore_rules
+ for file in '"${haystack[@]}"'
+ for file in '"${haystack[@]}"'
+ ././audio/converter_wav_text
+ ././audio/converter_wav_rate
+ for file in '"${haystack[@]}"'
+ for file in '"${haystack[@]}"'
+ ././git/local_ignore_rules
+ ././build/grunt
././build/grunt: line 12: grunt: command not found
././git/local_ignore_rules: line 17: .git/info/exclude: No such file or directory
Setting up watches.
Watches established.
Setting up watches.
Watches established.
jeff1evesque commented 10 years ago

We located grunt:

$ which grunt
/usr/local/bin/grunt

7b50638: Then, we added a PATH variable to this location.

jeff1evesque commented 10 years ago

If we manually run bash_loader, then grunt works as intended:

$ cd /var/www/audio-analyzer/bash
$ ./bash_loader

However, at apache2 reboot, we get the errors as stated above.

jeff1evesque commented 10 years ago

We changed the file permission from root:root, to jeffrey:admin. However, the results did not work. We previously cloned, and then adjusted the clone of grunt by adding proper reference into the .gitmodules, and .git/config.

We will attempt to remove the grunt clone, and all its references, then create a submodule of grunt within this project.

jeff1evesque commented 10 years ago

We were successful removing the grunt clone, and all its references. However, after sudo reboot with our new grunt submodule, our logs still indicate the same results. Therefore, our results are identical to our previous attempt.

jeff1evesque commented 10 years ago

We temporarily commented out the following from bash_loader, and uncommented the same line in our grunt script:

set -x; exec > logs/log_bash_loader 2>&1

The results within our log_bash_loader file is essentially identical:

+ cd ../grunt
+ grunt
././build/grunt: line 15: grunt: command not found
jeff1evesque commented 10 years ago

e3ef1ca: We attempt to Pre-Pathing to grunt. However, the results were identical to our previous attempt.

jeff1evesque commented 10 years ago

We changed /var/www/audio-analyzer/bash/build/grunt:

#!/bin/bash
# note: this file is executed from 'bash_loader' , this is why the directory
# paths seem to be too short (i.e. missing extra '..')

# allow 'grunt' command
PATH=$PATH:/usr/local/bin/grunt

# allow @(var) syntax
shopt -s extglob

# track execution of script
set -x; exec > logs/log_bash_loader 2>&1

# subshell: move into 'grunt' clone repository, and execute 'grunt' command
(cd ../grunt && pwd && grunt)

After sudo reboot, our log_bash_loader outputs:

+ cd ../grunt
+ pwd
/var/www/audio-analyzer/grunt
+ grunt
././build/grunt: line 15: grunt: command not found