How to download a jar file from ansible - java

I want to download a jar by using ansible. I want to write a play books to download a jar file.help me out.
How to download a jar file by using ansible code?

This may not be the answer you want.
playbook.yml
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: download jar
get_url:
url: http://ftp.jaist.ac.jp/pub/apache//commons/io/binaries/commons-io-2.6-bin.tar.gz
dest: ./commons-io-2.6-bin.tar.gz
$ ansible-playbook playbook.yml

Related

Build Flatpak from Java application

I'm currently working on DXVKoTool, a Compose application built with Kotlin.
As I want it to be easily available on the Steam Deck, I try to build a Flatpak off it.
Basically what I wanted to do is packaging it (with jpackage) and use the built binaries when building the Flatpak.
My building process would look like this:
./gradlew packageAppImage
flatpak-builder build/release/main/flatpak dev.datlag.DXVKoTool.yml --force-clean
The packageAppImage command produces an output like this:
{project-dir}
|-build
|-release
|-main
|-app
|-DXVKoTool
|-bin
| |-DXVKoTool {executable}
|-lib
|-{resources, binaries, etc.}
However building the Flatpak is somehow driving me crazy and I'm not sure what's wrong.
My flatpak build YAML file:
app-id: dev.datlag.DXVKoTool
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: DXVKoTool
modules:
- name: dxvkotool
buildsystem: simple
build-commands:
- mkdir -p /app/lib/
- install -Dm755 ./build/release/main/app/DXVKoTool/bin/DXVKoTool /app/bin/DXVKKoTool
- cp -R ./build/release/main/app/DXVKoTool/lib/* /app/lib/
sources:
- type: file
path: ./build/release/main/app/DXVKoTool/bin/DXVKoTool
- type: dir
path: ./build/release/main/app/DXVKoTool/lib/
When I run the flatpak-builder command, it's stopping with the following error:
Emptying app dir 'build/release/main/flatpak'
Downloading sources
Starting build of dev.datlag.DXVKoTool
Cache hit for openjdk, skipping build
Cache miss, checking out last cache hit
========================================================================
Building module git in /home/jeff/Projects/Multiplatform/DXVKoTool/.flatpak-builder/build/git-1
========================================================================
Running: mkdir -p /app/lib/
Running: install -Dm755 ./build/release/main/app/DXVKoTool/bin/DXVKoTool /app/bin/DXVKoTool
install: cannot stat './build/release/main/app/DXVKoTool/bin/DXVKoTool': No such file or directory
When I change the config to the following:
app-id: dev.datlag.DXVKoTool
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: DXVKoTool
modules:
- name: dxvkotool
buildsystem: simple
build-commands:
- mkdir -p /app/lib/
- install -Dm755 DXVKoTool /app/bin/DXVKoTool
- cp -R lib/* /app/lib/
sources:
- type: file
path: ./build/release/main/app/DXVKoTool/bin/DXVKoTool
- type: dir
path: ./build/release/main/app/DXVKoTool/
The building works but after installing the outcome it doesn't start with this error:
bwrap: execvp DXVKoTool: No such file or directory
Would be nice if someone can help me building the Flatpak.

Concourse CI + MVN

I am trying to create a pipeline using Concourse CI using Maven. The pipeline should:
Get the code from git.
Build and run test using maven.
the project generates html report in target folder
above steps are executing properly. The question how to access the output i.e target folder generated by the maven project.
I am not able to access the generated folder and copy to the required folder for later usage.
File pipeline.yml:
resources:
- name: branch-master
type: git
source:
uri: {{git-url}}
branch: master
jobs:
- name: MavenJob
serial: true
plan:
- get: branch-master
trigger: true
- task: mvn-test
privileged: true
file: branch-dev/AppDemo/test.yml
File test.yml:
platform: linux
image_resource:
type: docker-image
source:
repository: maven
tag: latest
inputs:
- name: branch-master
outputs:
- name: mvn-output
run:
path: "mvn"
args: ["-f", "branch-master/AppDemo/pom.xml", "test"]
Please some body help me.
Thanks in advance.
For sake of simplicity and unambiguity I renamed your git repo to project. Let's assume it contains concourse's yamls. And there is a directory AppDemo with java-maven app
project/pipeline.yml:
resources:
- name: project
type: git
source:
uri: {{git-url}}
branch: master
jobs:
- name: MavenJob
serial: true
plan:
- get: project
trigger: true
- task: mvn-test
privileged: true
file: project/test.yml
the job above should locate and trigger the test.yml task
project/test.yml:
platform: linux
image_resource:
type: docker-image
source:
repository: maven # let's hope bin/bash is available there. if no, use sh
tag: latest
inputs:
- name: project # project is your git-repo. all paths are relative to it's location
outputs:
- name: mvn-output
run:
path: /bin/bash
args:
- project/test-script.sh:
project/test-script.sh:
_ROOT=$(pwd)
echo "starting test-script from directory: $ROOT"
cd _ROOT/AppDemo
mvn test
if you want to pass outputs of maven job somewhere further, then you should just copy all those files into mvn-output directory later in the script.
I would also recommend using this bash-script as wrapper rather than raw "maven call" - it's more convenient for debugging the whole process as you can, e.g. echo'ing paths.
in case of any error, if container still alive, try hijacking into it to see what has actually happened there and where files are located:
fly -t <target> hijack -u <url-of-failed-job-from-your-browser>
hope this helps

ERROR: `elasticsearch` directory is missing in the plugin zip

After i triggered the install command for ingest-attachment-6.3.0 plugin installation, i got an error saying that elasticsearch directory is missing in the plugin zip
I have install elasticsearch 6.2.3 version.
Please find the error details below.
D:\1SearchEngine\elasticsearch-6.2.3\elasticsearch-6.2.3>bin\elasticsearch-plugi
n install file:///d:\1SearchEngine\ingest-attachment\ingest-attachment-6.3.0.zip
-> Downloading file:///d:\1SearchEngine\ingest-attachment\ingest-attachment-6.3.
0.zip
[=================================================] 100%  
ERROR: `elasticsearch` directory is missing in the plugin zip
D:\1SearchEngine\elasticsearch-6.2.3\elasticsearch-6.2.3>
Unzip ingest-attachment-6.3.0.zip archive and check if there is no another archive inside.
Or, if you have internet connection, just use sudo bin/elasticsearch-plugin install ingest-attachment

Java export server : (SVGConverter.java:convert:108) responce : ReferenceError: Can't find variable: Highcharts

System : windows 10 and AWS EC2
I have follow below steps:
install jdk
install tomcat8
install maven
PhantomJS
Updated app-convert.properties according to system (windows/linux)
Added new required highchart java-script files in diectory /phantomjs
Updated required java-scripts files names in resources.json
Export war/ install export server from repository
Deploy war in tomcat/ start server using mvn jetty:run
On preview server logs error
[ERROR] [http-nio-8080-exec-25 05:19:49] (ExportController.java:writeFileToStream:356) Tried to read file from filesystem: File '/tmp/tomcat8-tomcat8-tmp/export4935023327417038147/output/UOBhqYub.png' does not exist
So I debug Server.java, server is responding as
"ReferenceError: Can't find variable: highcharts".
(SVGConverter.java:convert:108) responce json: ReferenceError: Can't
find variable: Highcharts
I have added required js files in resource/phontomjs directory and mentioned these files in resources.json.
GitHub issue
Please correct me if I am missing anything.
My bad, my stupid mistake, I was using old version of highchart java-scripts files.

Using Gitlab pages to publish jar file

I am using gitlab.io. I have a Java project which builds using Maven.
I have setup the following yml file to do the builds:
image: maven:3-jdk-7
build:
script:
- "mvn install -B"
- mkdir .public
- cp -r ./gl_pages/* .public
- mv ./target/MyProg_installer-0.0.1-SNAPSHOT.jar .public/Prog_Latest.jar
- mv .public public
artifacts:
paths:
- public
only:
- master
If I go to the following URL's I can see index.html without a problem.
https://<<MYUSER>>.gitlab.io/<<MY_PROJECT>/
https://<<MYUSER>>.gitlab.io/<<MY_PROJECT>/index.html
I expected
https://<<MYUSER>>.gitlab.io/<<MY_PROJECT>/Prog_Latest.jar
to enable me to download the jar file, but this url simply returns a 404.
I have downloaded the zip of the artifacts from the build and this works without an issue.
Am I doing something wrong?

Categories

Resources