Gradle + Jenkins: Publishing to other user's directory - deployment

I'm currently using Jenkins, with Gradle to build the projects. I'm currently trying to use the uploadArchives task to place the generated jars under the directory of another user. Currently not having any success:
Jenkins output:
[minigame-chronos] $ /var/lib/jenkins/workspace/minigame-chronos/gradlew uploadArchives
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:uploadArchives FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':uploadArchives'.
> Could not publish configuration 'archives'
> java.io.FileNotFoundException: /home/minecraft/server/plugins/minigame-chronos-0.1.jar (Permission denied)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
build.gradle:
repositories {
mavenCentral()
flatDir {
name "devServer"
dirs "/home/minecraft/server/plugins"
}
}
uploadArchives {
repositories {
add project.repositories.devServer
}
}
So far, I've tried experimenting with user groups and the directory permissions.
The directory /home/minecraft/server/plugins/ has been given the following file permissions
drw-rw-rw- 2 minecraft minecraft-dev 4096 Jan 4 13:14 plugins
Users jenkins and minecraft both exist in the minecraft-dev groups.
Thanks for the help

You are missing "execute" permission for directory - nobody can chdir to it.
try
chmod +x /home/minecraft/server/plugins
#see https://unix.stackexchange.com/questions/21251/how-do-directory-permissions-in-linux-work

Related

NixOS - Issue packaging neovim plugin from github

I'm trying to add a neovim plugin that doesn't exist in nixpkgs yet (modes.nvim), but having trouble getting it to work.
I'm using NixOS 22.05, and Home Manager, and I am using the following to build this plugin:
pkgs.vimUtils.buildVimPlugin {
name = "modes-nvim";
src = pkgs.fetchFromGitHub {
owner = "mvllow";
repo = "modes.nvim";
rev = "3188692abf02a8838ec75e59d68c2ce3e4323f5c";
sha256 = "sha256-2QDpwQ9+F5t5gTR1KLVzRrvriwo5JUHatZEJnc0ojV8=";
};
}
Initially, I used lib.pkgs.fakeSha256 to get a "mismatched hash" error, and copy/pasted the has from that error message, so I think it's correct, though other things I've seen on the internet seem to have the SHA256 as a hex string, so not sure what's going on there.
When I run home-manager switch, I get the following error:
these 12 derivations will be built:
/nix/store/pna2lzjc3q56z59b2kfazzxi8m6swp8d-vimplugin-modes-nvim.drv
/nix/store/mnj1d881d8s57yj3y8wjy7i9nl3m089f-vimplugin-modes-nvim.drv
/nix/store/5l8vqvx2bbawkkj92s8qd0p5hw16pcmq-vim-pack-dir.drv
/nix/store/jgqf68sd50s79pydzs9154p509l5109v-hm_nviminit.vim.drv
/nix/store/rq8f75qr9ahrfr0hvp51inn19088bz5p-manifest.vim.drv
/nix/store/hbzm2xr6nv8mr2l9nrlf742fqdmw9nv3-neovim-0.7.2.drv
/nix/store/zks47ifk7njz1s8y7hvq357ac8z6azkd-neovim-0.7.2-fish-completions.drv
/nix/store/rkaa094vvyjcyy4v1zkh4f8xz64vqxas-cameron-fish-completions.drv
/nix/store/0073403x9b4wv13gm7a6bqy4765pi8g5-home-manager-files.drv
/nix/store/lxwpbhb6ryhwrff4cjyniff11843cf9x-home-manager-path.drv
/nix/store/xbbn44253wjh90md4hqrrc2wfpafkc55-activation-script.drv
/nix/store/ijwmv897xc2wlr1ij4a30vk4z154ikbf-home-manager-generation.drv
building '/nix/store/pna2lzjc3q56z59b2kfazzxi8m6swp8d-vimplugin-modes-nvim.drv'...
Sourcing vim-command-check-hook.sh
Using vimCommandCheckHook
Sourcing vim-gen-doc-hook
unpacking sources
unpacking source archive /nix/store/fcxyif8piqar9w9ynmi6ym71hw6zsy7a-source
source root is source
patching sources
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash
test -r dependencies/pack/vendor/start/plenary.nvim || git clone --depth=1 https://github.com/nvim-lua/plenary.nvim.git dependencies/pack/vendor/start/plenary.nvim
/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash: line 1: git: command not found
make: *** [Makefile:7: install_dependencies] Error 127
error: builder for '/nix/store/pna2lzjc3q56z59b2kfazzxi8m6swp8d-vimplugin-modes-nvim.drv' failed with exit code 2;
last 10 log lines:
> unpacking source archive /nix/store/fcxyif8piqar9w9ynmi6ym71hw6zsy7a-source
> source root is source
> patching sources
> configuring
> no configure script, doing nothing
> building
> build flags: SHELL=/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash
> test -r dependencies/pack/vendor/start/plenary.nvim || git clone --depth=1 https://github.com/nvim-lua/plenary.nvim.git dependencies/pack/vendor/start/plenary.nvim
> /nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash: line 1: git: command not found
> make: *** [Makefile:7: install_dependencies] Error 127
For full logs, run 'nix log /nix/store/pna2lzjc3q56z59b2kfazzxi8m6swp8d-vimplugin-modes-nvim.drv'.
error: 1 dependencies of derivation '/nix/store/mnj1d881d8s57yj3y8wjy7i9nl3m089f-vimplugin-modes-nvim.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5l8vqvx2bbawkkj92s8qd0p5hw16pcmq-vim-pack-dir.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jgqf68sd50s79pydzs9154p509l5109v-hm_nviminit.vim.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rq8f75qr9ahrfr0hvp51inn19088bz5p-manifest.vim.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0073403x9b4wv13gm7a6bqy4765pi8g5-home-manager-files.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hbzm2xr6nv8mr2l9nrlf742fqdmw9nv3-neovim-0.7.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ijwmv897xc2wlr1ij4a30vk4z154ikbf-home-manager-generation.drv' failed to build
It appears to be failing due to git not being found. Of course, I have git installed for me, but perhaps this command is being run in an environment that doesn't have access to my installed packages.
I'm very new to Nix and NixOS, so I'm not really sure how to begin fixing this issue. I've searched online for answers, but haven't found anything about this issue. Any advice is much appreciated.

