Skip to content

Commit

Permalink
build: fix release tool (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode authored Mar 18, 2020
1 parent 8512ed6 commit a0fc404
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 10 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.PHONY: build
default: build test lint contrib

SHELL := /bin/bash
BUILD_DATE=`date +%FT%T%z`
Expand All @@ -9,6 +8,9 @@ GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"`
VERSION=`git describe --always`
GO_VERSION=`go version | awk '{print $$3}'`

default: build test lint contrib
release: deps build test lint

off:
GORPOXY=off
echo BUILD_DATE=${BUILD_DATE}
Expand Down Expand Up @@ -41,7 +43,7 @@ lint:
`go env GOPATH`/bin/golangci-lint run

contrib:
git shortlog -se | cut -c8- | sort -u | awk '{print "-", $$0}' | grep -v 'users.noreply.github.com' > CONTRIBUTORS.md
#git shortlog -se | cut -c8- | sort -u | awk '{print "-", $$0}' | grep -v 'users.noreply.github.com' > CONTRIBUTORS.md

# for manual building only
deps:
Expand Down Expand Up @@ -70,7 +72,7 @@ clean:
# for releasing you need to run: go run tools/prepare-release/main.go
# $ go run tools/prepare-release/main.go -version 0.0.1 -commit -tag
release-deps:
cd /tmp && go get github.com/restic/calens
cd /tmp && rm -rf calens && git clone --quiet -b 'v0.2.0' --single-branch --depth 1 https://github.com/restic/calens &> /dev/null && cd calens && go install

# create local build versions
dist: default
Expand Down
9 changes: 5 additions & 4 deletions changelog/CHANGELOG.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- range $changes := . }}{{ with $changes -}}
Changelog for Reva {{ .Version }} ({{ .Date }})
Changelog for reva {{ .Version }} ({{ .Date }})
=======================================

The following sections list the changes in Reva {{ .Version }} relevant to
Reva users. The changes are ordered by importance.
The following sections list the changes in reva {{ .Version }} relevant to
reva users. The changes are ordered by importance.

Summary
-------
Expand All @@ -16,7 +16,7 @@ Details
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .Type }} #{{ .PrimaryID }}: {{ .Title }}
{{ range $par := .Paragraphs }}
{{ wrap $par 80 3 }}
{{ wrapIndent $par 80 3 }}
{{ end -}}
{{ range $url := .IssueURLs }}
{{ $url -}}
Expand All @@ -30,3 +30,4 @@ Details
{{ end }}{{ end }}

{{ end }}{{ end -}}

10 changes: 10 additions & 0 deletions changelog/unreleased/pull-402
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Enhancement: build daily releases

Reva was not building releases of commits to the master branch.
Thanks to @zazola.

Commit-based released are generated every time a PR is merged into master.
These releases are available at:
https://reva-releases.web.cern.ch

https://github.com/cs3org/reva/pull/402
11 changes: 11 additions & 0 deletions changelog/unreleased/pull-416
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Enhancement: improve developer experience

Reva provided the option to be run with a single configuration file by using the
-c config flag.

This PR adds the flag -dev-dir than can point to a directory containing multiple config
files. The reva daemon will launch a new process per configuration file.

Kudos to @refs.

https://github.com/cs3org/reva/pull/416
11 changes: 11 additions & 0 deletions changelog/unreleased/pull-524
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Enhancement: remove vendor support

Because @dependabot cannot update in a clean way the
vendor dependecies Reva removed support for vendored dependencies
inside the project.

Dependencies will continue to be versioned but they will
be downloaded when compiling the artefacts.

https://github.com/cs3org/reva/pull/468
https://github.com/cs3org/reva/pull/524
9 changes: 9 additions & 0 deletions changelog/unreleased/pull-555
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Enhancement: simplify configuration

Reva configuration was difficul as many of the configuration
parameters were not providing sane defaults.
This PR and the related listed below simplify the configuration.

https://github.com/cs3org/reva/pull/545
https://github.com/cs3org/reva/pull/536
https://github.com/cs3org/reva/pull/568
8 changes: 8 additions & 0 deletions changelog/unreleased/pull-568
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: improve the documentation

Documentation has been improved and can be consulted here:
https://reva.link

https://github.com/cs3org/reva/pull/561
https://github.com/cs3org/reva/pull/545
https://github.com/cs3org/reva/pull/568
12 changes: 12 additions & 0 deletions changelog/unreleased/pull-571
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Enhancement: support home storages

Reva did not have any functionality to handle home storages.
These PRs make that happen.

https://github.com/cs3org/reva/pull/562
https://github.com/cs3org/reva/pull/510
https://github.com/cs3org/reva/pull/493
https://github.com/cs3org/reva/pull/476
https://github.com/cs3org/reva/pull/469
https://github.com/cs3org/reva/pull/436
https://github.com/cs3org/reva/pull/571
12 changes: 9 additions & 3 deletions tools/prepare-release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {
}

// also the build is okay
cmd := exec.Command("make", "all")
cmd := exec.Command("make", "release")
run(cmd)

fmt.Printf("Generating new release: version=%s\n", *version)
Expand All @@ -77,7 +77,7 @@ func main() {
run(cmd)

// create new changelog
cmd = exec.Command("calens", "-o", "CHANGELOG.md")
cmd = exec.Command(getGoBin("calens"), "-o", "CHANGELOG.md")
run(cmd)

// add new VERSION and BUILD_DATE
Expand Down Expand Up @@ -109,7 +109,7 @@ func main() {
run(cmd)

// create new changelog
cmd = exec.Command("calens", "-o", "changelog/NOTE.md", "-i", path.Join(tmp, "changelog"))
cmd = exec.Command(getGoBin("calens"), "-o", "changelog/NOTE.md", "-i", path.Join(tmp, "changelog"))
run(cmd)

// Generate changelog also in the documentation
Expand Down Expand Up @@ -206,6 +206,12 @@ func createTag(version string) {
run(cmd)
}

func getGoBin(tool string) string {
cmd := exec.Command("go", "env", "GOPATH")
gopath := runAndGet(cmd)
gobin := fmt.Sprintf("%s/bin", gopath)
return path.Join(gobin, tool)
}
func run(cmd *exec.Cmd) {
var b bytes.Buffer
mw := io.MultiWriter(os.Stdout, &b)
Expand Down

0 comments on commit a0fc404

Please sign in to comment.