Cant set build.number and build.name properties

classic Classic list List threaded Threaded
4 messages Options
zw
Reply | Threaded
Open this post in threaded view
|

Cant set build.number and build.name properties

zw
Hi All

We like to set a few properties via curl but we're getting command not found by our synxtax.
This is a new artifact to deploy to the artifactory repo directory.
We are not sure if build.number and build.name are by default already available variables/properties in artifactory when the repo directory fk-SNAPSHOT was first created or do we have to create them ie the build.xxx variables/properties from scratch.

[ppl@host ~]# curl -X PUT -v -u user:pass --data-binary @/test/fk/fk.zip -H "X-Checksum-Sha1:eeeee747dd26ddcadecd4ad29da7293c397dfc0f" -H "X-Checksum-Md5:eeeeec86ebb6b4247fa5c209e0826969" -i https://artifactory-xxx.com/artifactory/release-local/fk-SNAPSHOT/fk.zip;buildURL=http://host:8080/jenkins/job/Translation/58/;buildNumber=58;hudsonURL=http://host.com:8080/jenkins/;Revision=129172;build\.parentNumber=58
* About to connect() to xxx.com port 443 (#0)
:
:
  },
  "uri" : "https://artifactory-xxx.com/artifactory/release-local/fk-SNAPSHOT/fk.zip"
* Connection #0 to host artifactory-xxx.com left intact
}bash: build.parentNumber=58: command not found...

What are we doing wrong in syntax?
Any help is appreciated.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Cant set build.number and build.name properties

shayb
Hi,

You should wrap the entire url with quotes (i.e. 'https://host/artifactory/repokey/file.jar;propKey=propValue'). In addition, since you have slashes in your properties values, you must encode these values (here is an example for an online URL encoder tool). Also, I believe that the the '\' before '.parentNumber' is not necessary.

Btw, if marking your artifacts with the build information is what you are trying to achieve, you might want to look into Artifactory's build integration which does this for you. Artifactory has plugins for many build tools and CI servers such as maven, Gradle, Jenkins, Bamboo, Teamcity and more and these plugins responsible to create a build information entity for your build in Artifactory, mark your artifact with the build name and number information and more.

Shay

On Thu, Jul 21, 2016 at 12:06 AM, zw [via Artifactory] <[hidden email]> wrote:
Hi All

We like to set a few properties via curl but we're getting command not found by our synxtax.
This is a new artifact to deploy to the artifactory repo directory.
We are not sure if build.number and build.name are by default already available variables/properties in artifactory when the repo directory fk-SNAPSHOT was first created or do we have to create them ie the build.xxx variables/properties from scratch.

[ppl@host ~]# curl -X PUT -v -u user:pass --data-binary @/test/fk/fk.zip -H "X-Checksum-Sha1:eeeee747dd26ddcadecd4ad29da7293c397dfc0f" -H "X-Checksum-Md5:eeeeec86ebb6b4247fa5c209e0826969" -i https://artifactory-xxx.com/artifactory/release-local/fk-SNAPSHOT/fk.zip;buildURL=http://host:8080/jenkins/job/Translation/58/;buildNumber=58;hudsonURL=http://host.com:8080/jenkins/;Revision=129172;build\.parentNumber=58
* About to connect() to xxx.com port 443 (#0)
:
:
  },
  "uri" : "https://artifactory-xxx.com/artifactory/release-local/fk-SNAPSHOT/fk.zip"
* Connection #0 to host artifactory-xxx.com left intact
}bash: build.parentNumber=58: command not found...

What are we doing wrong in syntax?
Any help is appreciated.

Thanks



If you reply to this email, your message will be added to the discussion below:
http://forums.jfrog.org/Cant-set-build-number-and-build-name-properties-tp7581104.html
To start a new topic under Artifactory - Users, email [hidden email]
To unsubscribe from Artifactory, click here.
NAML

zw
Reply | Threaded
Open this post in threaded view
|

Re: Cant set build.number and build.name properties

zw
Hi Shay

thanks for responding.
I tried your suggestion:

[ppl@host ~]# curl -X PUT -v -u user:pass --data-binary @/test/fk/fk.zip -H "X-Checksum-Sha1:eeeee747dd26ddcadecd4ad29da7293c397dfc0f" -H "X-Checksum-Md5:eeeeec86ebb6b4247fa5c209e0826969" -i 'https://artifactory-xxx.com/artifactory/release-local/fk-SNAPSHOT/fk.zip;buildURL=http://host:8080/jenkins/job/Translation/58/;buildNumber=58;hudsonURL=http://host.com:8080/jenkins/;Revision=129172;build.parentNumber=58'

HTTP Server Error 500 was returned by curl.

Any other suggestions you may have ?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Cant set build.number and build.name properties

shayb
From your response, it seems that you are still forwarding non-encoded values for the 'hudsonUrl' and 'buildUrl'.
Your URL should be similar to the below:

curl -X PUT -v -u user:pass --data-binary @/test/fk/fk.zip -H "X-Checksum-Sha1:eeeee747dd26ddcadecd4ad29da7293c397dfc0f" -H "X-Checksum-Md5:eeeeec86ebb6b4247fa5c209e0826969" -i 'https://artifactory-xxx.com/artifactory/libs-release-local/fk-SNAPSHOT/fk.zip;buildURL=http%3A%2F%2Fhost%3A8080%2Fjenkins%2Fjob%2FTranslation%2F58%2F;buildNumber=58;hudsonURL=http%3A%2F%2Fhost.com%3A8080%2Fjenkins%2F;Revision=129172;build.parentNumber=58'

Note, if you already ran the previous curl command with the not-encoded properties and there is a node exist with this name in Artifactory, I'll recommend to remove the file and re-deploy it using the encoded props.

Best,
Shay

On Wed, Jul 27, 2016 at 9:22 PM, zw [via Artifactory] <[hidden email]> wrote:
Hi Shay

thanks for responding.
I tried your suggestion:

[ppl@host ~]# curl -X PUT -v -u user:pass --data-binary @/test/fk/fk.zip -H "X-Checksum-Sha1:eeeee747dd26ddcadecd4ad29da7293c397dfc0f" -H "X-Checksum-Md5:eeeeec86ebb6b4247fa5c209e0826969" -i 'https://artifactory-xxx.com/artifactory/release-local/fk-SNAPSHOT/fk.zip;buildURL=http://host:8080/jenkins/job/Translation/58/;buildNumber=58;hudsonURL=http://host.com:8080/jenkins/;Revision=129172;build.parentNumber=58'

HTTP Server Error 500 was returned by curl.

Any other suggestions you may have ?

Thank you


If you reply to this email, your message will be added to the discussion below:
http://forums.jfrog.org/Cant-set-build-number-and-build-name-properties-tp7581104p7581128.html
To start a new topic under Artifactory - Users, email [hidden email]
To unsubscribe from Artifactory, click here.
NAML