Skip to content

Add a target to prepare go.mod for a specified gotify version #2

@eternal-flame-AD

Description

@eternal-flame-AD

Currently, .travis.yml makes sure that the go.mod in the repo is fit with the master branch of gotify in every build. Thus every automated build is made against the master branch and thus might not work with the latest release of gotify server.

I suggest adding a update-go-mod target to update the go.mod to fit a certain gotify version:

update-go-mod: create-build-dir
	wget -LO ${BUILDDIR}/gotify-server.mod https://raw.githubusercontent.com/gotify/server/${GOTIFY_VERSION}/go.mod
	gomod-cap -from ${BUILDDIR}/gotify-server.mod -to go.mod
	rm ${BUILDDIR}/gotify-server.mod || true
	go mod tidy

So in .travis.yml to can do this to build for different versions of gotify.

- before-deploy:
  - GO111MODULE=off go get gopkg.in/mikefarah/yq.v2
  - >
      for TARGET in v1.3.0 v1.3.1 master; do
        TARGET_GO_VERSION=$(curl -fsSL "https://raw.githubusercontent.com/gotify/server/$TARGET/.travis.yml" | yq.v2 read - go\[0\]);
        eval "$(gimme ${TARGET_GO_VERSION})";
        make GOTIFY_VERSION=${TARGET} update-go-mod;
        make build;
      done

In this way, the built plugin would be guranteed to have the same go toolchain version and depencencies with the corresponding gotify/server target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions