custom shell script: github keeps asking for password - shell

I would like to know how to stop GitHub from asking for password over and over while running a custom shell script.
I have an installation script for a project. It installs cordova plugins from private GitHub repositories. The file goes like this:
...
cordova plugin add https://github.com/some/repo1.git
cordova plugin add https://github.com/some/repo2.git
cordova plugin add https://github.com/some/repo3.git
cordova plugin add https://github.com/some/repo4.git
...
For every line that gets executed, the shell prompts for password. Is there a way to authenticate only once?

You must use ssh urls instead of https.
cordova plugin add git#github.com:owner/repo1.git
cordova plugin add git#github.com:owner/repo2.git
cordova plugin add git#github.com:owner/repo3.git
cordova plugin add git#github.com:owner/repo4.git
Here is how to initialize your ssh configuration: https://help.github.com/articles/generating-ssh-keys/

Related

Github Actions worklow fails pushing container image to GHCR using the gradle jib plugin

Has anybody a working example of how to push a container image into a ghcr using the jib gradle plugin from within a github actions workflow?
I've tried the whole day but whatever combination of password or tokens I try I always end with the jib plugin complaining about an invalid authentication. Although I can push to the ghcr from my local computer with gradlew jib.
Really, I would be very thankful for any help.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Build image failed, perhaps you should make sure you have permissions for ghcr.io/tobias-neubert/eclipse-temurin and set correct credentials. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-forbidden-or-denied for help
You have to
allow your repository access to the package (github profile page -> Packages -> Package Settings)
Set the write permission for the GITHUB_TOKEN in your workflow (permissions.packages: write)

Maven Selenium project Execution Not visible with Jenkins build Now

I am using selenium maven project with Jenkins and when I run build now, execution is running in background for which I am able to see output in consol but my browser and all execution on browser is NOT visible.
I tried searching around and change Jenkins service by checking allow window interaction checkbox but still not able to view it. I m running on window 10 and running with local(http://localhost:8080). I tried with Chrome, firefox & IE and all have same behavior of Not visible.
I used command "mvn clean test" in Build - Execute Windows batch command.
Same project is running with Eclipse & CMD very well with visible execution.
I am using Jenkins version 2.46.3.
Anyone experienced this? Any idea ?
Run Jenkins or slave from command line using war or jar provided, other option to try: check 'Allow service to interact with desktop' in Services.
After lots of search & troubleshoot, I found solution as I installed Jenkins as Window version (.exe) so I uninstalled it and downloaded Jenkins from official jenkins website(https://jenkins.io/download/) by clicking on Generic Java Package(.war) and then went into Command prompt and went to path where my Jenkins.war file dowloaded and install using java -jar jenkins.war and reregister with different accountname and password (created new account so it won't pull up the old account) and the Execution started DISPLAYING ON BROWSER. Hope this helps.

NativeScript - How to add plugin to "angular-seed" template

I've cloned the following Github repo to bootstrap my NativeScript application.
https://github.com/mgechev/angular-seed
I now want to run to the following command to add a toast message plugin.
tns plugin add nativescript-toast
However, I get the following error when I run the command.
No project found at or above 'C:\src\angular-seed' and neither was a --path specified.
I've tried running the command from the directory with the package.json file and the "src/client" directory as well.
Does anyone know what I'm doing wrong?
This repository https://github.com/mgechev/angular-seed support only Angular.
You should be using this repository Angular seed advanced
https://github.com/NathanWalker/angular-seed-advanced
To install the plugin:
cd nativescript && tns plugin add nativescript-toast

Is there a Maven way to deploy a Java App (not a WebApp)?

I am developing a simple command line application. I would like to use CloudBees to:
Git repo (OK, even a private one)
Jenkins Continuous Build (OK, trigger the build when I push to the repo, perfect)
Deploy to RUN#Cloud (OK, but painful SDK installation)
My question would be: is there a way to deploy a Java App (not a Web App) with the Maven CloudBees plugin ? (It is also to record my experience).
Running a raw Java container is documented: http://developer.cloudbees.com/bin/view/RUN/Java+Container
The bees-maven-plugin is documented here: https://developer.cloudbees.com/bin/view/RUN/MavenGuide . But the plugin does not seems to do all what the SDK can do. So I couldn't use it in Jenkins.
What I did is adding a "Script Shell / Post build step" in the Jenkins job. With the following script:
. /private/brnvrn/scripts/setup-sdk
bees app:deploy -a brnvrn/gdataaccess -t java -R class=com.brnvrn.test.Main -R classpath=gdataaccess.jar target/gdataaccess-1.0-SNAPSHOT.jar waitForApplicationStart=false
How to install the SDK in Jenkins is explained here: http://wiki.cloudbees.com/bin/view/DEV/Scripting+Bees+SDK+in+Jenkins and here is how to mount DAV directory: http://wiki.cloudbees.com/bin/view/DEV/Mounting+DAV+Repositories. (Just be aware that the files you upload in /private/ will be available in /private/$account_name/ ...
I managed to make it work and then realized that there is really no point to deploy a command line App to RUN#Cloud. Still I would like to known if the bees-maven-plugin would be able to do the job without all the SDK installation trouble.
The CloudBees maven plugin only supports deployment of WAR files. As an alternative, you can use the CloudBees Deployer plugin for Jenkins to setup a post-build action to deploy the JAR artifact (this is pre-installed in DEV#cloud Jenkins instances). You can also use the CloudBees SDK to deploy your JAR artifact (bees app:deploy -a APPID JAR_FILE)

Hudson NSIS plugin

I have an asp.net solution. I have installed Ms build plugin to build it. The job is successfully building. Now i want to achieve two things using hudson.
1. Once the build completes, I want to publish the solution.
2. How can I attach existing NSIS script for the creation of windows installer. Is there any specific plugin for NSIS in hudson?
Kindly help me.
There is a plugin:
https://github.com/Elbandi/nsis-plugin
Now trying to use / enable / configure it on my company CI server ...
In your MSBuild file you could have a target that calls Exec to invoke MAKENSIS.EXE
I myself found the solution for this problem.
After the Build stage add Execute windows batch command section.
Here we can add the asp.net web application pulishing command.
For instance call:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe" -v /ABC1 -p "F:\TEST" -f -fixednames "%hudson_home%\source" -c
Here F:\TEST is the target location and %hudson_home%\source is the source location.
After this we can call our NSIS script using makensis.exe, e.g.:
makenis.exe tst.nsi
Done..!!

Resources