Error incorrect settings while building a flutter project

i work on windows and i get this error while running a flutter project , so it work on chrome but on the real device phone or emulator it does not .
this the error :
Format incorrect du param�tre -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared_preferences_android:parseDebugLocalResources'.
> Could not resolve all files for configuration ':shared_preferences_android:androidApis'.
> Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for PlatformAttrTransform: C:\Users\MEJDI BEN HAMIDA\AppData\Local\Android\sdk\platforms\android-31\android.jar.
> zip END header not found
* 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
BUILD FAILED in 7s
Running Gradle task 'assembleDebug'... 8,9s
Exception: Gradle task assembleDebug failed with exit code 1

unable to locate asset entry in pubspec.yaml: "fonts/Signatra.ttf"

Can anyone can help me with this problem?
Error: unable to locate asset entry in pubspec.yaml:
"fonts/Signatra.ttf".
FAILURE: Build failed with an exception.
* Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
* What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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
BUILD FAILED in 5s Exception: Gradle task assembleDebug failed with
exit code 1
Please check on the following pointers and fix your path in pubspec.ymal accordingly:
The assets folder should be in the root path (/). If you want to keep it in the lib folder, put lib in front of assets like this:
`lib/assets/fonts/Signatra.ttf`
If you want to keep it in the asset folder:
`assets/fonts/Signatra.ttf`
PS: please check the name of file and the name which you are entering in pubspec.ymal also.

A library can't opt out of null safety by default when compile flutter apk with gradle

