diff --git a/Dockerfile b/Dockerfile index f256a2a..60574cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ # Container image that runs your code -FROM golang:1.13 +FROM golang:latest # Copies your code file from your action repository to the filesystem path `/` of the container +COPY go.mod /notifier/go.mod COPY entrypoint.sh /notifier/entrypoint.sh COPY main.go /notifier/main.go # Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/notifier/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/notifier/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 46c803a..d6bba62 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,5 @@ #!/bin/bash -go get -u github.com/FluuxIO/go-xmpp -go run /notifier/main.go "${INPUT_SERVER_HOST}" "${INPUT_RECIPIENT}" "${INPUT_JID}" "${INPUT_PASSWORD}" "${INPUT_SERVER_PORT}" "${INPUT_MESSAGE}" "${INPUT_RECIPIENT_IS_ROOM}" "${INPUT_BOT_ALIAS}" \ No newline at end of file +cd "$(dirname "$0")" +go get -d gosrc.io/xmpp +go install gosrc.io/xmpp +go run /notifier/main.go "${INPUT_SERVER_HOST}" "${INPUT_RECIPIENT}" "${INPUT_JID}" "${INPUT_PASSWORD}" "${INPUT_SERVER_PORT}" "${INPUT_MESSAGE}" "${INPUT_RECIPIENT_IS_ROOM}" "${INPUT_BOT_ALIAS}" diff --git a/go.mod b/go.mod index b615204..053018f 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,2 @@ module go-xmpp_notifier - -go 1.13 - -require gosrc.io/xmpp v0.4.0 +require gosrc.io/xmpp latest diff --git a/main.go b/main.go index 832f446..1ad3bfd 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,7 @@ func main() { Insecure: false, } router := xmpp.NewRouter() - client, err := xmpp.NewClient(config, router, errorHandler) + client, err := xmpp.NewClient(&config, router, errorHandler) if err != nil { log.Fatalf("%+v", err)