fizzed / stork Goto Github PK
View Code? Open in Web Editor NEWLaunch and deploy your Java apps
Launch and deploy your Java apps
I went more in deep into your project and wanted to test stork-fabric-deploy. I only see a Linux command line tool for this command where other commands have a windows batch equivalent (http://puu.sh/gkq8i/69273c738b.png). I imagine because it use ssh to push etc. Do you think that there is a way to use stork-fabric-deploy from a windows dev environnement to a linux prod test env ?
It would be good to have this also available as a Gradle plugin :)
I am using the plugin to package an application. The problem I am having is that it seems to want to create a server.out log file. I really don't need this file. Is there a way of telling the script not to create a server.out file?
Starting from JDK 9 we may need to add option --add-opens
to the application, but if user has JDK 8 installed it won't launch because JDK 8 is not aware of such option.
Hi
How can I define how many releases I wan to keep?
Due to having an issue with the maven plugin with a java 11 target app I realized that there are no commits in master over the last year. Is the project still maintained?
Do you need help with anything?
!JAVA_IN_PATH! is not quoted, causing it to fail if there are spaces in the path:
If attempting to deploy a production version (e.g. no -SNAPSHOT) at end of a tarball then warn if it already exists on target server. Add a command-line option of --force or -f to force a re-deploy of an existing version.
We are using Datadog java agent in JAVA_TOOL_OPTIONS environment variable:
export JAVA_TOOL_OPTIONS="-javaagent:dd-java-agent.jar -Ddd.writer.type=LoggingWriter"
This means that when stork tries to discover java versions, the java version parsing algorithm sometimes fails due to the extra output from datadog java agent:
❯ export JAVA_TOOL_OPTIONS="-javaagent:dd-java-agent.jar -Ddd.writer.type=LoggingWriter"
❯ java -version 2>&1 | grep "version" | awk '{print $3}' | tr -d \"
10:16:24:649
10:16:24:650
10:16:24:650
22.0.1
If the output from datadog java agent is the last and not the java version, the bash script fails with:
❯ ./stork-demo-hellod
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
./stork-demo-hellod: 496: [: Illegal number: 14:14:03:228
Unable to find Java runtime on system with version >= 1.6
Try running 'sudo apt-get install openjdk-6-jre-headless' or
Visit http://java.com to download and install one for your system
Environment:
This error occurred after packaging a Jooby app which uses the jooby-stork plugin
https://github.com/jooby-project/jooby/blob/2.x/pom.xml#L151
which uses stork 3.1.0
Steps:
jooby create test --stork
cd stork
platforms: [ WINDOWS ]
mvn clean package
\bin\test.bat --install
bin\test64.exe is not compatible with the version of Windows you're running.
Check your computer's system information and then contact the software publisher.
I was testing stork and I did a few deploys to a server. Is there a way to uninstall all or some specific versions?
How can I add files to conf/
I tried to create src/main/conf/foo.conf to see if it was packed in tar.gz
Hi,
I'm trying to figure out how to generate a systemd init script using Stork, but I can't figure out how to use it. Would it be possible to have a step by step manual on how to proceed?
I have akamai-cefconnector, a java program that need to be run as a service (daemon) on Linux.
Folder structure is :
./bin/CEFConnector-1.6.0.jar
./config/[CEFConnector.properties, log4j2.xml]
./lib
./logs
I just need to generate the systemd init script to operationalise it.
Thank you!
Hi,
When I use stork-deploy via ssh to another machine, it keeps asking for sudo password. Is there anyway to avoid this ? Or, if I can input the password in the command?
Thanks.
Hello,
I'm very interested in trying this one on my production servers for deploying, however I wonder if it was possible to choose between init and systemd, as my target is RHEL.
I'm using type: CONSOLE
, so my service only has :
[Unit]
Description=myapp sample application
After=syslog.target network.target
[Service]
ExecStart=/opt/folder/myapp/bin/myapp
[Install]
WantedBy=multi-user.target
I think we should add Restart=always
and of course application must be configure with working_dir_mode: APP_HOME
!
Still need to find how to configure for type: DAEMON
.
Other things that would be cool:
What do you think ?
I am trying to implement stork in my spring boot application. I am passing my main class method in stork configuration file (.yml). Stork files are getting generated. When I am trying to install and start the application. It is saying "noclassdeffounderror". It is not able to find the main class.
It took me quite a while to figure out how to specify a user and group for the generated systemd service file in the stork.yml launcher definition. I eventually found it in one of the example files, but it doesn't appear to be documented anywhere.
Here's the example I found, but I don't know if this is all of the available options for this section:
platform_configurations:
LINUX:
daemon_method: NOHUP
user: "daemon"
group: "daemon"
MAC_OSX:
user: "_daemon"
group: "_daemon"
WINDOWS:
daemon_method: JSLWIN
After stork-fabric-deploy has completed its work (either successfully or error) the temporary "work" directory should be automatically cleaned up.
A Spring Boot demo & stork is attached.
Pack with the command $./mvnw clean package is ok.
The jar file can be run by $java -jar xxx.jar, but the stork script failure to start.
The error info is :
$ ./target/stork/bin/hello-server --run
Error: Could not find or load main class com.example.demo.DemoApplication
Could anyone help me, thank your!
demo.zip
Hi Joe,
how are you doing :-)
I started using stork-deploy to deploy our java apps and I really like it. It's so simple. Single dependency is Java. Goodbye ansible 👍
I found a minor issue with the current version of stork-deploy. The changelog states (for version 2.6.0)
stork-deploy: New retain option to only retain a specified number of past versions after a successful deploy.
but the option is missing when looking in the code. The DeployOptions class has already the field, but the DeployMain class is missing the parameter.
I could provide a PR if you like containing that little fix.
Cheers,
Marvin
When we need to pass multiple java arguments, should they be all specified in a single set of quotes, or as a comma separated list in square brackets?
java_args: "-Dtest=foo -Dopt2=abc"
or
java_args: ["-Dtest=foo", "-Dopt2=abc"]
When setting memory by percentage of system, program can't start and report below error:
Unable to detect system memory to set java max memory
It seems that on Catalina below line is incorrect:
local mem_bytes=`sysctl -a 2>/dev/null | grep "hw.memsize" | head -n 1 | awk -F'=' '{print $2}'`
should it be the same as freebsd?
local mem_bytes=`sysctl -a 2>/dev/null | grep "hw.memsize" | head -n 1 | awk -F'[:=]' '{print $2}'`
I am trying to use stork 2.0.0 in a ninja framework/maven based API project deployed to a staging environment on Ubuntu 14.04 with stork-deploy. When the application is about to start (at deploy or started by hand) I get the following errors:
Starting ContactApi: /opt/ContactAPI/current/bin/ContactApi: 806: /opt/ContactAPI/current/bin/ContactApi: cannot create /opt/ContactAPI/current//opt/ContactAPI/current/log/ContactApi.out: Directory nonexistent
/opt/ContactAPI/current/bin/ContactApi: 808: /opt/ContactAPI/current/bin/ContactApi: cannot create /opt/ContactAPI/current//opt/ContactAPI/current/log/ContactApi.out: Directory nonexistent
failed
The application is currently a snapshot version. Running it with "./ContactAPI --run" in the "/opt/ContactAPI/current/bin" directory is working fine. "./ContactAPI --start" in the same directory is showing the behaviour above.
Starting it in "/opt/ContactAPI/current" with "bin/ContactAPI --start" is also working nicely as well as a "bin/ContactAPI --stop".
Starting it with "service ContactAPI start" is showing the same errors.
I have no idea where to search for this problem. Any idea/hint?
Hi,
Migrating from maven to gradle, and tried the plugin isn't found
CONFIGURE FAILED in 1s
Plugin [id: 'com.fizzed.stork', version: '2.8.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.fizzed.stork:com.fizzed.stork.gradle.plugin:2.8.0')
Searched in the following repositories:
Gradle Central Plugin Repository
Hi
When deploying I get the following error on my VSTS CI server:
2018-07-25T20:35:17.4860494Z [ERROR] Unable to cleanly deploy 2018-07-25T20:35:17.4874552Z com.fizzed.blaze.ssh.SshException: Auth fail 2018-07-25T20:35:17.4890901Z at com.fizzed.blaze.ssh.impl.JschConnect.tryToUnwrap(JschConnect.java:369) 2018-07-25T20:35:17.4904381Z at com.fizzed.blaze.ssh.impl.JschConnect.doRun(JschConnect.java:356) 2018-07-25T20:35:17.4918699Z at com.fizzed.blaze.ssh.impl.JschConnect.doRun(JschConnect.java:50) 2018-07-25T20:35:17.4931760Z at com.fizzed.blaze.core.Action.runResult(Action.java:33) 2018-07-25T20:35:17.4944694Z at com.fizzed.blaze.core.Action.run(Action.java:39) 2018-07-25T20:35:17.4958020Z at com.fizzed.stork.deploy.Targets.sshConnect(Targets.java:71) 2018-07-25T20:35:17.4971056Z at com.fizzed.stork.deploy.Targets.connect(Targets.java:46) 2018-07-25T20:35:17.4984250Z at com.fizzed.stork.deploy.Deployer.deploy(Deployer.java:47) 2018-07-25T20:35:17.4997774Z at com.fizzed.stork.deploy.DeployMain.run(DeployMain.java:160) 2018-07-25T20:35:17.5010432Z at com.fizzed.stork.deploy.DeployMain.main(DeployMain.java:33) 2018-07-25T20:35:17.5023154Z Caused by: com.jcraft.jsch.JSchException: Auth fail 2018-07-25T20:35:17.5036770Z at com.jcraft.jsch.Session.connect(Session.java:519) 2018-07-25T20:35:17.5049415Z at com.fizzed.blaze.ssh.impl.JschConnect.doRun(JschConnect.java:342) 2018-07-25T20:35:17.5062275Z ... 8 common frames omitted
What can the issue be? I can scp files to the server, so SSH is configured correctly.
Hello Everyone,
I upgraded to stork v3.0.0 after moving to java11 for a new project.
The first deployment worked, however now after the second deployment the following error occurs:
mv: ‘../current/log’ and ‘../vserver/log’ are the same file
Can someone please advise me how to fix it?
Not sure what version it was introduced in, but 0.99w supports Windows Registry keys used by Adopt OpenJDK.
Sometimes after the new deploy, we find out that new version has a nasty bug and we need to downgrade to the previous version. I'd love to have the option to select the previous version.
Thank you.
When multiple users do deploys, they are unable to overwrite each other in the /tmp directory. Workround is to manually clean up the /tmp/stork-deploy directory on the target beforehand. Long term fix is to do a better job of having each user clean this after themselves after a deploy and switching to random temp directories.
Chrome force to open sites to open https, but fizzed.com does not support https
I tested stork-fabric-deploy from a linux env to a linux env.
stork-fabric-deploy -H [email protected] --assembly target/test-1.0-SNAPSHOT.tar.gz
This work well the first time. The second push from serv1 to serv2 I got an error :
run: mkdir "test-1.0-SNAPSHOT"
run: rsync -at "/opt/test/version-1.0-20150303041435/" "/tmp/test-1.0-SNAPSHOT/" --exclude="conf" --exclude="data" --exclude="log" --exclude="run"
[localhost] local: expect -c 'exp_internal 0; set timeout 20; spawn rsync -avrtc --exclude=conf --delete --force -e "ssh -oStrictHostKeyChecking=no -p 22" work/test-1.0-SNAPSHOT/ [email protected]:/tmp/test-1.0-SNAPSHOT/; expect "?assword:"; send "123456\n"; expect eof'
/bin/sh: 1: expect: not found
Fatal error: local() encountered an error (return code 127) while executing 'expect -c 'exp_internal 0; set timeout 20; spawn rsync -avrtc --exclude=conf --delete --force -e "ssh -oStrictHostKeyChecking=no -p 22" work/test-1.0-SNAPSHOT/ [email protected]:/tmp/test-1.0-SNAPSHOT/; expect "?assword:"; send "123456\n"; expect eof''
The folder is created into the /opt/.. but seems like as there is an existing current symlink it was blocking.
the server is password protected so it ask me for the password when i used the command.
I also noticed things that i don't really agree with :
For example i noticed that you use the /tmp folder to extract the pushed tar but then don't remove it. So it can be easily explore from a hacker for example.
Second point is that the project is store in the /opt. It should be cool if we can configure that.
In my case i am using an environnement that is multi user. By that i mean i am developping an admin panel and push this panel to a server where other users have php file and can easily explore the hard disk.
I try to protect my file from reading and being potentially accessed by others. Having this tmp folder containing all those dangerous information and not cleaned just afraid me.
The /opt folder have the right to be read by other. (even if we can chmod o-rwx on in the project folder).
But this is another problem. The main problem is that stork-fabric-deploy only work the first time i execute the command.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.