Is there any way to change command used to build a Node.js project after deploying code to Azure?
I can't use
node install
to install (download dependencies of) my project, because of some issue [described here] (too long paths of some modules).
I wanted to use dedupe command or some bash script that I found here:
npm ls | grep "^│ .* [^ ]#[^ ]$" | rev | cut -d " " -f1 | rev | sort -u -t "#" -k1,1 |xargs -L 1 npm install --no-registry --loglevel error
to solve this problem, but I don't know how to run those commands on Azure. Is it possible?
You can try running the command from the diagnostic console via KUDU services.
To access KUDU simply add ".scm" before .azurewebsites.net.
For example, if your website is mywebsite.azurewebsites.net, you would browse to mywebsite.scm.azurewebsites.net
Once there click on Debug Console and then CMD
More information can be found here:
http://blogs.msdn.com/b/benjaminperkins/archive/2014/03/24/using-kudu-with-windows-azure-web-sites.aspx
Related
i have written a shell script to create a workspace in eclipse che. the script is generating the workspace url. but when i open it, workspace does not exit. Am i missing on something?
#!/bin/sh
#=========================================================================
repo_url=$1
branch_name=$2
ip_addr=$3
#echo $repo_url
#B="$(cut -d'/' -f4 <<<$repourl)"
temp_var="$(echo $repo_url | cut -d'/' -f5)"
repo_name="$(echo $temp_var | cut -d '.' -f1)"
#rm /opt/stackstorm/packs/jenkins/template/latest_template
sudo cp /opt/stackstorm/packs/dev_prediction/actions/latest_template.sh /opt/stackstorm/packs/dev_prediction/template/
#sed -i "s/repourl/$repo_url/g;s/branchname/$branch_name/g;s/reponame/$repo_name/g;s/ipaddr/$ip_addr/g" latest_template
sudo sed -i "s#repourl#$repo_url#g;s#branchname#$branch_name#g;s#reponame#$repo_name#g;s#ipaddr#$ip_addr#g" /opt/stackstorm/packs/dev_prediction/template/latest_template.sh
sudo chmod u+x /opt/stackstorm/packs/dev_prediction/template/latest_template.sh
#cat /opt/stackstorm/packs/jenkins/template/latest_template
sudo sh /opt/stackstorm/packs/dev_prediction/template/latest_template.sh > /dev/null
sudo rm /opt/stackstorm/packs/dev_prediction/template/latest_template.sh
echo "http://$ip_addr/dashboard/#/ide/admin/$repo_name-$branch_name"
Expected and Actual URL:
"http://URL.ap-south-1.elb.amazonaws.com/dashboard/#/ide/admin/petclinic-new-AIAS-37"
I don't actually follow... From what I can see here, you are just generating URL, but you are not creating a workspace. Was that done before?
To open a workspace by accessing URL of the workspace, the workspace has to exist first ;-)
If you are looking on how to create workspace from script, you can use REST API endpoints for that. In default Eclipse Che deployment, we are also deploying swagger on URL /swagger (in your case "http://URL.ap-south-1.elb.amazonaws.com/swagger"), so you can take a look at all the API endpoints for yourself.
The most interesting for you might be:
POST to <cheUrl>/api/devfile to create a workspace from devfile (new, Che 7 workspace definition file)
POST to <cheUrl>/api/workspace to create workspace from Che 6 workspace definition json.
Hope this helps.
Radim
Basically I want to:
git --work-tree=/home/aero/server --git-dir=/home/aero/server/.git pull;
ps aux | grep node | grep server-aero-static | awk '{print $2}' | xargs kill -9;
cd /home/aero/server;
npm start;
I don't think this would work in post-receive, why? And how can I get it to work?
The Git part should work, provided the remote "origin" is correctly set in /home/aero/server, in order for that repo to work properly (as in "Git post-receive not working correctly").
The npm start part might be a problem if that command blocks.
In that case (meaning execution in a Git hook), you might consider using pm2 to start your application, as explained in "A Friendly Guide To Automate Deployment For Node.js Apps With Git Hooks" by aunnnn.
pm2 start npm --name 'my-app' — start \
&& echo "post-receive: app started successfully with pm2".
I am deploying an app to AWS EC2 instance and I am using a config file in the .ebextensions folder to execute a bash script.
In the script I am detecting if a particular service is running, if it's not running, install the package using rpm.
#!/bin/bash
service --status-all | grep -q 'MyService'
if [ $? -ne 0 ];
then
install my package
else
do nothing
fi
But the script is not working and it always go to install my service again.
It is because
service --status-all
is returning nothing at all which confuses me! But after the deployment when I go to the EC2 instance and try out the script, it does work. Just that it does not work during deployment.
There should be at least some services running but empty?
Am I doing this correctly?
Figured out what's wrong, putting it here for for everyone's reference.
service --status-all
works while in the bash prompt, but does not seem to return anything during my AWS EC2 deployment.
I have changed it to something like
if ps ax | grep -v grep | grep -q 'My Service'
from here: http://www.akamaras.com/linux/linux-script-to-check-if-a-service-is-running-and-start-it-if-its-stopped/
and it works perfectly.
I've installed sublime text from bash but it doesn't work it just return the bash prompt again .
then
I installed sublime natively on windows , problem is I can't run it from bash .
It is already supported in Windows 10 latest build (build 14951), used like this:
$ export PATH=$PATH:/mnt/c/Windows/System32
$ notepad.exe
$ ipconfig.exe | grep IPv4 | cut -d: -f2
$ ls -la | findstr.exe foo.txt
$ cmd.exe /c dir
more information here.
There is a ticket about it in their Github page with some hacks you can use meanwhile.
It appears at this time, the cbwin project is our best bet. I just started running into these same issues with trying to use vagrant from Bash on Windows, and my vagrant install ran into issues that required kernel support (currently lacking in Bash on Windows).
In Red Hat,
cd /var/lib/tomcat
tail -f logs/catalina.out
I can see the log in the console.
In Ubuntu,
cd /var/lib/tomcat6
tail -f logs/catalina.out
Nothing show out in the console.
May I know what is the problem? Which configuration that I need to look to?
Tomcat 7 Ubuntu Server 12.04 LTS:
tail -f /var/log/tomcat7/catalina.out
locate catalina.out and find out where is your catalina out. Because it depends.
If there is several, look at their sizes: that with size 0 are not what you want.
cd /usr/local/tomcat/logs
tail -f catalina.out
Sometimes it is located in different places. It depends on the server.
You can use find to find it:
find / -name catalina.out
If you encounter permission issues, add sudo to the command:
sudo find / -name catalina.out
That's all.
I hope this helps
I found mine at
~/apache-tomcat-7.0.25/logs/catalina.out
Try using this:
sudo tail -f /opt/tomcat/logs/catalina.out
It works for me on Ubuntu...
cd var/lib/tomcat7
sudo nano logs/catalina.out
I have used this command to check the logs and 10000 is used to show the number of lines
sudo tail -10000f catalina.out
Just logged in to the server and type below command
locate catalina.out
It will show all the locations where catalina file exist within this server.
Just be aware also that catalina.out can be renamed - it can be set in /bin/catalina.sh with the CATALINA_OUT environment variable.
If you are in the home directory first move to apache tomcat use below command
cd apache-tomcat/
then move to logs
cd logs/
then open the catelina.out use the below command
tail -f catalina.out
If you type in the command line
catalina
you will see some message about it, look for this:
CATALINA_BASE: /usr/local/Cellar/tomcat/9.0.27/libexec
cd /usr/local/Cellar/tomcat/9.0.27/libexec/logs
tail -f catalina.out
You will then see the live logs.
NOTE: My Tomcat installation was done via Homebrew
I found logs of Apache Tomcat/9.0.33 version in below path:
In tail -f /opt/tomcat/logs/catalina.out
Thanks.