Unable to run maven run in GitHub self hosted runner - docker

I created the GitHub Actions self-hosted runner in the Kubernetes cluster with the Maven base image.
But when I am running "mvn clean package" command I am getting "mvn not found error".
Even though I tried giving full maven path still i am getting the same error.
- name: Build with Maven
run: mvn clean package
Maven base image
FROM maven:3.6.0-jdk-11-slim
The error I am getting when I run GitHub Actions.
/runner/_work/_temp/6c9b0c85-4be9-4af0-b168-6dd5bdb998db.sh: line 1: mvn: command not found```

Related

How to run a maven build command using DSL script in Jenkins

I am trying to run a job through DSL script in jenkins. I am new to jenkins. Basically I want to run maven command to run my tests.
How to run maven command using DSL scripts.
Command: mvn test -Dcucumber.options="--tags #registration"
Here is the DSL scripts.But getting error.

Liquibase installation <PATH> in is not a valid Liquibase install

i am trying to run liquibase runner using jenkins, when i run it in jenkins master it works great using automatic install, but when i try to run it in a jenkisn agent it shows this error:
Liquibase home: /home/jenkins/agent/tools/org.jenkinsci.plugins.liquibase.install.LiquibaseInstallation/Liquibase
FATAL: Liquibase installation /home/jenkins/agent/tools/org.jenkinsci.plugins.liquibase.install.LiquibaseInstallation/Liquibase is not a valid Liquibase install
Build step 'Liquibase: Update Database' changed build result to NOT_BUILT ```
this is my configuration in the Global Tools Configurations:
[enter image description here][1]
this is my configuration in the freestyle job:
[enter image description here][2]
[1]: https://i.stack.imgur.com/3nt9n.png
[2]: https://i.stack.imgur.com/sSoYc.png

Error with Jenkins executing weblogic.jar

I am using jenkins with windows 10 and weblogic. I created a pipeline to connect git, compile with maven and weblogic deploy. When run the command sh 'java weblogic.WLST script.py' i have the error :
Could not find or load main class weblogic.WLST"
But when a run this command in prompt windows, i dont have problems. I have the environment variables JAVA_HOME and CLASSPATH.
Do I need to configure anything inside the jenkins to use this jar, weblogic.jar?

"Docker: command not found" from Jenkins on MacOS

When running jobs from Jenkinsfile with Pipeline syntax and a Docker agent, the pipeline fails with "Docker: command not found." I understand this to mean that either (1) Docker is not installed; or (2) Jenkins is not pointing to the correct Docker installation path. My situation is very similar to this issue: Docker command not found in local Jenkins multi branch pipeline . Jenkins is installed on MacOS and running off of localhost:8080. Docker is also installed (v18.06.0-ce-mac70)./
That user's solution included a switch from pipeline declarative syntax to node scripted syntax. However I want to resolve the issue while retaining the declarative syntax.
Jenkinsfile
#!groovy
pipeline {
agent {
docker {
image 'node:7-alpine'
}
}
stages {
stage('Unit') {
steps {
sh 'node -v'
sh 'npm -v'
}
}
}
}
Error message
docker inspect -f . node:7-alpine
docker: command not found
docker pull node:7-alpine
docker: command not found
In Jenkins Global Tool Configuration, for Docker installations I tried both (1) install automatically (from docker.com); and (2) local installation with installation root /usr/local/.
All of the relevant plugins appears to be installed as well.
I solved this problem here: https://stackoverflow.com/a/58688536/8160903
(Add Docker's path to Homebrew Jenkins plist /usr/local/Cellar/jenkins-lts/2.176.3/homebrew.mxcl.jenkins-lts.plist)
I would check the user who is running the jenkins process and make sure they are part of the docker group.
You can try adding the full path of docker executable on your machine to Jenkins at Manage Jenkins > Global Tool Configuration.
I've seen it happen sometimes that the user which has started Jenkins doesn't have the executable's location on $PATH.

Build postman collection using newman in Jenkins - No Result in Console

I am getting the Build: SUCCESS message on jenkins Console output, but not the detailed result like Iterations, executed vs failed etc.
i am using "newman run https://www.getpostman.com/collections/559ca99c65470714895de" as 'Execute Windows Batch Command'.
am i missing any plug-ins? please help?
The collection link you have provided is not valid.
Please make sure you have the following configurations before you run newman:
npm and node installed globally on jenkins.
If not refer to Node Installation
newman installed globally on the jenkins.
If not $ npm install -g newman
please execute the command on shell (not on Windows Batch Command)
Mention the cli reporter and exitCode to let jenkins know incase of any falure in the command as $ newman run <your collection goes here> -r cli --exitCode 1
Recommended: Create a node app and run your tests for advanced reporting and easy maintenance. Ex: Sample Newman Node Application with Custom Reporters

Resources