1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

docs: how to publish to nexus

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2020-09-23 21:41:05 -03:00
parent 4fa87989a6
commit f3c54f0904
4 changed files with 21 additions and 23 deletions

View File

@ -0,0 +1,18 @@
# Publish to Nexus
Example of a [publishers](/customization/publishers/) section pushing files to a Nexus instance:
```yaml
publishers:
- name: nexus
cmd: >-
curl -k -u "{{ .Env.NEXUS_USERNAME }}:{{ .Env.NEXUS_PASSWORD }}"
-X POST
-H "Accept: application/json"
-H "Content-Type: multipart/form-data"
"https://nexuspro.somehost.com/service/rest/v1/components?repository=go-raw-autopub"
-F "raw.directory={{ tolower .Env.PROJECT_KEY }}/{{ tolower .ProjectName }}/{{ .Version }}"
-F "raw.asset1=@{{ .ArtifactName }};type=application/gzip"
-F "raw.asset1.filename={{ .ArtifactName }}"
dir: "{{ dir .ArtifactPath }}"
```

View File

@ -1,4 +1,4 @@
# How to release a library
# Release a library
Maybe you don't want to actually release binaries, but just generate a changelog and whatnot for your Go libraries? GoReleaser got you covered!

View File

@ -11,7 +11,7 @@ executed for each (filtered) artifact. For example, there will be a total of
6 executions for 2 publishers with 3 artifacts.
Publishers run sequentially in the order they're defined
and executions are parallelised between all artifacts.
and executions are parallelized between all artifacts.
In other words the publisher is expected to be safe to run
in multiple instances in parallel.
@ -108,24 +108,3 @@ which may require non-trivial authentication or has otherwise complex requiremen
!!! tip
Learn more about the [name template engine](/customization/templates).
## Examples
### Publish to Nexus
Example of a `publishers` section pushing files to a Nexus instance:
```yaml
publishers:
- name: nexus
cmd: >-
curl -k -u "{{ .Env.NEXUS_USERNAME }}:{{ .Env.NEXUS_PASSWORD }}"
-X POST
-H "Accept: application/json"
-H "Content-Type: multipart/form-data"
"https://nexuspro.somehost.com/service/rest/v1/components?repository=go-raw-autopub"
-F "raw.directory={{ tolower .Env.PROJECT_KEY }}/{{ tolower .ProjectName }}/{{ .Version }}"
-F "raw.asset1=@{{ .ArtifactName }};type=application/gzip"
-F "raw.asset1.filename={{ .ArtifactName }}"
dir: "{{ dir .ArtifactPath }}"
```

View File

@ -87,6 +87,7 @@ nav:
- About: cookbooks/index.md
- cookbooks/semantic-release.md
- cookbooks/release-a-library.md
- cookbooks/publish-to-nexus.md
- tutorials.md
- links.md