Publish Debian package to Artifactory using sbt - sbt-native-packager

I am using sbt-native-packager to create and publish Debian packages for my Scala Play 2 project to an Artifactory repository.
So far, I am able to generate the .deb package, but I fail to get it published to the artifactory URL. The only artifact that gets published is a debian .changes file, but not the actual .deb file.
I recently upgraded to Play 2.3.2 which uses sbt 0.13.5 and sbt-native-packager 0.7.4. This might be related, as publishing of a .deb file to the artifactory did used to work with sbt-native-packager 0.7.1.
I have tried hard to understand the problem and did figure out that with the latest version I had to add debianChangelog in Debian := Some(file("src/debian/changelog")) to my .sbt file, but I am stuck now.
My problem is simply that no .deb file is published when I do debian:publish. Only the .changes file gets published:
[info] published atk to http:...:8081/artifactory/atk-snapshots/atk/atk/1.0-SNAPSHOT/atk-1.0-SNAPSHOT.changes
Does someone know what I should do, to fix my publishing problem?
I've the following setup as imports and versions in the project's .sbt file:
import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.SbtNativePackager.NativePackagerKeys._
import com.typesafe.sbt.packager.archetypes.ServerLoader.SystemV
import NativePackagerKeys._
name := """atk"""
scalacOptions += "-target:jvm-1.7"
javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
version := "1.1-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.1"
And for the packaging part:
// Packaging info
debianChangelog in Debian := Some(file("src/debian/changelog"))
serverLoading in Debian := SystemV
packageDescription in Debian := "Parlis Elvis Adapter"
packageSummary in Debian := "Parlis Elvis Adapter"
maintainer in Debian := "Daan Hoogenboezem"
daemonUser in Linux := "ape"
daemonGroup in Linux := "ape"
sourceDirectory in Debian <<= (sourceDirectory) apply (_ / "debian")
mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map { (_, src) =>
// we are using the reference.conf as default application.conf
// the user can override settings here
val conf = src / "linux" / "atk" / "startup.conf"
conf -> "etc/atk/startup.conf"
}
linuxPackageMappings in Debian <+= (name in Universal, sourceDirectory in Debian) map { (name, dir) =>
(packageMapping(
(dir / "etc/changelog") -> "/usr/share/doc/atk/changelog.gz"
) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
}
defaultLinuxLogsLocation in Linux := "/var/log/atk"
deploymentSettings
// Publishing
publishTo := {
val artifactory = "http://...:8081/artifactory/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at artifactory + "atk-snapshots")
else
Some("releases" at artifactory + "atk-releases")
}
publish in Debian <<= (publish in Debian).triggeredBy(publish in Compile)

A colleague of mine showed me the fix, which is documented here: http://www.scala-sbt.org/sbt-native-packager/DetailedTopics/deployment.html?highlight=publish
In short, the following statement needs to be added to the build.sbt:
makeDeploymentSettings(Debian, packageBin in Debian, "deb")

Related

Did the default Cygwin installation directory change to C:\tools\cygwin?

The docs say it's C:\cygwin, but I observe C:\tools\cygwin.
I'm testing the installation with Chocolatey, but I might have had a previous Cygwin installation and don't remember if I changed the default location. I tried to remove all occurrences of C:\tools in the registry but so far the reinstallation insists on installing there.
Looks like Chocolatey sets this location:
$cygwin_root = (Get-ItemProperty 'HKLM:\SOFTWARE\Cygwin\setup' -ea 0).rootdir
if (!$cygwin_root) {
$cygwin_root = if ($pp.InstallDir) { $pp.InstallDir } else { "$toolsLocation\cygwin" }
} else { Write-Host 'Existing installation detected, ignoring InstallDir argument' }
But what's the reason for not using the default location?

Yocto Bitbake doesn't include kernel config fragment in build

I am currently trying to setup docker on my yocto (thud - 2.6) project. For that, I need to enable some kernel configuration.
The problem is that the kernel config fragment is not included in the build.
To include the config fragment I created a custom layer with the following structure
meta-edge_controller
|__conf
| |__layer.conf
|__recipes-kernel
|__linux
|__linux-intel
| |__docker_required.cfg
|__linux-intel_4.14.bbappend
linux-intel_4.14.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URL += "file://docker_required.cfg"
docker_required.cfg
CONFIG_CGROUP_DEVICE=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_TABLES=y
CONFIG_NF_NAT=y
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
CONFIG_NETFILTER_XT_MATCH_RECENT=y
CONFIG_IP_VS=y
CONFIG_NF_TABLES_IPV4=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_BTRFS_FS=y
CONFIG_OVERLAY_FS=y
I am builing for an Intel based Board (Atom E3940) and I have integrated the meta-intel layer, using the machine type "intel-corei7-64".
How can I further debug or investigate why bitbake doesn't include the kernel config fragment?
I also tried rebuilding the kernel manually: bitbake -c cleanall linux-intel and bitbake linux-intel
I see a typo in your snippet. SRC_URL should be SRC_URI instead. More info here.

conan.io: call exe with virtual run environment

I have a hello tool which contains only exe files (without source).
Hello tool structure:
bin
helloBin.exe
helloRoot.exe
conanfile.py
conanfile.py content:
class ToolHelloConan(ConanFile):
name = "ToolHello"
version = "0.1"
settings = "os", "compiler", "build_type", "arch"
def package(self):
self.copy("*")
def package_info(self):
self.cpp_info.libs = self.collect_libs()
I've exported the hello tool to local cache: conan export-pkg . ToolHello/0.1#user/testing. This copied all exe in local_cache/ToolHello/0.1/user/testing/package/hash/bin. The bin in local cache looks like this:
bin
helloBin.exe
helloRoot.exe
I've defined a tool integration project which contains only the conanfile.txt
[requires]
ToolHello/0.1#user/testing
[generators]
virtualrunenv
After running conan install . in tool integration project and activating the virtual run environment, I am able to call only the helloRoot.exe because it's located right in the bin directory, but I'm not able to execute the bin/bin/helloBin.exe
Question: How do I run exe files which are not located directly in the local_cache/ToolHello/0.1/user/testing/package/hash/bin, but in local_cache/ToolHello/0.1/user/testing/package/hash/bin/directory?
You need to define the bindirs that are not the default one (bin). Add this to your conanfile.py:
def package_info(self):
self.cpp_info.bindirs = ["bin", "bin/directory"]
If you need to also include the root of the package folder, you might need to use:
def package_info(self):
self.cpp_info.bindirs = ["", "bin", "bin/directory"]

Unable to run JaCaMo project: how to configure it properly?

I already have a jason project which is running well in Jason and now I am trying to run using JaCaMo. I have both plugins (Jason and JaCaMo) in eclipse. What I am trying to do is in a simple way to compile this current Jason project in JaCaMo for further improvements.
My mas2j file which is running well:
MAS tp_cnp {
infrastructure: Centralised
agents:
i initiator [beliefs="expectedResponses(2)"] #2;
p participant #2;
r rejector #1;
c controller [beliefs="expectedDones(2)"] #1;
aslSourcePath:
"src/asl";
}
The jcm I've created:
mas tp_cnp {
agent i : initiator {
beliefs: message("expectedResponses(2)"),
instances: 2
}
agent p : participant {
instances: 2
}
agent r : rejector
agent c : controller {
beliefs: message("expectedDones(2)"),
}
asl-path: src/asl
}
When I've tryed to run this JaCaMo project the system returned this:
BUILD SUCCESSFUL
Total time: 2 seconds
Launching tp_cnp
reading from file /home/cleber/Projetos/tp_cnp/tp_cnp.jcm ...
JaCaMo is not configured, creating a default configuration.
Wrong configuration for jacamo, current is null
jacamo not found
Wrong configuration for jason, current is null
jason not found
Wrong configuration for jade, current is null
jade not found
Wrong configuration for jason, current is null
jason not found
file /home/cleber/Projetos/tp_cnp/tp_cnp.jcm parsed successfully!
Ant is not properly configured! Current value is /libs
Problem defining the command to run the MAS!
How to configure JaCaMo properly? Is this "translation" (mas2j to jcm) right?
you can configure JaCaMo by running jacamo-XXX.jar application (where XXX is the version). You can either double click on the jar file or run
java -jar jacamo-XXX.jar
You find more details in the JaCaMo "hello world" tutorial, where links for configuring the eclipse plugin or the shell command environment are provided.
Regarding your .jcm file, file names (after ":") must include the .asl:
...
agent i : initiator.asl {
beliefs: message("expectedResponses(2)"),
instances: 2
}
Best,
Jomi

Trouble Publishing Android Studio Library on jCenter with Bintray

I'm following this tutorial to publish an example Android Studio library on Jcenter:
http://crushingcode.co/publish-your-android-library-via-jcenter/
It seems very clear.
I've created my GitHub repository with this library at this link:
https://github.com/alessandroargentieri/mylibview
I've also Signed in to Bintray.com, and created a new repository which must contain my library (as explained in the tutorial above).
To publish a repository on Bintray I must create an organisation, then you create the repository. So these are my data:
Bintray username: alessandroargentieri
organisation: alexmawashi
repository: https://bintray.com/alexmawashi/my_android_repository
then, in Android Studio, in the gradle file of my library module, I've this data:
apply plugin: 'com.android.library'
ext {
bintrayRepo = 'my_android_repository' //maven
bintrayName = 'mylibview' // Has to be same as your library module name
publishedGroupId = 'mawashi.alex.mylittlelibrary'
libraryName = 'MyLibView'
artifact = 'mylibview' // Has to be same as your library module name
libraryDescription = 'Android Library to use a custom view'
// Your github repo link
siteUrl = 'https://github.com/alessandroargentieri/mylibview'
gitUrl = 'https://github.com/alessandroargentieri/mylibview.git'
githubRepository= 'alessandroargentieri/mylibview'
libraryVersion = '1.0'
developerId = 'alexmawashi'
developerName = 'Alessandro Argentieri'
developerEmail = 'alexmawashi87#gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
...
...
apply from: 'https://raw.githubusercontent.com/nisrulz/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle'
When I use the terminal and write:
gradlew clean build install bintrayUpload --stacktrace
After a few minutes, I get this error:
What went wrong:
Execution failed for task ':mylittlelibrary:bintrayUpload'.
> Could not create package 'alessandroargentieri/my_android_repository/mylibview': HTTP/1.1 404 Not Found [message:Repo 'my_android_repository' was not found]
What am I doing wrong?
Thanks.
There also might be a problem here:
https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle
If your repo belong to your organisation then you are going to need the userOrg parameter set.
See https://github.com/bintray/gradle-bintray-plugin#step-4-add-your-bintray-package-information-to-the-bintray-closure step 4
Also see: HTTP/1.1 401 Unauthorized when uploading binary on bintray
For this to work properly, your gradle.properties file needs to have a bintray.user and a bintray.apikey (which is your bintray API key) configured (see the include in https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle )

Resources