1
0
mirror of https://github.com/cs3org/reva.git synced 2025-04-18 13:44:12 +03:00

Migrate the buildAndPublishDocker job from Drone to GitHub Actions (#3506)

This commit is contained in:
Vasco Guita 2022-12-01 13:33:30 +01:00 committed by GitHub
parent efedf10499
commit 41d941164a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 174 additions and 265 deletions

View File

@ -71,7 +71,6 @@ def main(ctx):
# implemented for: ocisIntegrationTests and s3ngIntegrationTests
return [
checkStarlark(),
buildAndPublishDocker(),
testIntegration(),
release(),
litmusOcisOldWebdav(),
@ -80,133 +79,6 @@ def main(ctx):
virtualViews(),
] + ocisIntegrationTests(6) + s3ngIntegrationTests(12)
def buildAndPublishDocker():
return {
"kind": "pipeline",
"type": "docker",
"name": "build-and-publish-docker",
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger": {
"branch": [
"master",
],
"event": {
"exclude": [
"pull_request",
"tag",
"promote",
"rollback",
],
},
},
"steps": [
{
"name": "store-dev-release",
"image": "registry.cern.ch/docker.io/library/golang:1.19",
"environment": {
"USERNAME": {
"from_secret": "cbox_username",
},
"PASSWORD": {
"from_secret": "cbox_password",
},
},
"detach": True,
"commands": [
"TZ=Europe/Berlin go run tools/create-artifacts/main.go -dev -commit ${DRONE_COMMIT} -goversion `go version | awk '{print $$3}'`",
"curl --fail -X MKCOL 'https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/' -k -u $${USERNAME}:$${PASSWORD}",
"curl --fail -X MKCOL 'https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/'$(date +%Y-%m-%d) -k -u $${USERNAME}:$${PASSWORD}",
"curl --fail -X MKCOL 'https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/'$(date +%Y-%m-%d)'/${DRONE_COMMIT}' -k -u $${USERNAME}:$${PASSWORD}",
"for i in $(ls /drone/src/dist);do curl --fail -X PUT -u $${USERNAME}:$${PASSWORD} https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/$(date +%Y-%m-%d)/${DRONE_COMMIT}/$${i} --data-binary @./dist/$${i} ; done",
],
},
makeStep("ci"),
{
"name": "publish-docker-reva-latest",
"pull": "always",
"image": "plugins/docker",
"settings": {
"repo": "cs3org/reva",
"tags": "latest",
"dockerfile": "Dockerfile.reva",
"username": {
"from_secret": "dockerhub_username",
},
"password": {
"from_secret": "dockerhub_password",
},
"custom_dns": [
"128.142.17.5",
"128.142.16.5",
],
},
},
{
"name": "publish-docker-revad-latest",
"pull": "always",
"image": "plugins/docker",
"settings": {
"repo": "cs3org/revad",
"tags": "latest",
"dockerfile": "Dockerfile.revad",
"username": {
"from_secret": "dockerhub_username",
},
"password": {
"from_secret": "dockerhub_password",
},
"custom_dns": [
"128.142.17.5",
"128.142.16.5",
],
},
},
{
"name": "publish-docker-revad-eos-latest",
"pull": "always",
"image": "plugins/docker",
"settings": {
"repo": "cs3org/revad",
"tags": "latest-eos",
"dockerfile": "Dockerfile.revad-eos",
"username": {
"from_secret": "dockerhub_username",
},
"password": {
"from_secret": "dockerhub_password",
},
"custom_dns": [
"128.142.17.5",
"128.142.16.5",
],
},
},
{
"name": "publish-docker-revad-ceph-latest",
"pull": "always",
"image": "plugins/docker",
"settings": {
"repo": "cs3org/revad",
"tags": "latest-ceph",
"dockerfile": "Dockerfile.revad-ceph",
"username": {
"from_secret": "dockerhub_username",
},
"password": {
"from_secret": "dockerhub_password",
},
"custom_dns": [
"128.142.17.5",
"128.142.16.5",
],
},
},
],
}
def testIntegration():
return {
"kind": "pipeline",
@ -257,7 +129,6 @@ def release():
},
},
"steps": [
makeStep("ci"),
{
"name": "create-dist",
"image": "registry.cern.ch/docker.io/library/golang:1.19",

View File

@ -1,27 +0,0 @@
name: Build and Test
on:
pull_request:
paths-ignore:
- "tools/**"
- "docs/**"
- ".drone.star"
- ".drone.env"
- ".fossa.yml"
workflow_dispatch:
jobs:
build-and-test:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go environment
uses: actions/setup-go@v3.3.0
with:
go-version-file: go.mod
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@v0.3.0
- name: Build
run: make build
- name: Test
run: make test

View File

@ -1,17 +1,25 @@
name: Build Docker
on:
push:
branches:
- "master"
pull_request:
paths-ignore:
- "tools/**"
- "docs/**"
- ".drone.star"
- ".drone.env"
- ".fossa.yml"
workflow_dispatch:
jobs:
docker:
runs-on: self-hosted
strategy:
matrix:
include:
- tag: reva:latest
file: Dockerfile.reva
- tag: revad:latest
file: Dockerfile.revad
- tag: revad:latest-eos
file: Dockerfile.revad-eos
- tag: revad:latest-ceph
file: Dockerfile.revad-ceph
steps:
- name: Checkout
uses: actions/checkout@v3
@ -19,8 +27,16 @@ jobs:
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build ${{ ((github.event_name != 'pull_request') && 'and push') || '' }} ${{ matrix.tag }}
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.revad
push: ${{ github.event_name != 'pull_request' }}
file: ${{ matrix.file }}
tags: ${{ ((github.event_name != 'pull_request') && format('{0}/{1}', secrets.DOCKERHUB_USERNAME, matrix.tag)) || '' }}

View File

@ -23,17 +23,5 @@ jobs:
uses: actions/setup-go@v3.3.0
with:
go-version-file: go.mod
- name: Clone calens
uses: actions/checkout@v3
with:
repository: restic/calens
path: calens
fetch-depth: 0
ref: v0.2.0
- name: Install calens
run: cd calens && go install
- name: Check if changelog exists
run: |
$(go env GOPATH)/bin/calens | \
sed -n '/^Changelog for reva unreleased (UNRELEASED)/,/^Details/p' | \
grep -E '^ \* [[:alpha:]]{3} #${{ github.event.pull_request.number }}: '
- name: Check changelog
run: make check-changelog PR=${{ github.event.pull_request.number }}

View File

@ -1,26 +0,0 @@
name: golangci-lint
on:
pull_request:
paths-ignore:
- "Makefile"
- "docs/**"
- ".drone.star"
- ".drone.env"
- ".fossa.yml"
workflow_dispatch:
jobs:
golangci:
name: lint
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup Go environment
uses: actions/setup-go@v3.3.0
with:
go-version-file: go.mod
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1
- name: Run golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run

15
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Lint
on: [pull_request, push, workflow_dispatch]
jobs:
lint:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup Go environment
uses: actions/setup-go@v3.3.0
with:
go-version-file: go.mod
- name: Run linters
run: make lint

15
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Test
on: [pull_request, push, workflow_dispatch]
jobs:
test:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go environment
uses: actions/setup-go@v3.3.0
with:
go-version-file: go.mod
- name: Test
run: make test

2
.gitignore vendored
View File

@ -51,3 +51,5 @@ tmp/
# drone
.drone.yml
toolchain/

View File

@ -59,7 +59,7 @@ To compile the REVA daemon and the REVA command line you can:
$ git clone https://github.com/cs3org/reva
$ make
$ ./cmd/revad/revad --version
version=v0.0.0 commit=639f48d branch=review go_version=go1.11.5 build_date=2019-04-17T13:57:17+0200 build_platform=linux/amd64
version=v0.0.0 commit=639f48d branch=review go_version=go1.19 build_date=2019-04-17T13:57:17+0200 build_platform=linux/amd64
```
If you only want to run the tests you can:

View File

@ -16,7 +16,7 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
FROM golang:alpine3.13 as builder
FROM golang:alpine3.16 as builder
RUN apk --no-cache add \
ca-certificates \

View File

@ -16,7 +16,7 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
FROM golang:alpine3.13 as builder
FROM golang:alpine3.16 as builder
RUN apk --no-cache add \
ca-certificates \
@ -36,7 +36,7 @@ RUN make build-revad-docker && \
RUN mkdir -p /etc/revad/ && echo "" > /etc/revad/revad.toml
FROM golang:alpine3.13
FROM golang:alpine3.16
RUN apk --no-cache add \
mailcap

View File

@ -26,19 +26,19 @@ RUN dnf update -y && dnf install -y \
librbd-devel \
librados-devel
ADD https://golang.org/dl/go1.16.4.linux-amd64.tar.gz \
go1.16.4.linux-amd64.tar.gz
ADD https://golang.org/dl/go1.19.linux-amd64.tar.gz \
go1.19.linux-amd64.tar.gz
RUN rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz && \
rm go1.16.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz && \
rm go1.19.linux-amd64.tar.gz
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN mkdir -p /go/bin \
RUN mkdir -p /go/bin && \
make build-revad-cephfs-docker && \
cp /go/src/github/cs3org/reva/cmd/revad/revad /usr/bin/revad

113
Makefile
View File

@ -1,5 +1,3 @@
.PHONY: build
SHELL := /bin/bash
BUILD_DATE=`date +%FT%T%z`
GIT_COMMIT=`git rev-parse --short HEAD`
@ -16,9 +14,51 @@ LITMUS_USERNAME="einstein"
LITMUS_PASSWORD="relativity"
TESTS="basic http copymove props"
default: build test lint gen-doc
release: deps build test lint gen-doc
TOOLCHAIN ?= $(CURDIR)/toolchain
GOLANGCI_LINT ?= $(TOOLCHAIN)/golangci-lint
CALENS ?= $(TOOLCHAIN)/calens
GOIMPORTS ?= $(TOOLCHAIN)/goimports
.PHONY: toolchain
toolchain: $(GOLANGCI_LINT) $(CALENS) $(GOIMPORTS)
.PHONY: toolchain-clean
toolchain-clean:
rm -rf $(TOOLCHAIN)
$(GOLANGCI_LINT):
@mkdir -p $(@D)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINDIR=$(@D) sh -s v1.50.1
.PHONY: check-changelog
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run
.PHONY: lint-fix
lint-fix: $(GOLANGCI_LINT)
gofmt -w .
$(GOLANGCI_LINT) run --fix
$(CALENS):
@mkdir -p $(@D)
git clone --depth 1 --branch v0.2.0 -c advice.detachedHead=false https://github.com/restic/calens.git /tmp/calens
cd /tmp/calens && GOBIN=$(@D) go install
rm -rf /tmp/calens
.PHONY: check-changelog
check-changelog: $(CALENS)
ifndef PR
$(error PR is not defined)
else
$(CALENS) | sed -n '/^Changelog for reva unreleased (UNRELEASED)/,/^Details/p' | \
grep -E '^ \* [[:alpha:]]{3} #$(PR): '
endif
$(GOIMPORTS):
@mkdir -p $(@D)
GOBIN=$(@D) go install golang.org/x/tools/cmd/goimports@v0.3.0
.PHONY: off
off:
GOPROXY=off
echo BUILD_DATE=${BUILD_DATE}
@ -27,31 +67,54 @@ off:
echo VERSION=${VERSION}
echo GO_VERSION=${GO_VERSION}
imports: off
`go env GOPATH`/bin/goimports -w tools pkg internal cmd
.PHONY: imports
imports: off $(GOIMPORTS)
$(GOIMPORTS) -w tools pkg internal cmd
.PHONY: build
build: build-revad build-reva test-go-version
.PHONY: build-cephfs
build-cephfs: build-revad-cephfs build-reva
.PHONY: tidy
tidy:
go mod tidy
.PHONY: build-revad
build-revad: imports
go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
.PHONY: build-revad-cephfs
build-revad-cephfs: imports
go build -ldflags ${BUILD_FLAGS} -tags ceph -o ./cmd/revad/revad ./cmd/revad
.PHONY: build-reva
build-reva: imports
go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva
# to be run in Docker build
.PHONY: build-revad-docker
build-revad-docker: off
go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
.PHONY: build-revad-cephfs-docker
build-revad-cephfs-docker: off
go build -ldflags ${BUILD_FLAGS} -tags ceph -o ./cmd/revad/revad ./cmd/revad
.PHONY: build-reva-docker
build-reva-docker: off
go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva
.PHONY: test
test: off
go test -coverprofile coverage.out -race $$(go list ./... | grep -v /tests/integration)
.PHONY: test-integration
test-integration: build-ci
cd tests/integration && go test -race ./...
.PHONY: litmus-test-old
litmus-test-old: build
cd tests/oc-integration-tests/local && ../../../cmd/revad/revad -c frontend.toml &
cd tests/oc-integration-tests/local && ../../../cmd/revad/revad -c gateway.toml &
@ -60,6 +123,8 @@ litmus-test-old: build
cd tests/oc-integration-tests/local && ../../../cmd/revad/revad -c users.toml &
docker run --rm --network=host -e LITMUS_URL=$(LITMUS_URL_OLD) -e LITMUS_USERNAME=$(LITMUS_USERNAME) -e LITMUS_PASSWORD=$(LITMUS_PASSWORD) -e TESTS=$(TESTS) owncloud/litmus:latest
pkill revad
.PHONY: litmus-test-new
litmus-test-new: build
cd tests/oc-integration-tests/local && ../../../cmd/revad/revad -c frontend.toml &
cd tests/oc-integration-tests/local && ../../../cmd/revad/revad -c gateway.toml &
@ -68,49 +133,37 @@ litmus-test-new: build
cd tests/oc-integration-tests/local && ../../../cmd/revad/revad -c users.toml &
docker run --rm --network=host -e LITMUS_URL=$(LITMUS_URL_NEW) -e LITMUS_USERNAME=$(LITMUS_USERNAME) -e LITMUS_PASSWORD=$(LITMUS_PASSWORD) -e TESTS=$(TESTS) owncloud/litmus:latest
pkill revad
lint:
go vet ./...
.PHONY: contrib
contrib:
git shortlog -se | cut -c8- | sort -u | awk '{print "-", $$0}' | grep -v 'users.noreply.github.com' > CONTRIBUTORS.md
.PHONY: test-go-version
test-go-version:
@echo -e "$(MINIMUM_GO_VERSION)\n$(shell echo $(GO_VERSION) | sed 's/go//')" | sort -Vc &> /dev/null || echo -e "\n\033[33;5m[WARNING]\033[0m You are not using a supported go version. Please use $(MINIMUM_GO_VERSION) or above.\n"
# for manual building only
deps:
cd /tmp && rm -rf golangci-lint && git clone --quiet -b 'v1.42.1' --single-branch --depth 1 https://github.com/golangci/golangci-lint &> /dev/null && cd golangci-lint/cmd/golangci-lint && go install
cd /tmp && go install golang.org/x/tools/cmd/goimports@latest
.PHONY: build-ci
build-ci: off
go build -ldflags ${CI_BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
go build -ldflags ${CI_BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva
.PHONY: gen-doc
gen-doc:
go run tools/generate-documentation/main.go
# to be run in CI platform
ci: build-ci test
# to be run in Docker build
build-revad-docker: off
go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
build-revad-cephfs-docker: off
go build -ldflags ${BUILD_FLAGS} -tags ceph -o ./cmd/revad/revad ./cmd/revad
build-reva-docker: off
go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva
clean:
.PHONY: clean
clean: toolchain-clean
rm -rf dist
# create local build versions
dist: default
go run tools/create-artifacts/main.go -version ${VERSION} -commit ${GIT_COMMIT} -goversion ${GO_VERSION}
.PHONY: all
all: build test lint gen-doc
all: deps default
# create local build versions
dist: all
go run tools/create-artifacts/main.go -version ${VERSION} -commit ${GIT_COMMIT} -goversion ${GO_VERSION}
BEHAT_BIN=vendor-bin/behat/vendor/bin/behat
.PHONY: test-acceptance-api
test-acceptance-api: vendor-bin/behat/vendor
BEHAT_BIN=$(BEHAT_BIN) $(PATH_TO_CORE)/tests/acceptance/run.sh --remote --type api
@ -124,4 +177,4 @@ vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json
@echo behat composer.lock is not up to date.
composer.lock: composer.json
@echo composer.lock is not up to date.
@echo composer.lock is not up to date.

View File

@ -23,7 +23,6 @@ You need to have [Go](https://golang.org/doc/install) (version 1.16 or higher),
```
$ git clone https://github.com/cs3org/reva
$ cd reva
$ make deps
$ make build
$ mkdir -p /etc/revad
$ cp examples/storage-references/users.demo.json /etc/revad/users.json

View File

@ -0,0 +1,9 @@
Enhancement: Migrate the buildAndPublishDocker job from Drone to GitHub Actions
We've migrated the buildAndPublishDocker job from Drone to GitHub Actions workflow.
We've updated the Golang version used to build the Docker images to go1.19.
We've fixed the Cephfs storage module.
We've improved the Makefile.
We've refactored the build-docker workflow.
https://github.com/cs3org/reva/pull/3506

View File

@ -9,7 +9,7 @@ description: >
# _struct: Config_
{{% dir name="insecure" type="bool" default=false %}}
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/archiver/handler.go#L65)
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/http/services/archiver/handler.go#L63)
{{< highlight toml >}}
[http.services.archiver]
insecure = false

View File

@ -9,7 +9,7 @@ description: >
# _struct: config_
{{% dir name="insecure" type="bool" default=false %}}
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/ocm/provider/authorizer/mentix/mentix.go#L82)
Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/ocm/provider/authorizer/mentix/mentix.go#L81)
{{< highlight toml >}}
[ocm.provider.authorizer.mentix]
insecure = false

View File

@ -9,7 +9,7 @@ description: >
# _struct: ShareManagerConfig_
{{% dir name="endpoint" type="string" default="" %}}
The Nextcloud backend endpoint for user check [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/ocm/share/manager/nextcloud/nextcloud.go#L75)
The Nextcloud backend endpoint for user check [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/ocm/share/manager/nextcloud/nextcloud.go#L73)
{{< highlight toml >}}
[ocm.share.manager.nextcloud]
endpoint = ""

View File

@ -9,7 +9,7 @@ description: >
# _struct: UserManagerConfig_
{{% dir name="endpoint" type="string" default="" %}}
The Nextcloud backend endpoint for user management [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/user/manager/nextcloud/nextcloud.go#L55)
The Nextcloud backend endpoint for user management [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/user/manager/nextcloud/nextcloud.go#L53)
{{< highlight toml >}}
[user.manager.nextcloud]
endpoint = ""

View File

@ -12,6 +12,5 @@ the Go programming language that installs the Go compiler.
```
git clone https://github.com/cs3org/reva
cd reva
make deps
make build
```

View File

@ -47,10 +47,11 @@
package eos_grpc
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (

View File

@ -229,7 +229,7 @@ func (fs *cephfs) getUserByID(ctx context.Context, uid string) (*userpb.User, er
return entity.(*userpb.User), nil
}
client, err := pool.GetGatewayServiceClient(fs.conf.GatewaySvc)
client, err := pool.GetGatewayServiceClient(pool.Endpoint(fs.conf.GatewaySvc))
if err != nil {
return nil, errors.Wrap(err, "cephfs: error getting gateway grpc client")
}
@ -254,7 +254,7 @@ func (fs *cephfs) getUserByOpaqueID(ctx context.Context, oid string) (*userpb.Us
if entity, found := fs.conn.userCache.Get(oid); found {
return entity.(*userpb.User), nil
}
client, err := pool.GetGatewayServiceClient(fs.conf.GatewaySvc)
client, err := pool.GetGatewayServiceClient(pool.Endpoint(fs.conf.GatewaySvc))
if err != nil {
return nil, errors.Wrap(err, "cephfs: error getting gateway grpc client")
}
@ -281,7 +281,7 @@ func (fs *cephfs) getGroupByID(ctx context.Context, gid string) (*grouppb.Group,
return entity.(*grouppb.Group), nil
}
client, err := pool.GetGatewayServiceClient(fs.conf.GatewaySvc)
client, err := pool.GetGatewayServiceClient(pool.Endpoint(fs.conf.GatewaySvc))
if err != nil {
return nil, errors.Wrap(err, "cephfs: error getting gateway grpc client")
}
@ -305,7 +305,7 @@ func (fs *cephfs) getGroupByOpaqueID(ctx context.Context, oid string) (*grouppb.
if entity, found := fs.conn.groupCache.Get(oid); found {
return entity.(*grouppb.Group), nil
}
client, err := pool.GetGatewayServiceClient(fs.conf.GatewaySvc)
client, err := pool.GetGatewayServiceClient(pool.Endpoint(fs.conf.GatewaySvc))
if err != nil {
return nil, errors.Wrap(err, "cephfs: error getting gateway grpc client")
}

View File

@ -54,7 +54,7 @@ func main() {
}
// also the build is okay
cmd := exec.Command("make", "release")
cmd := exec.Command("make", "all")
run(cmd)
fmt.Printf("Generating new release: version=%s\n", *version)
@ -72,11 +72,11 @@ func main() {
run(cmd)
// install release-deps: calens
cmd = exec.Command("make", "release-deps")
cmd = exec.Command("make", "toolchain")
run(cmd)
// create new changelog
cmd = exec.Command(getGoBin("calens"), "-o", "CHANGELOG.md")
cmd = exec.Command("toolchain/calens", "-o", "CHANGELOG.md")
run(cmd)
// add new VERSION and BUILD_DATE
@ -108,7 +108,7 @@ func main() {
run(cmd)
// create new changelog
cmd = exec.Command(getGoBin("calens"), "-o", "changelog/NOTE.md", "-i", path.Join(tmp, "changelog"))
cmd = exec.Command("toolchain/calens", "-o", "changelog/NOTE.md", "-i", path.Join(tmp, "changelog"))
run(cmd)
// Generate changelog also in the documentation
@ -206,12 +206,6 @@ 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)