How to download previous build version ( a.b.c.d-1 ) if requested version ( a.b.c.d ) does not exist in artifactory - jenkins-plugins

How to download previous build version ( a.b.c.d-1 ) if requested version ( a.b.c.d ) does not exist in artifactory.
Using Artiffactory plugin in Jenkins pipeline.

You can use Jfrog CLI in your pipeline to do this, you don't need Jenkins Artifactory Plugin.
You can define your pipeline to download the artifact version that you want and if you have an exception (don't exist) you can download another version.
The command for donwload an antifact is:
jfrog rt dl my-local-repo/your-artifact-a.b.c.d.zip
You can catch exceptions in your pipeline with this code:
stage('Your stage') {
try {
//Your code for Jfrog CLI
jfrog rt dl my-local-repo/your-artifact-a.b.c.d.zip
} catch (Exception err) {
//Your additional code
}
}
You can viisit the official page of Jfrog CLI: Jfrog CLI Downloading files

The only working version so far is to try to download server.download(downloadSpec) each artifact in a loop ( a.b.c.d-- ) and check if files appeared in the file system.
Still looking for more elegant solution.

Related

Composer 2.5.1 Symfony Ux-React Failed to Download Webpack Encore Pack

I have a Symfony project that uses composer and react. I am trying to download the symfony/ux-react package with composer following this link: https://symfony.com/bundles/ux-react/current/index.html
However, when I run composer require symfony/ux-react I get the following error:
- Downloading symfony/webpack-encore-pack (v1.0.2)
0/1 [>---------------------------] 0% Failed to download symfony/webpack-encore-pack from dist: The "https://api.github.com/repos/symfony/webpack-encore-pack/zipball/f9f4e91659e5f55de370d6aebe77e64bce35e4d3" file could not be downloaded (HTTP/2 404 ):
{"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#download-a-repository-archive"}
Now trying to download from source
- Syncing symfony/webpack-encore-pack (v1.0.2) into cache
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+lex-Blade-15-Mid-2019-Base+2023-01-27+1205 to retrieve a token.
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+lex-Blade-15-Mid-2019-Base+2023-01-27+1205
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "/home/lex/.config/composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden):
I then create a token. Upon copy pasting it into the terminal:
Token stored successfully.
1/1 [============================] 100%
In Git.php line 471:
Failed to execute git clone --mirror -- 'https://ghp...PNs:x-oauth-basic#github.com/symfony/webpack-encore-pack.git' '/home/lex/.cache/composer/vcs/https---github.com-symfony-webpack-encore-p
ack.git/'
Cloning into bare repository '/home/lex/.cache/composer/vcs/https---github.com-symfony-webpack-encore-pack.git'...
remote: Repository not found.
fatal: repository 'https://github.com/symfony/webpack-encore-pack.git/' not found
Anyone know a fix for this? It appears that webpack-encore-pack is depreciated.
Spoke too soon. Found this link: https://github.com/symfony/symfony/discussions/42700
By uninstalling webpack encore with composer remove symfony/webpack-encore-pack and then trying composer require symfony/ux-react, no error occurred.

Using Jenkins with Eclipse and C - Lack of Examples

I'm trying to use Jenkins as a CI/CB system (unit testing included) using headless Eclipse/TrueStudio for embedded C. There doesn't seem to be many examples for this, and even the Jenkins site itself doesn't have an example Jenkins file. I've used a CI like CircleCI before, but that was a terrible experience as they were transitioning from CircleCI 1.0 to 2.0 and the specific setup i was using was largely devoid of material. I spent over 100 commits linking Android Studio, Git, and Firebase together. Anyone have a C/C++ based example Jenkinsfile I can look at?
So far I've got this as a Jenkinsfile:
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
I'm using one machine for this as the project is small in size. The code is stored in a git repo on the same machine. We're using TrueStudio which is modified Eclipse, and has a headless mode bat file.
One example from comments in bat file:
Example usage:
REM 1. Performs a rebuild on build configuration "config" for project "proj" in workspace "MyWorkspace".
REM Command: headless.bat -data C:\MyWorkspace -build proj/config
I'm currently working on syncing up the git repo and Jenkins.

Strange build failure when deploying GAE using gradle

Everything used to work fine until today. Didn't change anything as far as I know and now I get this:
C:\mypath>gradle appengineDeploy
> Configure project :
WARNING: You are a using release candidate 2.0.0-rc1. Behavior of this plugin has changed since 1.3.5. Please see release notes at: https://github.com/GoogleCloudPlatform/app-gradle-plugin.
Missing a feature? Can't get it to work?, please file a bug at: https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues.
> Task :appengineDeploy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':appengineDeploy'.
> Deployment version must be defined or configured to read from system state
1. Set appengine.deploy.version = 'my-version'
2. Set appengine.deploy.version = 'GCLOUD_CONFIG' to have gcloud generate a version for you.
3. Using APPENGINE_CONFIG is not allowed for flexible environment projects
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 6s
8 actionable tasks: 6 executed, 2 up-to-date
I just updated gradle from version 4.5.1 to 4.8.1 but the same issue remains. I understand it complains about version of the appengine but I never had to state that before so I think it's due to some update on Google's side. What am I missing?
You are now using the app-gradle-plugin version 2.0.0-rc1 as I can see from your console output, which was released 2 days ago. It has some changes, which the developers of the plugin documented.
As you can see in the Change Log of this release candidate from google, it mentions in the changes:
project and version are no longer pulled from the global gcloud state by default. project must be configured in build.gradle using the deploy.project property, users may use special keywords for project to specify that they would like to read it from appengine-web.xml (project = "APPENGINE_CONFIG") or from gcloud global state (project = "GCLOUD_CONFIG"). version is also configured the same way.
So you just have to specify in your gradle.build the following:
appengine {
deploy {
version = "GCLOUD_CONFIG"
project = "GCLOUD_CONFIG"
}
}
Update in 2.0.0-rc3 (Thanks to #wildcat12 for pointing it out)
in the latest version 2.0.0-rc3, the project configuration property has changed.
Changed appengine.deploy.project -> appengine.deploy.projectId
Therefore, now your gradle.build configuration would look like that:
appengine {
deploy {
version = "GCLOUD_CONFIG"
projectId = "GCLOUD_CONFIG"
}
}
If you are using
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'
line in your build.gradle file you are using the 2.0.0-rc3 release candidate version now. It is working well with last stable version: 1.3.5.

No interpreters available in Zeppelin

I have just installed the following on my Mac (Yosemite 10.10.3):
oracle java 1.8 update 45
scala 2.11.6
spark 1.4 (precompiled release: http://d3kbcqa49mib13.cloudfront.net/spark-1.4.0-bin-hadoop2.6.tgz)
zeppelin from source (https://github.com/apache/incubator-zeppelin)
no additional config, just copied created zeppelin-env.sh and zeppelin-site.xml from templates. no edits.
I Followed the installation guidelines: https://zeppelin.incubator.apache.org/docs/install/install.html
I have build zeppelin without problems:
mvn clean install -DskipTests
Started it
./bin/zeppelin-daemon.sh start
Opened http://localhost:8080 and opened the Tutorial Notebook.
Here is what happens when I refresh the snippets:
Here is the exception for the md interpreter in the webapp logs:
ERROR [2015-06-19 11:44:37,410] ({WebSocketWorker-8} NotebookServer.java[runParagraph]:534) - Exception from run
org.apache.zeppelin.interpreter.InterpreterException: **Interpreter md not found**
at org.apache.zeppelin.notebook.Note.run(Note.java:269)
at org.apache.zeppelin.socket.NotebookServer.runParagraph(NotebookServer.java:531)
at org.apache.zeppelin.socket.NotebookServer.onMessage(NotebookServer.java:119)
at org.java_websocket.server.WebSocketServer.onWebsocketMessage(WebSocketServer.java:469)
at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:368)
at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
Restarting the interpreter doesn't seem to cause errors.
Ok I have just found the answer, at the top of the tutorial there is a snippet about interpreter binding, click the save button and all start to work normally.

Unable to deploy app to App engine

I have a GWT based web application that I have previously uploaded to Appspot.
However now, I am getting this error:
Unable to update:
com.google.appengine.tools.admin.JspCompilationException: Failed to compile jsp files.
at com.google.appengine.tools.admin.Application.compileJsps(Application.java:583)
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:434)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:327)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:52)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:400)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
The application used JDK (not JRE)
There's a JSP file (dummy) on the war file
The application works in hosted mode
Do a clean build first. Alt+P, N in eclipse. If this fails, delete /war/WEB-INF/classes and try again. If this also fails, right click your war folder and select validate; this will tell you if there are any actual errors in your jsp files.
If this fails, your appengine jars may be corrupted. Try unzipping a fresh SDK and using it to deploy.
Also, have you changed java versions recently? Compiling JSPs requires JAVA_HOME points to a JDK, not a JRE. What is the result of echo $JAVA_HOME?
this thread will solve your problem
Cannot get the System Java Compiler. Please use a JDK, not a JRE
Other wise, you need to set your JAVA_HOME to point to your jdk folder and add javaw.exe path in your eclipse.ini

Resources