go-cd pipeline cannot execute custom command - sbt

I have ubuntu and go-agent/server on it, I have defined task:
<exec command="/bin/sh" >
<arg>-c</arg>
<arg>sbt test</arg>
</exec>
Sbt is available from terminal, so I easily can run this commands from terminal:
sbt test
and
/bin/sh -c 'sbt test'
but when I run the pipeline, I got an error:
[go] Start to execute task: <exec command="/bin/sh" >
<arg>-c</arg>
<arg>sbt test</arg>
</exec>.
[go] setting environment variable 'GO_SERVER_URL' to value 'https://127.0.0.1:8154/go/'
[go] setting environment variable 'GO_TRIGGER_USER' to value 'anonymous'
[go] setting environment variable 'GO_PIPELINE_NAME' to value 'poll-app'
[go] setting environment variable 'GO_PIPELINE_COUNTER' to value '60'
[go] setting environment variable 'GO_PIPELINE_LABEL' to value 'poll-app.1.0.60'
[go] setting environment variable 'GO_STAGE_NAME' to value 'build-test-stage'
[go] setting environment variable 'GO_STAGE_COUNTER' to value '1'
[go] setting environment variable 'GO_JOB_NAME' to value 'build-test-job'
[go] setting environment variable 'GO_REVISION_POLL_APP_GIT' to value '13b313a2ed32f260ebfecfb18e34ac10123353bf'
[go] setting environment variable 'GO_TO_REVISION_POLL_APP_GIT' to value '13b313a2ed32f260ebfecfb18e34ac10123353bf'
[go] setting environment variable 'GO_FROM_REVISION_POLL_APP_GIT' to value '13b313a2ed32f260ebfecfb18e34ac10123353bf'
[go] overriding environment variable 'PATH' with value '$PATH:/var/lib/go-agent/pipelines/poll-app'
/bin/sh: 1: sbt: not found
What could be a problem?

Problem was about the PATH, I should not to override it in pipeline configuration.

Related

Missing environment variables of connections

I added connection to s3 from UI
enter image description here
and supposed to see AIRFLOR_CONN_S3_CONN in my env variables due to https://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html, but it didn't show up
(I used BashOperator with printenv command to see all env variables but didn't find any AIRFLOR_CONN_). What can be the problem?
I'm using Airflow 2.2.5

Robot Framework:How to access a global variable from __init__ file

I have a __init__.csv file under Suit folder, and int this __init__.csv file I try to access a global variable which is defined in a resource file, but it reports "FAIL : Variable '${WORKSPACE_BASE_DIR}' not found".
Here's my code in __init__.csv
*Settings*
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
Resource ../Resource/variables.tsv
Library SSHLibrary
*Keywords*
Setup Test Environment ${path}= Join Path ${WORKSPACE_BASE_DIR} ssh.log
Enable SSH Logging ${path}
Cleanup Test Environment Close All Connections
Code in variables.tsv
*Settings*
*Variables*
${ENVNAME} Windows
*Keywords*
Linux Set Global Variable ${WORKSPACE_BASE_DIR} a linux path
Windows Set Global Variable ${WORKSPACE_BASE_DIR} a windows path
Can someone tell me where goes wrong?
In the code you provided, you only set that variable if you call the Linux or Windows keyword. You're not calling either of those keywords anywhere.

Unable to run shell script from test case

I'm trying to invoke a shell scrip from within a .robot test case.
The .sh file is in the same folder as the .robot file
*** Settings ***
Library Process
*** Test cases ***
Run the shell script
Start Process ./getIDfromDB.sh shell=yes
I'm getting the error:
Setting variable 'Start Process ./getIDfromDB.sh' failed: Invalid variable name 'Start Process ./getIDfromDB.sh'.
Running on Ubuntu
Researched documentation for Robot framework but could not find a solution. Maybe digging in the wrong spot.
I'm not sure how you are trying to set the path of the shell script in the robot file. The error message seems to convey that something is wrong with the way you're initialising the variable to hold the path.
The following code should work:
*** Settings ***
Library Process
*** Variables ***
${pathToScript} ./getIDfromDB.sh
*** Test cases ***
Run shell script
${output} Run process ${pathToScript} shell=yes
The return code and the output displayed in the terminal are stored in the ${output} variable. You can access the details as ${output.rc} and ${output.stdout} respectively.
You can find more details about the result object here.
According error details the keyword is not recognized, I think, you need add extra spaces after keyword name:
Start Process ./getIDfromDB.sh shell=yes

Error in locking authority file for parallelisation with qmake

I work with Rscript on a cluster. qmake (a specialized version of GNU-make for the cluster) is used to parallelize jobs on several nodes. But Rscript seems to need to write a Xauthority file and it creates an error when every nodes work in the same time. In this way, my makefile-bases pipeline stops after the first group of parallelized tasks and don't start the next group of tasks. But the results of the first group are ok.
I'm also invoking usr/bin/xvfb-run ( https://en.wikipedia.org/wiki/Xvfb) when runnning RScript.
I've already changed the ssh-config (FORWARD X11 yes) but the problem persists.
I also tried to change the name of Xauthority file for each job but it didn't work (option -f in Rscript).
Here is the error which appear at the beginning of the process
/usr/bin/xauth: error in locking authority file .Xauthority
Here is the error which appears before the process stops :
/usr/bin/xvfb-run: line 171: kill: (44402) - No such process
qmake: *** [Data/Median/median_B00FTXC.tmp] Error 1

Trouble setting Environment variable ORACLE_HOME

I have a fresh installation of Oracle 11g client.
I am having trouble using tnsping. It is giving an error:
Message 3511 not found; No message file for product=NETWORK, facility=TNSTNS-0
05: Message 3505 not found; No message file for product=NETWORK, facility=TNS
I have set the Environment variable for ORACLE_HOME as follows:
D:\oracle\product\11.2.0\client_1\BIN
I am not sure what should be exact path for ORACLE_HOME .
How to identify what is the exact path for ORACLE_HOME directory?
Is it D:\oracle\product\11.2.0\client_1 ? or D:\oracle\product\11.2.0\client_1\BIN
Any suggestions or solutions ?
Your ORACLE_HOME should be D:\oracle\product\11.2.0\client_1, assuming that is where you installed the software. The BIN directory under it should be in PATH.
Read more about ORACLE_HOME
The value should be set in the registry by the installer, along with other environment variables that have to be set manually in Unix.
also just had this issue on a server, the oracle install seemed to have got a bit screwed, reinstalled, still same error, then discovered an erroneous space at the front of the env variable, space removed, server rebooted, all good again
run > rededit > HKEY_LOCAL_MACHINE>SOFTWARE > ORACLE> KEY_OraClient19Home1
and Edit the following
ORACLE_HOME browse to the folder where all the files are located(ASP.NET,bin etc)
you should be good to go!

Resources