New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enterprise broken? #472

Closed
automaticgiant opened this Issue Dec 18, 2017 · 14 comments

Comments

Projects
None yet
3 participants
@automaticgiant

automaticgiant commented Dec 18, 2017

Prerequisites

  • Are you running the latest version? (39)
  • Did you perform a search to see if this problem was already reported?

Description

enterprise support seems broken.

Environment

  • homebrew, freshly tapped
  • Darwin f45c89bd73ab 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

Steps to Reproduce

• loaded config file config={c1cacert { false false map[]} { { } [] [] map[]} [{[linux darwin windows] [amd64] [] [] . c1cacert { map[]} [] map[]}] { [] false map[] [] map[]} {[] [] [] map[] map[]} { map[] map[]} { map[]} { map[]} [] [] {{[] map[]} map[]} { [] } {[] [] [] [] { map[]} [] map[]} {https://github.redacted/api/v3/ https://github.redacted/api/uploads/ https://github.redacted/} map[]}

Expected behavior: [What you expected to happen]

stuff to release

Actual behavior: [What actually happened]

404s, weird interpolation.

with ssh origin:

   • RELEASING TO GITHUB
      • creating or updating release repo=git@github.redacted:automaticgiant/c1cacert tag=v0.0.1
      • release updated           url=
      ⨯ release failed after 15.42s error=POST https://github.redacted/api/v3/repos/git@github.redacted:automaticgiant/c1cacert/releases: 404 Not Found []

after changing origin to http:

   • RELEASING TO GITHUB
      • creating or updating release repo=https:/ tag=v0.0.1
      • release updated           url=
      ⨯ release failed after 12.91s error=POST https://github.redacted/api/v3/repos/https://releases: 404 Not Found []
@caarlos0

This comment has been minimized.

Member

caarlos0 commented Dec 18, 2017

Hi @automaticgiant

How dows your goreleaser.yml file looks like?

this creating or updating release repo=git@github.redacted:automaticgiant/c1cacert log doesn't seem right...

@caarlos0

This comment has been minimized.

Member

caarlos0 commented Feb 13, 2018

closing due to lack of info and inactivity

@caarlos0 caarlos0 closed this Feb 13, 2018

@mohanraj-r

This comment has been minimized.

mohanraj-r commented May 7, 2018

@caarlos0 I am also facing the same issue
Cool project btw 👍
Wish I could get it to working..

Here is my .goreleaser.yml

# Build customization
builds:
  -
    main: ./cmd/main.go
    binary: reporter
    goos:
      - darwin
      - linux
    goarch:
      - amd64
before:
  hooks:
    - gometalinter ./... --exclude=/usr/local
    - go test -v -cover ./...
release:
  github:
    owner: me
    name: reporter
github_urls:
    api: https://git.redacted.com/api/v3/
    upload: https://git.redacted.com/api/v3/
    download: https://git.redacted.com/api/v3/
env_files:
  github_token : goreleaser

Output

$ goreleaser --rm-dist --release-notes=Changelog.md --skip-validate --debug
   • RELEASING TO GITHUB
      • creating or updating release repo=me/reporter tag=v0.1.0
      • release updated           url=https://git.redacted.com/me/reporter/releases/tag/v0.1.0
      • uploading to release      file=dist/reporter_0.1.0_darwin_amd64.tar.gz name=reporter_0.1.0_darwin_amd64.tar.gz
      • uploading to release      file=dist/reporter_0.1.0_checksums.txt name=reporter_0.1.0_checksums.txt
      • uploading to release      file=dist/reporter_0.1.0_linux_amd64.tar.gz name=reporter_0.1.0_linux_amd64.tar.gz
   ⨯ release failed after 6.85s error=POST https://git.redacted.com/api/v3/repos/me/reporter/releases/5382/assets?name=reporter_0.1.0_checksums.txt: 404 Not Found []

Version

$ goreleaser -v
0.73.1, commit c3988a30fc96b211432d289e0bf7c6fb3b24885b, built at 2018-05-04T04:06:03Z
@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

hi @mohanraj-r, thanks for the infos!

Can you run without --skip-validate and paste the logs here?

@mohanraj-r

This comment has been minimized.

mohanraj-r commented May 8, 2018

@caarlos0 Here is the output without --skip-validate

$ goreleaser --rm-dist --release-notes=Changelog.md  --debug
....
 • WRITING EFFECTIVE CONFIG FILE
      • writing                   config=dist/config.yaml
   • GENERATING CHANGELOG
      • skipped                   reason=release notes already provided via --release-notes
   • LOADING ENVIRONMENT VARIABLES
   • BUILDING BINARIES
      • building                  build={[darwin linux] [amd64] [6] [darwin_amd64 linux_amd64] [] ./cmd/main.go -s -w -X main.version={{.Version}} -X main.comm
it={{.Commit}} -X main.date={{.Date}}  reporter { } [] go  }
      • building                  binary=dist/darwin_amd64/reporter
      • building                  binary=dist/linux_amd64/reporter
      • running                   cmd=[go build -ldflags=-s -w -X main.version=0.1.0 -X main.commit=dd90921feb75945b4463f905f313667bd242e2fc -X main.date=2018-
05-08T18:43:29Z -o dist/darwin_amd64/reporter ./cmd/main.go] env=[GOOS=darwin GOARCH=amd64 GOARM=]
      • running                   cmd=[go build -ldflags=-s -w -X main.version=0.1.0 -X main.commit=dd90921feb75945b4463f905f313667bd242e2fc -X main.date=2018-
05-08T18:43:29Z -o dist/linux_amd64/reporter ./cmd/main.go] env=[GOOS=linux GOARCH=amd64 GOARM=]
      • added new artifact        name=reporter path=dist/linux_amd64/reporter type=Binary
      • added new artifact        name=reporter path=dist/darwin_amd64/reporter type=Binary
   • CREATING ARCHIVES
      • creating                  archive=dist/reporter_0.1.0_darwin_amd64.tar.gz
      • creating                  archive=dist/reporter_0.1.0_linux_amd64.tar.gz
      • adding Changelog.md
      • adding Changelog.md
      • adding README.md
      • adding README.md
      • adding reporter
      • adding reporter
      • added new artifact        name=reporter_0.1.0_linux_amd64.tar.gz path=dist/reporter_0.1.0_linux_amd64.tar.gz type=UploadableArchive
      • added new artifact        name=reporter_0.1.0_darwin_amd64.tar.gz path=dist/reporter_0.1.0_darwin_amd64.tar.gz type=UploadableArchive
   • CREATING LINUX PACKAGES WITH NFPM
      • skipped                   reason=no output formats configured
   • CREATING LINUX PACKAGES WITH SNAPCRAFT
      • skipped                   reason=no summary nor description were provided
   • CALCULATING CHECKSUMS
      • added new artifact        name=reporter_0.1.0_checksums.txt path=dist/reporter_0.1.0_checksums.txt type=Checksum
      • checksumming              file=reporter_0.1.0_linux_amd64.tar.gz
	  • checksumming              file=reporter_0.1.0_darwin_amd64.tar.gz
   • SIGNING ARTIFACTS
      • skipped                   reason=artifact signing disabled
   • CREATING DOCKER IMAGES
      • skipped                   reason=docker section is not configured
   • RELEASING TO ARTIFACTORY
      • skipped                   reason=artifactory section is not configured
   • RELEASING TO GITHUB
      • creating or updating release repo=me/reporter tag=v0.1.0
      • release updated           url=https://git.redacted.com/me/reporter/releases/tag/v0.1.0
      • uploading to release      file=dist/reporter_0.1.0_linux_amd64.tar.gz name=reporter_0.1.0_linux_amd64.tar.gz
      • uploading to release      file=dist/reporter_0.1.0_darwin_amd64.tar.gz name=reporter_0.1.0_darwin_amd64.tar.gz
      • uploading to release      file=dist/reporter_0.1.0_checksums.txt name=reporter_0.1.0_checksums.txt
   ⨯ release failed after 8.13s error=POST https://git.redacted.com/api/v3/repos/me/reporter/releases/5397/assets?name=reporter_0.1.0
_checksums.txt: 404 Not Found []

Made sure to clear out the existing releases/tags in github before triggering this - but that didn't seem to make a difference. The release does get created in github with specified release notes and the source code archives. Its the contents of the dist which don't get uploaded.

@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

yeah, I think your upload URL is wrong on settings, it usually is something like uploads.github.foo.bar

    upload: https://git.redacted.com/api/v3/

https://goreleaser.com/environment/#github-enterprise

@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

see also: #365 (comment)

@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

please let me know if it works, if so, I'll update the docs 😄

@caarlos0 caarlos0 reopened this May 8, 2018

@mohanraj-r

This comment has been minimized.

mohanraj-r commented May 8, 2018

Thanks @caarlos0 . Finally got it working ! The URLs that worked for me were

    api: https://git.company.com/api/v3/
    upload: https://git.company.com/api/uploads/
    download: https://git.company.com/

Tried without v3 in api and with v3 in upload - didn't work. Guess that is how it is configured here.
Would be nice if github had an easy way of discovering these urls.

Btw what is the download url used for ?
Would be nice to have a replace/update option for release to update/overwrite existing releases - instead of having to manually delete them in github ui.

@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

Btw what is the download url used for ?

for homebrew formulas, for instance, you can it empty if you don't use brew...

@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

Would be nice to have a replace/update option for release to update/overwrite existing releases - instead of having to manually delete them in github ui.

as long the tag is the same, if you run goreleaser again it will edit the pre-existing release.

@caarlos0 caarlos0 added docs and removed needs-more-info labels May 8, 2018

@caarlos0 caarlos0 added this to the v1.0.0 milestone May 8, 2018

@caarlos0 caarlos0 self-assigned this May 8, 2018

@mohanraj-r

This comment has been minimized.

mohanraj-r commented May 8, 2018

Thanks for the clarifications @caarlos0

as long the tag is the same, if you run goreleaser again it will edit the pre-existing release.

Tried that - it fails with the error msg ReleaseAsset .. already_exists

 ⨯ release failed after 7.09s error=POST https://git.company.com/api/uploads/repos/me/reporter/releases/5400/assets?name=reporter_0.1.0_checksums.txt: 422 Validation Failed [{Resource:ReleaseAsset Field:name Code:already_exists Message:}]
@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 8, 2018

ohhh, yeah, indeed, it doesn't override the assets... if you delete the assets and run again it will work, though...

I'm not sure if it is a good idea to delete the assets if they already exist... seems like a good thing to do but can also lead to confusion (if we override without the knowledge of the user)

so, for, now, I think this part we can leave as-is.

@caarlos0 caarlos0 closed this in 0cdf994 May 8, 2018

@caarlos0

This comment has been minimized.

Member

caarlos0 commented May 9, 2018

docs improved, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment