This should be everything relevant. I removed PLUGIN_ for secrets
$ drone secret ls ecray/test_curl
nexus_username
Events: push, tag, deployment
Images: docker.example.com/drone-curl
nexus_password
Events: push, tag, deployment
Images: docker.example.com/drone-curl
$ drone repo info ecray/test_curl
Owner: ecray
Repo: test_curl
Type: git
Config: .drone.yml
Visibility: private
Private: true
Trusted: false
Gated: false
Remote: https://github.example.com/ecray/test_curl.git
$ drone build info ecray/test_curl 30
Number: 30
Status: success
Event: pull_request
Commit: 0d6b13230ed83f3b067fd2f398000a1141869acd
Branch: master
Ref: refs/pull/1/merge
Message: adding tests
Author: ecray
.drone.yml file
pipeline:
build:
image: docker.example.com/alpine:3.7
commands:
- touch test_package.tgz
nexus:
image: docker.example.com/drone-curl
pull: true
file: test_package.tgz
url: https://nexus3.example.com/repository/3rd-party/
secrets: [ nexus_username, nexus_password ]
Plugin script
#!/bin/sh
echo "User: ${NEXUS_USERNAME}"
#env
curl -v \
-u ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \
-T ${PLUGIN_FILE} \
${PLUGIN_URL}
Example from build:
User:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
Trying 1.1.1.3
* TCP_NODELAY set
* Connected to nexus3.example.com (1.1.1.3) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
} [233 bytes data]
* TLSv1.2 (IN), TLS handshake, Server hello (2):
{ [89 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [4765 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [333 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [70 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
{ [1 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
... removing identity info
< HTTP/1.1 401 Unauthorized
< Server: nginx/1.10.2
< Date: Fri, 22 Jun 2018 02:53:00 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Keep-Alive: timeout=5
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
< X-Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
* Authentication problem. Ignoring this.
< WWW-Authenticate: BASIC realm="Sonatype Nexus Repository Manager"
* HTTP error before end of send, stop sending
<
{ [5 bytes data]
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
} [2 bytes data]
Thanks for the help!