So I have a Bintray repository, but I'm having difficulty uploading to it from gradle. Well, what I mean is version management is not working how I want it, currently for every single .jar I upload, I have to increment the version in my configuration, and dependencies. I know this is not how it's supposed to be done. My question is how do I automate/implement VCS tagging with Bintray. Right now my configuration for uploading looks like so (using the bintray plugin):
bintray {
user = "$bintrayUser"
key = "$bintrayKey"
publications = ['maven']
dryRun = false
publish = true
pkg {
repo = "$targetBintrayRepo"
name = "$targetBintrayPackage"
desc = ''
websiteUrl = "$programWebsiteUrl"
issueTrackerUrl = "$programIssueUrl"
vcsUrl = "$programVcsUrl"
licenses = ["$programLicense"]
labels = []
publicDownloadNumbers = true
version {
name = "$programVersion"
released = new java.util.Date()
vcsTag = "$programVcsTag"
}
}
}
And my variables are:
def programVersion = '0'
def programVcsTag = '0.0.0'
def programGroup = 'com.gmail.socraticphoenix'
def targetBintrayRepo = 'Main'
def targetBintrayPackage = 'java-api'
def programLicense = 'MIT'
def programWebsiteUrl = 'https://github.com/meguy26/PlasmaAPI'
def programIssueUrl = 'https://github.com/meguy26/PlasmaAPI/issues'
def programVcsUrl = 'https://github.com/meguy26/PlasmaAPI.git'
Yet here no tags appear, and running publish again (even with a different vcs tag) results in a version already exists error. (Could not upload to 'https://api.bintray.com/content/meguy26/Main/java-api/0/com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar': HTTP/1.1 409 Conflict [message:Unable to upload files: An artifact with the path 'com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar' already exists])
Sorry if I'm being noobish, but I don't understand why its not working, I filled out all the appropriate variables (I thought)
Bintray does not support multiple tags per version. Version is a unique string. If you want to release something from the same version with different tags, compose a Bintray version string with from your program version and tag, e.g. "$programVersion-$programVcsTag"
Related
I am trying to consume a Linux based binary of Webrtc (https://webrtc.org/) in a Conan package with another project and finding when the Visual Studio generator runs it tries to include Webrtc as webrtc.lib instead of libwebrtc.a.
Here's the conanfile.py recipe I am using to create the local Webrtc package...
class WebrtcConan(ConanFile):
name = "webrtc"
version = "0.1"
license = "<Put the package license here>"
author = "<Put your name here> <And your email here>"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Description of Webrtc here>"
topics = ("<Put some tag here>", "<here>", "<and here>")
settings = {"os", "compiler", "build_type", "arch"}
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
def package(self):
self.copy("*")
def package_info(self):
self.cpp_info.libs = self.collect_libs()
I'm exporting the package to the local cache like this...
conan export-pkg -f . webrtc/local
Then running the Visual Studio generator like this in the consuming project...
conan install . -g visual_studio
Reviewing the generated conanbuildinfo.props shows Webrtc included as webrtc.lib instead of libwebrtc.a.
I CAN get the correct library inclusion with the following changes to package and package_info...
class WebrtcConan(ConanFile):
name = "webrtc"
version = "0.1"
license = "<Put the package license here>"
author = "<Put your name here> <And your email here>"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Description of Webrtc here>"
topics = ("<Put some tag here>", "<here>", "<and here>")
settings = {"os", "compiler", "build_type", "arch"}
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
generators = "visual_studio"
def package(self):
self.copy("*.a", dst="lib", keep_path=False) <<< specific destination
def package_info(self):
self.cpp_info.libs = ["libwebrtc.a"] <<< specific library inclusion
Ideally I can use this default recipe (the first conanfile.py example) as I'm not the one responsible for creating the Webrtc Conan package ultimately. I am working with another team/developer responsible for this and I need to support several different platforms past Linux. Is there a setting I'm missing somewhere to control the library inclusion? Why does the Conan generator assume the library name is webrtc.lib for consumer inclusion when it is included within the package as libwebrtc.a?
How to get the JIRA ticket number using Jenkins Pipeline script Example:
CICD-34
The following command gives complete info about the ticket, but how do we get just the ID and store in a variable?
def issue = jiraJqlSearch jql: 'PROJECT = CICD AND description~"New JIRA Created from Jenkins through Declarative PL script"', site: 'MyLocalJira'”
echo issue.data.toString()
I have the same problem and find a solution.
I share with you my answer :)
def testExecutionSearch = jiraJqlSearch jql: "project=${project} and issuetype = 'Test Execution' and summary ~ '${summary}'", site: 'myjira', failOnError: true
if (testExecutionSearch != null){
//Get all issues
def issues = testExecutionSearch.data.issues
//Get the key of the first result
def key = issues[0].key
}
Here I take the first element of my jql search (def key = issues[0].key) but you can choose what you want :)
I'm trying to build libgrpc as a nixpkg on OS X.
It depends on zlib, protobuf >= 3.0 and openssl >= 1.0.2.
How can I specify these versions as the minimum? Both are contained in the official channel and both built successfully.
I'm pretty new to nix and this is my attempt to get my feet wet.
For now, this is what I have for default.nix:
{ stdenv, fetchurl, zlib, openssl, protobuf }:
stdenv.mkDerivation rec {
name = "libgrpc-0.10.1";
src = fetchurl {
url = "https://github.com/grpc/grpc/archive/release-0_10_1.tar.gz";
sha256 = "2da8deef4fcc421ce8e9102e8531261b3c23073ab4d2bf459e549ed4e37b5ba1";
};
buildInputs = [zlib "openssl-1.0.2d" "protobuf-3.0.0-alpha-3.1"];
meta = {
homepage = "https://github.com/grpc/grpc/";
version = "0.10.1";
description = "A library for a RPC service based on HTTP/2 and protobuf";
license = stdenv.lib.licenses.bsd3;
platforms = [
"i686-linux"
"x86_64-linux"
"x86_64-darwin"
"i686-cygwin"
"i686-freebsd"
"x86_64-freebsd"
"i686-openbsd"
"x86_64-openbsd"
];
downloadPage = "https://github.com/grpc/grpc/archive/release-0_10_1.tar.gz";
};
}
I'm either looking for a way to either build libgrpc > 0.10 under nix - or for a wayto define minimum versions for requirements so I can try to fix this myself.
Thanks!
A look inside all-packages.nix showed that these versions are available as openssl_1_0_2 and protobuf3_0.
I'm still stuck at a zlib-dependency problem, but the problem I asked about is solved.
I've worked with the script outlined in the following answer:
Rally APIs: How to copy Test Folder and member Test Cases
and it's handy, but what I really want to do is to move an entire Test Folder into a different project. This is next to impossible through the Rally User Interface. According to Rally Support, the only way to do this in the UI is:
Un-assign the Test Cases from their current Test Folder
Setup a Custom Grid app on your dashboard
Use the Custom Grid bulk edit to update the Project of the Test Cases
Lastly use the Custom Grid bulk edit to update the Test Folder - now that you're in the target Project, of the Test Cases
Even though the above process is clunky, it is easier now than it used to be before the advent of the bulk edit within the Custom Grids. Before you had to go through and edit each Test Case one-by-one which was very manual and slow.
However, we have several thousand Test Cases we need to move, and the Custom Grid has a fatal flaw for us. It will only show the first 200 records in a query. So we would have to manually change our grid query in a step wise manner to accomplish the move we need. This is barely better than editing Test Cases one-by-one. Is there a way to move a Test Folder with Test Cases from one Project to another, using a script? Please tell me there is.
The following script will perform this task - it will move all Test Cases from a Source Test Folder identified by FormattedID, to a Target Test Folder, also identified by FormattedID. The Source Test Folder and Target Test Folder can be in different Projects (although they must be within the same Workspace). Like the Copy script referenced in the question, the Target Test Folder must exist, i.e. the script will not create a Test Folder for you if the Target is not found.
For those needing to install and configure the Ruby REST Toolkit, links are here:
Developer Portal: Rally REST API for Ruby
Github
# Copyright 2002-2012 Rally Software Development Corp. All Rights Reserved.
require 'rally_api'
$my_base_url = "https://rally1.rallydev.com/slm"
$my_username = "user#company.com"
$my_password = "password"
$my_workspace = "My Workspace"
$my_project = "My Project"
$wsapi_version = "1.39"
# Test Folders
$source_test_folder_formatted_id = "TF8"
$target_test_folder_formatted_id = "TF11"
#==================== Make a connection to Rally ====================
config = {:base_url => $my_base_url}
config[:username] = $my_username
config[:password] = $my_password
config[:workspace] = $my_workspace
config[:project] = $my_project
config[:version] = $wsapi_version
#rally = RallyAPI::RallyRestJson.new(config)
begin
# Lookup source Test Folder
source_test_folder_query = RallyAPI::RallyQuery.new()
source_test_folder_query.type = :testfolder
source_test_folder_query.fetch = true
source_test_folder_query.query_string = "(FormattedID = \"" + $source_test_folder_formatted_id + "\")"
source_test_folder_result = #rally.find(source_test_folder_query)
# Lookup Target Test Folder
target_test_folder_query = RallyAPI::RallyQuery.new()
target_test_folder_query.type = :testfolder
target_test_folder_query.fetch = true
target_test_folder_query.query_string = "(FormattedID = \"" + $target_test_folder_formatted_id + "\")"
target_test_folder_result = #rally.find(target_test_folder_query)
if source_test_folder_result.total_result_count == 0
puts "Source Test Folder: " + $source_test_folder_formatted_id + "not found. Exiting."
exit
end
if target_test_folder_result.total_result_count == 0
puts "Target Test Folder: " + $target_test_folder_formatted_id + "not found. Target must exist before moving."
exit
end
source_test_folder = source_test_folder_result.first()
target_test_folder = target_test_folder_result.first()
# Populate full object for both Source and Target Test Folders
full_source_test_folder = source_test_folder.read
full_target_test_folder = target_test_folder.read
# Grab collection of Source Test Cases
source_test_cases = source_test_folder["TestCases"]
# Loop through Source Test Cases and Move to Target
source_test_cases.each do |source_test_case|
begin
test_case_to_update = source_test_case.read
source_test_case_formatted_id = test_case_to_update["FormattedID"]
target_project = full_target_test_folder["Project"]
target_project_full_object = target_project.read
target_project_name = target_project_full_object["Name"]
source_project = full_source_test_folder["Project"]
source_project_full_object = source_project.read
source_project_name = source_project_full_object["Name"]
puts "Source Project Name: #{source_project_name}"
puts "Target Project Name: #{target_project_name}"
# Test if the source project and target project are the same
source_target_proj_match = source_project_name.eql?(target_project_name)
# If the target Test Folder is in a different Project, we have to do some homework first:
# "un-Test Folder" the project
# Assign the Test Case to the Target Project
# Assign the Test Case to the Target Test Folder
if !source_target_proj_match then
fields = {}
fields["TestFolder"] = ""
test_case_updated = #rally.update(:testcase, test_case_to_update.ObjectID, fields) #by ObjectID
puts "Test Case #{source_test_case_formatted_id} successfully dissociated from: #{$source_test_folder_formatted_id}"
# Get full object on Target Project and assign Test Case to Target Project
fields = {}
fields["Project"] = target_project_full_object
test_case_updated = #rally.update(:testcase, test_case_to_update.ObjectID, fields) #by ObjectID
puts "Test Case #{source_test_case_formatted_id} successfully assigned to Project: #{target_project_name}"
end
# Change the Test Folder attribute on the Test Case
fields = {}
fields["TestFolder"] = target_test_folder
test_case_updated = #rally.update(:testcase, test_case_to_update.ObjectID, fields) #by ObjectID
puts "Test Case #{source_test_case_formatted_id} successfully moved to #{$target_test_folder_formatted_id}"
rescue => ex
puts "Test Case #{source_test_case_formatted_id} not updated due to error"
puts ex
end
end
end
I'm using the Ruby SVN bindings built with SWIG. Here's a little tutorial.
When I do this
#repository = Svn::Repos.open('/path/to/repository')
I can access the repository fine. But when I do this
#repository = Svn::Repos.open('svn://localhost/some/path')
It fails with
/SourceCache/subversion/subversion-35/subversion/subversion/libsvn_subr/io.c:2710: 2: Can't open file 'svn://localhost/format': No such file or directory
When I do this from the command line, I do get output
svn ls svn://localhost/some/path
Any ideas why I can't use the svn:// protocol?
EDIT
Here's what I ended up doing, and it works.
require 'svn/ra'
class SvnWrapper
def initialize(repository_uri, repository_username, repository_password)
# Remove any trailing slashes from the path, as the SVN library will choke
# if it finds any.
#repository_uri = repository_uri.gsub(/[\/]+$/, '')
# Initialize repository session.
#context = Svn::Client::Context.new
#context.add_simple_prompt_provider(0) do |cred, realm, username, may_save|
cred.username = repository_username
cred.password = repository_password
cred.may_save = true
end
config = {}
callbacks = Svn::Ra::Callbacks.new(#context.auth_baton)
#session = Svn::Ra::Session.open(#repository_uri, config, callbacks)
end
def ls(relative_path, revision = nil)
relative_path = relative_path.gsub(/^[\/]+/, '').gsub(/[\/]+$/, '')
entries, properties = #session.dir(relative_path, revision)
return entries.keys.sort
end
def info(relative_path, revision = nil)
path = File.join(#repository_uri, relative_path)
data = {}
#context.info(path, revision) do |dummy, infoStruct|
# These values are enumerated at http://svn.collab.net/svn-doxygen/structsvn__info__t.html.
data['url'] = infoStruct.URL
data['revision'] = infoStruct.rev
data['kind'] = infoStruct.kind
data['repository_root_url'] = infoStruct.repos_root_url
data['repository_uuid'] = infoStruct.repos_UUID
data['last_changed_revision'] = infoStruct.last_changed_rev
data['last_changed_date'] = infoStruct.last_changed_date
data['last_changed_author'] = infoStruct.last_changed_author
data['lock'] = infoStruct.lock
end
return data
end
end
Enjoy.
The svn command is a client. It communicates with the Subversion server using several protocols (http(s)://, svn:// and file:///).
Repos.open is a repository function (much like svnadmin for instance). It operates directly on the database, and doesn't use a client protocol to communicate with the server.