When I compile flutter android apk using gradle like this:
fastlane android beta
shows this error:
/source/cruise-open/android/gradlew clean assembleRelease -p .' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
> Task :clean
> Task :app:clean UP-TO-DATE
> Task :flutter_secure_storage:clean UP-TO-DATE
> Task :fluttertoast:clean UP-TO-DATE
> Task :package_info:clean UP-TO-DATE
> Task :path_provider:clean UP-TO-DATE
> Task :share:clean UP-TO-DATE
> Task :shared_preferences:clean UP-TO-DATE
> Task :uni_links:clean UP-TO-DATE
> Task :url_launcher:clean UP-TO-DATE
> Task :video_player:clean UP-TO-DATE
> Task :wakelock:clean UP-TO-DATE
> Task :webview_flutter:clean UP-TO-DATE
> Task :app:compileFlutterBuildRelease
../../.pub-cache/hosted/pub.flutter-io.cn/video_player_platform_interface-2.2.0/lib/messages.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart = 2.8
^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/wakelock_platform_interface-0.1.0+1/lib/messages.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart = 2.8
^^^^^^^^^^^^^^
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:hive
- package:hive_flutter
- package:state_notifier
- package:fish_redux
- package:crypto
- package:path_provider
- package:convert
- package:pull_to_refresh
- package:flutter_icons
- package:flutter_slidable
- package:http
- package:logger
- package:dio
- package:flutter_html
- package:http_parser
- package:webview_flutter
- package:csslib
- package:html
- package:flutter_layout_grid
- package:chewie
- package:chewie_audio
- package:video_player
- package:video_player_platform_interface
- package:quiver
- package:wakelock
- package:shimmer
- package:wakelock_platform_interface
For solutions, see https://dart.dev/go/unsound-null-safety
> Task :app:compileFlutterBuildRelease FAILED
*********************************************************
WARNING: This version of path_provider will break your Android build if it or its dependencies aren't compatible with AndroidX.
See for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed with an exception.
* Where:
Script '/Users/dolphin/apps/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/dolphin/apps/flutter/bin/flutter'' finished with non-zero exit value 1
* 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
BUILD FAILED in 23s
14 actionable tasks: 2 executed, 12 up-to-date
what should I do to pass --no-sound-null-safety when compile android apk? And this is my Fastline setting:
default_platform(:android)
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "clean assembleRelease")
crashlytics
# sh "your_script.sh"
# You can also use other beta testing services here
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(task: "clean assembleRelease")
pgyer(
api_key: ENV['PGY_API_KEY'],
user_key: ENV['PGY_USER_KEY']
)
end
end

correct way to create symlink in deploy.rb

I have an error when i deploy an application:
[neon.locum.ru] executing command
*** [err :: neon.locum.ru] find: `/home/hosting_grandinvest/projects/demo/releases/20130116145843/public/images /home/hosting_grandinvest/projects/demo/releases/20130116145843/public/stylesheets /home/hosting_grandinvest/projects/demo/releases/20130116145843/public/javascripts': Нет такого файла или каталога
command finished in 91ms
triggering after callbacks for `deploy:update_code'
* 2013-01-16 16:58:45 executing `make_images_link'
* executing "ln -s /home/hosting_grandinvest/projects/demo/shared/public/images /home/hosting_grandinvest/projects/demo/releases/20130116145843/public/images"
As you see it's because first it tries to find /public/images dir. and only then creates a symlink for that directory.
beggining of my deploy.rb
require 'bundler/capistrano'
after "deploy:update_code", :make_images_link
task :make_images_link, roles => :app do
images_dir = "#{shared_path}/public/images"
run "ln -s #{images_dir} #{release_path}/public/images"
end
the deploy finishes
Gem.source_index called from /home/hosting_grandinvest/projects/demo/shared/gems/ruby/1.8/gems/rails-2.3.15/lib/rails/gem_dependency.rb:21.
master process ready
worker=0 ready
reaped #<Process::Status: pid=18656,exited(0)> worker=0
master complete
in public/images dir are located some files used by css ( background: url(/images/front/logo.gif) no-repeat 0 0;) and they are Not displayed !but when i try to access these files directly
(http://hosting.net/images/front/logo.gif) i can see them!
Any suggestions on how to solve this error and make capistrano work?
UPDATE 1
I've included public/images/front in repo and after code deployment swap empty folder with a link
after "deploy:update_code", :make_images_link
task :make_images_link, roles => :app do
images_dir = "#{shared_path}/public/images"
realease_images = "#{release_path}/public/images"
run "rm -rf #{realease_images}"
run "ln -s #{images_dir} #{realease_images}"
end
When i deploy error still exists, but images appeared!
In the end i've included 'public'images' dir in my repository.
and as step 2 i run a callback that i've specified in update 1.