Go CD - how to set PATH on OS X? - macos

I'm trying to get various bin directories on the PATH for the Go Agent on OS X and I'm not having any luck. Googling around finds references to /etc/default/go-agent, which doesn't exist by default on the Mac and I can't find any documentation for OS X indicating that the Go Agent.app would use it if I created it.
Ideally, I don't want to modify anything like this and I'd rather manage the PATH through the Go Server UI - I see that I can set environment variables, but I can't find any docs on actually appending to the PATH - default UNIX syntax of $PATH:/some/new/path/bin doesn't work.
Any advice?

There are couple of ways to override PATH while starting the GoCD Agent app on OSX:
Overriding them during startup when starting from the terminal
PATH=$PATH:/usr/local/bin open /Applications/Go\ Agent.app
Overriding them using a file ~/Library/Application Support/Go Agent/overrides.env. This file is sourced during agent startup, and it can be setup to change environment variables.
PATH=$PATH:/usr/local/bin
Source: https://docs.go.cd/current/installation/install/agent/osx.html#overriding-default-startup-arguments-and-environment

Related

Disable symlink and mount path resolve in Mac

In mac (el captain), when a file is selected by browsing through a symlink path that points to network or mount point, and you show the file info, then the network path or device path is retrieved instead.
example:
if /nas is a symlink to nfs://nas/ifs/data, then the file info of /nas/projects will show by the system as:
nfs://nas/ifs/data/projects
then you cannot share this weird path with anybody else on windows or linux before you fix the weird information that meant to be kept hidden to the user for cleaner path.
So, is there a way I can disable this feature and mac and force it to always return the actual path regardless if this is a symlink or not?

nativescript installation don't work everywhere

i'm beginer in nativescript,i have correctly install ANDROID_HOME environment variable which return my sdk path after echo $ANDROID_HOME but despite this it return me The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android
but if i put my project in the same directory with sdk directory it return me
Cannot resolve the specified connected device by the provided index or identifier. To list currently connected devices and verify that the specified index or identifier exists, run 'tns device'
I also notice that after each computer restarting environment variable disappear and i must resume a same process , i have edit .profile file, .bashrc file and zshrc file for environnement variable i have a same result
please tell me what wrong ... thank in advance
my ~./bashrc file
export ANDROID_HOME=/home/user/Android/Sdk
export PATH=$PATH:/home/user/Android/Sdk/tools
export PATH=$PATH:/home/user/Android/Sdk/platform-tools
export LD_LIBRARY_PATH=/home/user/Android/Sdk/emulator/lib64
In /home/user/Android/Sdk should be tools and platform-tools folders.
That's enough for me. (Linux Mint 18)
Maybe this information will be useful to someone:
Linux environment variables configuration files
.bashrc
This file is a variable for a particular user. It is loaded every time the user creates a terminal session, that is, in other words, opens a new terminal. All the environment variables created in this file take effect every time a new terminal session begins.
.bash_profile
These variables take effect every time the user connects remotely over SSH. If this file is missing the system will look for .bash_login or .profile.
/etc/environment
This file is for creating, editing and deleting any environment variables at the system level. The environment variables created in this file are available for the entire system, for each user and even for a remote connection.
/etc/bash.bashrc
System bashrc. This file is executed for each user, each time he creates a new terminal session. This only works for local users, when connected through the Internet, such variables will not be visible.
/etc/profile
System file profile. All variables from this file are accessible to any user on the system only if he entered remotely. But they will not be available when creating a local terminal session, that is, if you just open the terminal.
All the Linux environment variables created with these files can be deleted only by removing them from there. Only after each change, you need to either log out and log in, or execute this command:
$ source file_name
So, the environment variable can be of three types:
Local environment variables
These variables are defined only for the current session. They will be irretrievably erased after the session is completed, whether it is remote access or terminal emulator. They are not stored in any files, but are created and deleted using special commands.
Custom shell variables
These shell variables in Linux are defined for a specific user and are loaded each time it logs in using the local terminal, or it is remotely connected. Such variables are usually stored in configuration files: .bashrc, .bash_profile, .bash_login, .profile or in other files located in the user's directory.
System environment variables
These variables are available throughout the system, for all users. They are loaded when the system starts from the system configuration files: / etc / environment, / etc / profile, /etc/profile.d/ /etc/bash.bashrc.
If you are using nvm to manage different nodejs version, then try disabling nvm and using only one global nodejs version.
Regarding the environment variables that are being volatile, make sure that you track down the proper profile file that is being parse and place your changes there.
It would help if you can be more specific about your current platform. Then, people will be able to respond with more precision.
hi i solve my problem by adding in profile file environnement variable
export ANDROID_HOME=~/Android/Sdk
export ANDROID_HOME=~/Android/Sdk/tools
export ANDROID_HOME=~/Android/Sdk/platforms-tools
then i erased all path generate by all commands line entries from my terminal in .bashrc file(i think that it was that the problem source) . finally it work well thanks a lot to everybody for your helps

