Skip to content
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

CI Release #334

Merged
merged 45 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8ab9834
Prepare changelog for version 0.0.1
labkode Oct 23, 2019
1afee95
Generate CHANGELOG.md for 0.0.1
labkode Oct 23, 2019
d331229
Update VERSION file to 0.0.1
labkode Oct 23, 2019
8f4493a
deps: clean
labkode Oct 23, 2019
80d1984
test
labkode Oct 24, 2019
1593095
update deps
labkode Oct 24, 2019
cf8d481
improve Makefile
labkode Oct 24, 2019
0721a0b
improve release procedure
labkode Oct 24, 2019
b8d6728
improve release procedure
labkode Oct 24, 2019
af8e444
improve release procedure
labkode Oct 24, 2019
057c7d4
improve release procedure
labkode Oct 24, 2019
4092e01
Revert "improve release procedure"
labkode Oct 24, 2019
f76ebea
clean
labkode Oct 24, 2019
e5d139d
improve release procedure
labkode Oct 24, 2019
3b6cd1f
improve release procedure
labkode Oct 24, 2019
c46e465
clean
labkode Oct 24, 2019
3583d0a
clean
labkode Oct 24, 2019
781bb5a
no changes
labkode Oct 24, 2019
6693575
improve
labkode Oct 24, 2019
d22044d
improve
labkode Oct 24, 2019
051219e
new pr
labkode Oct 24, 2019
c668bdd
changelog: update pull-334
labkode Oct 24, 2019
5e9b73e
fix unreleased
labkode Oct 24, 2019
459eb51
fix
labkode Oct 24, 2019
b358666
improve release
labkode Oct 24, 2019
a90f740
improve
labkode Oct 24, 2019
fb9d54e
improve
labkode Oct 24, 2019
6c36db3
improve
labkode Oct 24, 2019
c46f8f9
improve
labkode Oct 24, 2019
0f8f184
improve
labkode Oct 24, 2019
2faf402
improve release
labkode Oct 24, 2019
49c3ded
test
labkode Oct 24, 2019
7e725d0
improve
labkode Oct 24, 2019
b810d62
improve
labkode Oct 24, 2019
102b210
set version for golangci-lint
labkode Oct 24, 2019
914e985
remove branch ldflag
labkode Oct 24, 2019
89c2657
fix drone
labkode Oct 24, 2019
d02c6a4
Merge branch 'master' into ci-release
labkode Oct 24, 2019
fb0b00f
publish docker images
labkode Oct 24, 2019
7e4bf01
improve
labkode Oct 24, 2019
55f2983
v0.0.1
labkode Oct 24, 2019
5689802
fix release
labkode Oct 24, 2019
7babc1a
fix drone
labkode Oct 24, 2019
1c80fca
Revert "v0.0.1"
labkode Oct 24, 2019
639970f
Merge remote-tracking branch 'origin/master' into ci-release
labkode Oct 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,83 @@ steps:
commands:
- wget -qO- https://github.com/fossas/fossa-cli/releases/download/v1.0.11/fossa-cli_1.0.11_linux_amd64.tar.gz | tar xvz -C /go/bin/
- /go/bin/fossa test

---
kind: pipeline
type: docker
name: release

platform:
os: linux
arch: amd64

trigger:
event:
include:
- tag

steps:
- name: license-scan
image: golang:1.13
environment:
FOSSA_API_KEY:
from_secret: fossa_api_key
commands:
- wget -qO- https://github.com/fossas/fossa-cli/releases/download/v1.0.11/fossa-cli_1.0.11_linux_amd64.tar.gz | tar xvz -C /go/bin/
- /go/bin/fossa analyze

- name: build
image: golang:1.13
commands:
- make ci

- name: lint
image: golangci/golangci-lint:v1.21.0
commands:
- golangci-lint run

- name: license-check
image: golang:1.13
environment:
FOSSA_API_KEY:
from_secret: fossa_api_key
commands:
- wget -qO- https://github.com/fossas/fossa-cli/releases/download/v1.0.11/fossa-cli_1.0.11_linux_amd64.tar.gz | tar xvz -C /go/bin/
- /go/bin/fossa test

- name: create-dist
image: golang:1.13
commands:
- go run tools/create-artifacts/main.go -version ${DRONE_TAG} -commit ${DRONE_COMMIT} -goversion `go version | awk '{print $$3}'`

- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: dist/*
note: changelog/NOTE.md

- name: docker-reva-tag
pull: always
image: plugins/docker
settings:
repo: cs3org/reva
tags: ${DRONE_TAG}
dockerfile: Dockerfile.reva
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password

- name: docker-revad-tag
pull: always
image: plugins/docker
settings:
repo: cs3org/revad
tags: ${DRONE_TAG}
dockerfile: Dockerfile.revad
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
cmd/revad/revad
cmd/revad/revad.pid
cmd/reva/reva
tools/release/release

# Ignore pid files
*.pid
Expand All @@ -33,3 +34,4 @@ docs/node_modules/
docs/tech-doc-hugo
docs/themes/

dist/
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Changelog for Reva unreleased (UNRELEASED)
=======================================

The following sections list the changes in Reva unreleased relevant to
Reva users. The changes are ordered by importance.

Summary
-------

* Enh #243: Create reference when accepting a share

Details
-------

* Enhancement #243: Create reference when accepting a share

When accepting a share only the state information changed for the share was not merged into the
user tree. Now after accepting a share, the share is mounted into the user tree in a location
specified by the user.

https://github.com/reva/reva/pull/243


39 changes: 27 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,30 @@ GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"`
VERSION=`git describe --always`
GO_VERSION=`go version | awk '{print $$3}'`
BUILD_PLATFORM=`go version | awk '{print $$4}'`

LDFLAGS=-ldflags "-s -X main.buildDate=${BUILD_DATE} -X main.gitCommit=${GIT_DIRTY}${GIT_COMMIT} -X main.gitBranch=${GIT_BRANCH} -X main.version=${VERSION} -X main.goVersion=${GO_VERSION} -X main.buildPlatform=${BUILD_PLATFORM}"

off:
GORPOXY=off
echo BUILD_DATE=${BUILD_DATE}
echo GIT_COMMIT=${GIT_COMMIT}
echo GIT_DIRTY=${GIT_DIRTY}
echo VERSION=${VERSION}
echo GO_VERSION=${GO_VERSION}

imports: off
goimports -w tools pkg internal cmd

build: imports
go build -mod=vendor -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
go build -mod=vendor -o ./cmd/reva/reva ${LDFLAGS} ./cmd/reva
go build -mod=vendor -o ./cmd/revad/revad ./cmd/revad
go build -mod=vendor -o ./cmd/reva/reva ./cmd/reva

tidy:
go mod tidy

build-revad: imports
go build -mod=vendor -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
go build -mod=vendor -o ./cmd/revad/revad ./cmd/revad

build-reva: imports
go build -mod=vendor -o ./cmd/reva/reva ${LDFLAGS} ./cmd/reva
go build -mod=vendor -o ./cmd/reva/reva ./cmd/reva

test: off
go test -mod=vendor -race ./...
Expand All @@ -42,12 +44,13 @@ contrib:

# for manual building only
deps:
cd /tmp && go get github.com/golangci/golangci-lint/cmd/golangci-lint
cd /tmp && rm -rf golangci-lint && git clone --quiet -b 'v1.21.0' --single-branch --depth 1 https://github.com/golangci/golangci-lint &> /dev/null && cd golangci-lint/cmd/golangci-lint && go install
cd /tmp && go get golang.org/x/tools/cmd/goimports

build-ci: off
go build -mod=vendor -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
go build -mod=vendor -o ./cmd/reva/reva ${LDFLAGS} ./cmd/reva
go build -mod=vendor -o ./cmd/revad/revad ./cmd/revad
go build -mod=vendor -o ./cmd/reva/reva ./cmd/reva

lint-ci:
go run tools/check-license/check-license.go

Expand All @@ -57,7 +60,19 @@ ci: build-ci test lint-ci

# to be run in Docker build
build-revad-docker: off
go build -mod=vendor -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
go build -mod=vendor -o ./cmd/revad/revad ./cmd/revad
build-reva-docker: off
go build -mod=vendor -o ./cmd/revad/reva ${LDFLAGS} ./cmd/reva
go build -mod=vendor -o ./cmd/revad/reva ./cmd/reva
clean:
rm -rf dist

# 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

# create local build versions
dist: default
go run tools/create-artifacts/main.go -version ${VERSION} -commit ${GIT_COMMIT} -goversion ${GO_VERSION}

all: deps default
32 changes: 32 additions & 0 deletions changelog/CHANGELOG.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- range $changes := . }}{{ with $changes -}}
Changelog for Reva {{ .Version }} ({{ .Date }})
=======================================

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

Summary
-------
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .TypeShort }} #{{ .PrimaryID }}: {{ .Title }}
{{- end }}{{ end }}

Details
-------
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .Type }} #{{ .PrimaryID }}: {{ .Title }}
{{ range $par := .Paragraphs }}
{{ wrap $par 80 3 }}
{{ end -}}
{{ range $url := .IssueURLs }}
{{ $url -}}
{{ end -}}
{{ range $url := .PRURLs }}
{{ $url -}}
{{ end -}}
{{ range $url := .OtherURLs }}
{{ $url -}}
{{ end }}
{{ end }}{{ end }}

{{ end }}{{ end -}}
14 changes: 14 additions & 0 deletions changelog/TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Bugfix: Fix behavior for foobar (in present tense)

We've fixed the behavior for foobar, a long-standing annoyance for Reva
users.

The text in the paragraphs is written in past tense. The last section is a list
of issue URLs, PR URLs and other URLs. The first issue ID (or the first PR ID,
in case there aren't any issue links) is used as the primary ID.

https://github.com/cs3org/reva/issues/292
https://github.com/cs3org/reva/pull/323

Note: you can use Bugfix or Enhancement as the first keyword to denote
either a bufix or an improvement.
31 changes: 31 additions & 0 deletions changelog/changelog-github.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- range $changes := . }}{{ with $changes -}}
Changelog for Reva {{ .Version }} ({{ .Date }})
=======================================

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

Summary
-------
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .TypeShort }} [#{{ .PrimaryID }}]({{ .PrimaryURL }}): {{ .Title }}
{{- end }}{{ end }}

Details
-------
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .Type }} #{{ .PrimaryID }}: {{ .Title }}
{{ range $par := .Paragraphs }}
{{ $par }}
{{ end }}
{{ range $id := .Issues -}}
{{ ` ` }}[#{{ $id }}](https://github.com/reva/reva/issues/{{ $id -}})
{{- end -}}
{{ range $id := .PRs -}}
{{ ` ` }}[#{{ $id }}](https://github.com/reva/reva/pull/{{ $id -}})
{{- end -}}
{{ ` ` }}{{ range $url := .OtherURLs -}}
{{ $url -}}
{{- end }}
{{ end }}{{ end }}

{{ end }}{{ end -}}
8 changes: 8 additions & 0 deletions changelog/unreleased/pull-334
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Create release procedure for Reva

Reva did not have any procedure to release versions.
This PR brings a new tool to release Reva versions (tools/release)
and prepares the necessary files for artefact distributed made from Drone
into Github pages.

https://github.com/reva/reva/pull/334
3 changes: 1 addition & 2 deletions cmd/reva/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import (
var (
conf *config

// Compile time variables
gitCommit, gitBranch, buildDate, version, goVersion, buildPlatform string
gitCommit, buildDate, version, goVersion string
)

func main() {
Expand Down
6 changes: 2 additions & 4 deletions cmd/reva/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ var versionCommand = func() *command {
cmd.Action = func() error {
msg := "version=%s "
msg += "commit=%s "
msg += "branch=%s "
msg += "go_version=%s "
msg += "build_date=%s "
msg += "build_platform=%s\n"
msg += "build_date=%s\n"

fmt.Printf(msg, version, gitCommit, gitBranch, goVersion, buildDate, buildPlatform)
fmt.Printf(msg, version, gitCommit, goVersion, buildDate)
return nil
}
return cmd
Expand Down
8 changes: 3 additions & 5 deletions cmd/revad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
pidFlag = flag.String("p", "", "pid file. If empty defaults to a random file in the OS temporary directory")

// Compile time variables initialez with gcc flags.
gitCommit, gitBranch, buildDate, version, goVersion, buildPlatform string
gitCommit, buildDate, version, goVersion string
)

type coreConf struct {
Expand Down Expand Up @@ -190,12 +190,10 @@ func getWriter(out string) (io.Writer, error) {
func getVersionString() string {
msg := "version=%s "
msg += "commit=%s "
msg += "branch=%s "
msg += "go_version=%s "
msg += "build_date=%s "
msg += "build_platform=%s"
msg += "build_date=%s"

return fmt.Sprintf(msg, version, gitCommit, gitBranch, goVersion, buildDate, buildPlatform)
return fmt.Sprintf(msg, version, gitCommit, goVersion, buildDate)
}

func handleVersionFlag() {
Expand Down
8 changes: 8 additions & 0 deletions docs/content/en/docs/Changelog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Changelog"
linkTitle: "Changelog"
weight: 40
description: >
Changelog of Reva releases
---

1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ require (
github.com/pkg/errors v0.8.1
github.com/pkg/xattr v0.4.1
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 // indirect
github.com/rs/cors v1.7.0
github.com/rs/zerolog v1.15.0
go.opencensus.io v0.22.1
Expand Down
Loading