Thank you Vladimir Varankin , I dont want to use jfrog-cli. The problem I faced with jfrog-cli is - I can install jfrog-cli, and configure the artifactory using jfrog rt c and successfully go get dependencies to my test. But this approach works better on local machine. When I want to execute the tests in Docker image, I have issues configuring the proxy using jfrog cli command.
On Tuesday, October 9, 2018 at 4:08:40 AM UTC-7, Vladimir Varankin wrote: > > Hey there! > > I don't know much about jfrog, but was curious to delve into the > enterprise proxies topic. It seems that you're supposed to use jfrog's own > jfrog-cli [1] to work with the artifactory. I believe the CLI simply set a > proper value to GOPROXY to URL, that supports gomod proxy protocol API [2]. > > Check if your artifactory responses with the list from " > http://stg-repo.com/api/go/<repo>/@v/list". Note, "/api/go/" prefix is > seems what jfrog-cli uses [3]. > > [1]: https://www.jfrog.com/confluence/display/RTF/Go+Registry > [2]: https://tip.golang.org/cmd/go/#hdr-Module_proxy_protocol > [3]: > https://github.com/jfrog/jfrog-cli-go/blob/a664eede11e6988ca98f53e9541a3113e55112a8/jfrog-cli/artifactory/utils/golang/cmd.go#L52-L62 > > > On Monday, October 8, 2018 at 10:55:41 PM UTC+2, ppras...@splunk.com > wrote: >> >> I have built and published the go dependencies to our enterprise >> artifactory. >> Is there an efficient way to get the files from artifactory and use them >> in test runs? >> >> My dependencies are in jfrog artifactory. >> They appear like the following: >> >> go-local/github.com/davecgh/go-spew/@v/v1.1.1.zip >> go-local/github.com/davecgh/go-spew/@v/v1.1.1.mod >> >> How should I resolve them when I run my tests? >> >> When I set GOPROXY =“value” and tried, >> >> go get github.com/Masterminds/semver >> >> go get github.com/Masterminds/semver: unexpected status >> (http://stg-repo.com/artifactory/github.com/%21masterminds/semver/@v/list): >> 404 Not Found >> >> How can I go get the pkg from enterprise proxy and execute my tests? >> >> As a temporary hack I am doing: >> >> >> Then following >> >> cd **$** {TESTDIR}/src >> >> curl -O http://stg-repo.com/artifactory/ **$** {pkg} >> >> FIELDS=( **$** (echo **$** {pkg} | awk **'{split($0, arr, /[\/:]*/); for (x >> in arr) { print arr[x] }}'** )) >> >> INDEX=( **$** (echo **$** {FIELDS[@]/@v//} | cut -d/ -f1 | wc -w | tr -d **' >> '** )) >> >> PREV_INDEX=$INDEX-1 >> >> POST_INDEX=$INDEX+1 >> >> FILE= **$** {FIELDS[ **$** {POST_INDEX}]} >> >> unzip **$** {FILE} >> >> FILE= **$** (echo **$** {FILE} | sed -e s/^ **$** {go_local}// -e s/ **$** >> {zip}//) >> >> SOURCE= **$** (find **$** {TESTDIR}/src -name **$** {FIELDS[ **$** >> {PREV_INDEX}]}@ **$** {FILE}) >> >> DIR= **$** (dirname $SOURCE) >> >> mv $SOURCE **$** {DIR}/ **$** {FIELDS[ **$** {PREV_INDEX}]} >> >> rm -rf **$** {FILE}.zip >> >> Please let me know the correct way of doing it. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.