Axis 2 can't see JAVA_HOME on my Mac (soapUI and wsdl2java)

Question : Why can Axis 2 not see where Java home is? Have I set it incorrectly?
Summary : I'm attempting to use Axis 2 with soapUI to generate Java objects from a wsdl on my Mac. However, I get the error "You must set the JAVA_HOME variable before running Axis2 Script."
If I type echo $JAVA_HOME into the command line, it says
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
I've navigated to the JavaVirtualMachines folder and the jdk is indeed there.
I also have edited ~/.bash_profile to say
export JAVA_HOME=$(/usr/libexec/java_home)
Another solution would be to start SOAP UI from the terminal as your .profile will be already loaded.
open -a /Applications/SoapUI-x.x.x.app/
Are you launching SoapUI by clicking on an icon? In that case, SoapUI wouldn't necessarily have access to environment variables set in your bash startup scripts.
Take a look at this question and this one about setting environment variables so that they're accessible to GUI apps. Basically, you may have to modify some system-wide configuration files.

‘ant’ is not recognized as an internal or external command

I have the same issue as this user: ant - not recognized as an internal
however unfortunately none of the solutions have worked for me in that post or any other. I've also looked at other commands not recognized and specifically adding a path variable. The procedure I am using is as follows:
Extract to a desired installation directory, e.g. C:\apache-ant
Create an ANT_HOME environment variable`
Open System Properties -> Advanced -> Environment Variables
Create a new system variable
Variable name: ANT_HOME
Variable value: C:\apache-ant
Add %ANT_HOME%\bin directory to the PATH system variable
Open System Properties -> Advanced -> Environment Variables
Under system variables, select PATH and append ;%ANT_HOME%\bin
e.g. %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%ANT_HOME%\bin
Verify that ANT is installed.
Open a new command window and type:
C:\>ant -v`
In my case the Variable value is C:\apache-ant\apache-ant-1.8.2.
My exact path variable is %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%ANT_HOME%\bin which doesn't have any spaces between semicolons.
However testing the ant installation does not work, the picture below is what I'm experiencing:
I have tried restarting on numerous occasions to no avail. I have run out of ideas, so if anyone has any any information would be helpful. Thanks!
EDIT
Posted results of dir:
ANT_HOME is not being resolved. Change %ANT_HOME%\bin in the Path system environment variable to c:\apache-ant\apache-ant-1.8.2\bin.
I had a similar issue, but the reason that %ANT_HOME% wasn't resolving is that I had added it as a USER variable, not a SYSTEM one. Sorted now, thanks to this post.
create a script including the following;
(replace the ant and jdk paths with whatever is correct for your machine)
set PATH=%BASEPATH%
set ANT_HOME=c:\tools\apache-ant-1.9-bin
set JAVA_HOME=c:\tools\jdk7x64
set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%
run it in shell.
When Environment variables are changed log off and log in again so that it will be applied.
I downloaded ant (http://ant.apache.org/bindownload.cgi), unzipped to my C drive, and used the windows 'doskey' command:
doskey ant=C:\apache-ant-1.9.6\bin\ant.bat $*
this will work as long as you use the same command console, to make it permanent is more difficult: http://darkforge.blogspot.com/2010/08/permanent-windows-command-line-aliases.html
Please follow these steps
In User Variables
Set VARIABLE NAME=ANT_HOME VARIABLE PATH =C:\Program Files\apache-ant-1.9.7
2.Edit User Variable PATH = %ANT_HOME%\bin
Go to System Variables
Set Path =%ANT_HOME%\bin
Had the same problem. The solution is to add a \ at the end of %ANT_HOME%\bin so it became %ANT_HOME%\bin\
Worked for me. (Should be system var)
even with the environment variables set, I found that ant -version does not work in scripts. Try call ant -version
Need to see whether you got ant folder moved by mistake or unknowingly.
It is set in environment variables.I resolved this once as mentioned below.
I removed ant folder by mistake and placed in another folder.I went to command prompt and typed "path". It has given me path as "F:\apache-ant-1.9.4\".
So I moved the ant back to F drive and it resolved the issue.
If none above helped anyone...My issue was that I was trying to use ant -version on a cmd prompt that I had already opened before I added apache-ant to the path.
As the cmd prompt was using the PATH it had when it was opened and not the new one (that had apache-ant) it wasn't finding it.
Opening a new cmd and running ant -version showed me I actually did have it installed correctly.
I got same problem , what I did for fix :
Open system environment variable
Click on environment variable
in user varaible -> edit path and then add C:\FolderWhereYouInstalled\ant\ant_1.8.4\bin
Click ok
Open cmd and type : ant -version
thanks, might help someone :)

