blastehh / vuepress-docker

https://hub.docker.com/r/blasteh/vuepress
MIT License
13 stars 5 forks source link

build issue webhook #2

Closed wardwygaerts closed 3 years ago

wardwygaerts commented 4 years ago

Hi

I'm using your repo since more than a year with some small modifications. Now I wanted to rebuild mine, because I was still on an old version of vuepress. But I get the followong error message at Step 4/14 : RUN chmod +x ./build.sh && ./build.sh `package github.com/adnanh/webhook/hook: cannot find package "github.com/adnanh/webhook/hook" in any of: /usr/lib/go/src/github.com/adnanh/webhook/hook (from $GOROOT) /root/go/src/github.com/adnanh/webhook/hook (from $GOPATH) Note: switching to 'v1.2.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at f58768c Add support for setting variant bits other than RFC4122. webhook.go:16:2: cannot find package "github.com/adnanh/webhook/hook" in any of: /usr/lib/go/src/github.com/adnanh/webhook/hook (from $GOROOT) /root/go/src/github.com/adnanh/webhook/hook (from $GOPATH)`

I also simply cloned your repo and tried to build it without any modification,s and I get the same error...

blastehh commented 4 years ago

I tracked down the issue to the webhook repo using newer versions of go. They now require version 1.14. The only version of alpine that has 1.14 is the edge version at the moment.

You can work around the build issue by doing the following: Change the first line of the Dockerfile to:

FROM alpine:edge as build

Change build.sh to:

#!/bin/ash

mkdir -p ~/webhook
curl -sL https://github.com/adnanh/webhook/archive/2.7.0.tar.gz | tar -xvz --strip-components=1 -C ~/webhook
cd ~/webhook
go get -d
go build -o /usr/local/bin/webhook
wardwygaerts commented 4 years ago

I changed the lines like you mentioned, but still receiving error during build. The build finishes, but after deploying the container and triggering the webhook, I see this message and nothing gets generated: [webhook] 2020/06/07 11:40:43 [710a6f] incoming HTTP GET request from 172.18.0.1:53764 [webhook] 2020/06/07 11:40:43 [710a6f] vuepress-webhook got matched [webhook] 2020/06/07 11:40:43 [710a6f] error parsing body payload due to unsupported content type header: [webhook] 2020/06/07 11:40:43 [710a6f] vuepress-webhook hook triggered successfully [webhook] 2020/06/07 11:40:43 [710a6f] 200 | 0 B | 256.852µs | 192.168.0.4:9090 | GET /hooks/vuepress-webhook [webhook] 2020/06/07 11:40:43 [710a6f] executing /vuepress-webhook.sh (/vuepress-webhook.sh) with arguments ["/vuepress-webhook.sh"] and environment [] using / as cwd

build errors: webhook-2.7.0/webhook_test.go go: downloading github.com/gofrs/uuid v3.2.0+incompatible go: downloading github.com/gorilla/mux v1.7.3 go: downloading github.com/dustin/go-humanize v1.0.0 go: downloading gopkg.in/fsnotify.v1 v1.4.2 go: downloading github.com/ghodss/yaml v1.0.0 go: downloading github.com/clbanning/mxj v1.8.4 go: downloading golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 go: downloading gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 go: downloading github.com/go-chi/chi v4.0.2+incompatible

Step 6/14 : RUN yarn global add vuepress && mkdir -p /root/src /root/html && apk add rsync curl git ---> Running in ac7454b99371 yarn global v1.22.4 [1/4] Resolving packages... warning vuepress > @vuepress/core > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. warning vuepress > @vuepress/core > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. warning vuepress > @vuepress/core > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. warning vuepress > @vuepress/core > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. warning vuepress > @vuepress/theme-default > docsearch.js > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning vuepress > @vuepress/theme-default > docsearch.js > hogan.js > mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) warning vuepress > @vuepress/core > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning vuepress > @vuepress/core > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated warning vuepress > @vuepress/theme-default > stylus > css-parse > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated [2/4] Fetching packages... warning url-loader@1.1.2: Invalid bin field for "url-loader".

blastehh commented 4 years ago

That's not an issue with the build, it looks like you are triggering the webhook incorrectly. As it's an error from the webhook project itself, you may want to check with them directly: https://github.com/adnanh/webhook

blastehh commented 4 years ago

Actually, looking at that output, it says that the webhook script was executed anyway, so the issue is probably somewhere else. Did you run the container correctly? mount volumes etc?

wardwygaerts commented 4 years ago

I noticed that it does generate my files correctly, but it's taking longer than before. I'll try to find out why this is happening.

blastehh commented 3 years ago

Been a while, but I've updated to the latest webhook package and it builds fine without hacks. Closing this.