CakePHP Console via Cron Question

I'm using the CakePHP Console to download files from we and processed in a database. I'm running the console from inside the "app" directory. But when I'm trying to run the console outside app and by just setting the "-app" parameter for my cron job, it doesn't work.
To be honest, I've had no success using -app parameter. It's like it's not working at all.
By the way, I'm using Windows & Pycron for my cron jobs.
Here's what happens when I'm trying to run the console from D:\
D:\>web\elink\cake\console\cake -app D:\web\elink\app
Welcome to CakePHP v1.2.2.8120 Console
---------------------------------------------------------------
Current Paths:
-app: app
-working: D: -app D:/web/elink/app
-root: D: -app D:/web/elink
-core: D:\web\elink
Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
Available Shells:
D:\web\elink\vendors\shells:
- none
CORE\console\libs:
acl
api
bake
console
i18n
schema
testsuite
To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'
My shells are located at D:\web\elink\app\vendors\shells.
I have managed to reproduce this issue using versions 1.2.2.8120 and 1.2.3.8166 on Windows. The -app parameter doesn't seem to work at all as expected.
The console will only list global shells in the /vendors/shells folder and not application-specific ones located in /app/vendors/shells or in plugins (/app/plugins/plugin_name/vendors/shells).
The -app parameter works as expected on OpenSUSE, listing all available application-specific shells (including those in plugins).
Unless we are doing something incorrectly, it is probably worth opening a ticket on Trac about this issue.
A workaround would be to add your Cake console directory to the Windows PATH environment variable.
Open 'System Properties' (Start key + Pause/Break key)
Open 'Advanced' tab
Click 'Environment Variables'
Select the PATH variable in the 'System variables' section
Press 'Edit'
Append ;E:\web\elink\cake\console\ to the 'Variable value'
Press 'Okay' on all dialogs
Close all open cmd prompts
You can then set up pycron to run E:\web\elink\cake without the -app parameter and all your application-specific shells should be available.
-For the people having the same problem but on linux systems, here there is an easy solution:
http://book.cakephp.org/complete/3/The-Manual#Running-Shells-as-cronjobs-846
-Another alternative solution for any system would be to create a simple script with two lines like this:
cd /path/to/app
/path/to/cake
-Both solutions worked for me in a Cent0S and in a MacOS based machines.

Resources