2018-01-25 19:11:32 +08:00
|
|
|
SHELL = bash
|
2019-09-17 21:22:47 +08:00
|
|
|
# Branch we are working on
|
2020-06-16 01:27:20 +08:00
|
|
|
BRANCH := $(or $(BUILD_SOURCEBRANCHNAME),$(lastword $(subst /, ,$(GITHUB_REF))),$(shell git rev-parse --abbrev-ref HEAD))
|
2019-09-17 21:22:47 +08:00
|
|
|
# Tag of the current commit, if any. If this is not "" then we are building a release
|
|
|
|
RELEASE_TAG := $(shell git tag -l --points-at HEAD)
|
|
|
|
# Version of last release (may not be on this branch)
|
|
|
|
VERSION := $(shell cat VERSION)
|
|
|
|
# Last tag on this branch
|
2018-09-01 23:49:05 +08:00
|
|
|
LAST_TAG := $(shell git describe --tags --abbrev=0)
|
2020-08-19 04:24:54 +08:00
|
|
|
# Next version
|
2020-09-03 18:29:33 +08:00
|
|
|
NEXT_VERSION := $(shell echo $(VERSION) | awk -F. -v OFS=. '{print $$1,$$2+1,0}')
|
|
|
|
NEXT_PATCH_VERSION := $(shell echo $(VERSION) | awk -F. -v OFS=. '{print $$1,$$2,$$3+1}')
|
2019-09-17 21:22:47 +08:00
|
|
|
# If we are working on a release, override branch to master
|
|
|
|
ifdef RELEASE_TAG
|
2018-09-01 23:49:05 +08:00
|
|
|
BRANCH := master
|
2020-08-19 04:24:54 +08:00
|
|
|
LAST_TAG := $(shell git describe --abbrev=0 --tags $(VERSION)^)
|
2018-09-01 23:49:05 +08:00
|
|
|
endif
|
2020-08-19 04:24:54 +08:00
|
|
|
TAG_BRANCH := .$(BRANCH)
|
|
|
|
BRANCH_PATH := branch/$(BRANCH)/
|
2019-09-17 21:22:47 +08:00
|
|
|
# If building HEAD or master then unset TAG_BRANCH and BRANCH_PATH
|
2018-06-23 16:11:24 +08:00
|
|
|
ifeq ($(subst HEAD,,$(subst master,,$(BRANCH))),)
|
|
|
|
TAG_BRANCH :=
|
|
|
|
BRANCH_PATH :=
|
|
|
|
endif
|
2020-08-19 04:24:54 +08:00
|
|
|
# Make version suffix -beta.NNNN.CCCCCCCC (N=Commit number, C=Commit)
|
|
|
|
VERSION_SUFFIX := -beta.$(shell git rev-list --count HEAD).$(shell git show --no-patch --no-notes --pretty='%h' HEAD)
|
|
|
|
# TAG is current version + commit number + commit + branch
|
2019-09-17 21:22:47 +08:00
|
|
|
TAG := $(VERSION)$(VERSION_SUFFIX)$(TAG_BRANCH)
|
2020-08-19 04:24:54 +08:00
|
|
|
ifdef RELEASE_TAG
|
|
|
|
TAG := $(RELEASE_TAG)
|
2018-09-01 21:02:09 +08:00
|
|
|
endif
|
2016-10-05 00:10:20 +08:00
|
|
|
GO_VERSION := $(shell go version)
|
2022-09-28 20:37:38 +08:00
|
|
|
GO_OS := $(shell go env GOOS)
|
2019-08-06 05:14:58 +08:00
|
|
|
ifdef BETA_SUBDIR
|
|
|
|
BETA_SUBDIR := /$(BETA_SUBDIR)
|
|
|
|
endif
|
|
|
|
BETA_PATH := $(BRANCH_PATH)$(TAG)$(BETA_SUBDIR)
|
2018-06-23 16:11:24 +08:00
|
|
|
BETA_URL := https://beta.rclone.org/$(BETA_PATH)/
|
2024-04-25 18:12:38 +08:00
|
|
|
BETA_UPLOAD_ROOT := beta.rclone.org:
|
2018-06-23 16:11:24 +08:00
|
|
|
BETA_UPLOAD := $(BETA_UPLOAD_ROOT)/$(BETA_PATH)
|
2017-05-19 22:46:13 +08:00
|
|
|
# Pass in GOTAGS=xyz on the make command line to set build tags
|
|
|
|
ifdef GOTAGS
|
|
|
|
BUILDTAGS=-tags "$(GOTAGS)"
|
2019-04-12 22:48:36 +08:00
|
|
|
LINTTAGS=--build-tags "$(GOTAGS)"
|
2017-05-19 22:46:13 +08:00
|
|
|
endif
|
2024-04-17 21:05:55 +08:00
|
|
|
LDFLAGS=--ldflags "-s -X github.com/rclone/rclone/fs.Version=$(TAG)"
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2019-09-08 18:35:36 +08:00
|
|
|
.PHONY: rclone test_all vars version
|
2017-02-27 19:53:03 +08:00
|
|
|
|
2014-07-19 20:12:20 +08:00
|
|
|
rclone:
|
2022-09-28 20:37:38 +08:00
|
|
|
ifeq ($(GO_OS),windows)
|
|
|
|
go run bin/resource_windows.go -version $(TAG) -syso resource_windows_`go env GOARCH`.syso
|
|
|
|
endif
|
2024-04-17 21:05:55 +08:00
|
|
|
go build -v $(LDFLAGS) $(BUILDTAGS) $(BUILD_ARGS)
|
2022-09-28 20:37:38 +08:00
|
|
|
ifeq ($(GO_OS),windows)
|
|
|
|
rm resource_windows_`go env GOARCH`.syso
|
|
|
|
endif
|
2019-09-19 18:28:09 +08:00
|
|
|
mkdir -p `go env GOPATH`/bin/
|
2019-10-27 18:56:47 +08:00
|
|
|
cp -av rclone`go env GOEXE` `go env GOPATH`/bin/rclone`go env GOEXE`.new
|
|
|
|
mv -v `go env GOPATH`/bin/rclone`go env GOEXE`.new `go env GOPATH`/bin/rclone`go env GOEXE`
|
2014-07-19 20:12:20 +08:00
|
|
|
|
2019-09-08 18:35:36 +08:00
|
|
|
test_all:
|
2024-04-17 21:05:55 +08:00
|
|
|
go install $(LDFLAGS) $(BUILDTAGS) $(BUILD_ARGS) github.com/rclone/rclone/fstest/test_all
|
2019-09-08 18:35:36 +08:00
|
|
|
|
2016-09-08 15:04:13 +08:00
|
|
|
vars:
|
|
|
|
@echo SHELL="'$(SHELL)'"
|
2018-06-23 16:11:24 +08:00
|
|
|
@echo BRANCH="'$(BRANCH)'"
|
2016-09-08 15:04:13 +08:00
|
|
|
@echo TAG="'$(TAG)'"
|
2019-09-17 21:22:47 +08:00
|
|
|
@echo VERSION="'$(VERSION)'"
|
2016-10-05 00:10:20 +08:00
|
|
|
@echo GO_VERSION="'$(GO_VERSION)'"
|
2016-10-08 18:23:21 +08:00
|
|
|
@echo BETA_URL="'$(BETA_URL)'"
|
2016-09-08 15:04:13 +08:00
|
|
|
|
2020-06-26 21:15:07 +08:00
|
|
|
btest:
|
|
|
|
@echo "[$(TAG)]($(BETA_URL)) on branch [$(BRANCH)](https://github.com/rclone/rclone/tree/$(BRANCH)) (uploaded in 15-30 mins)" | xclip -r -sel clip
|
|
|
|
@echo "Copied markdown of beta release to clip board"
|
2023-09-21 04:54:55 +08:00
|
|
|
|
|
|
|
btesth:
|
|
|
|
@echo "<a href="$(BETA_URL)">$(TAG)</a> on branch <a href="https://github.com/rclone/rclone/tree/$(BRANCH)">$(BRANCH)</a> (uploaded in 15-30 mins)" | xclip -r -sel clip -t text/html
|
|
|
|
@echo "Copied beta release in HTML to clip board"
|
2020-06-26 21:15:07 +08:00
|
|
|
|
2017-05-13 16:59:41 +08:00
|
|
|
version:
|
|
|
|
@echo '$(TAG)'
|
|
|
|
|
2016-07-13 19:25:19 +08:00
|
|
|
# Full suite of integration tests
|
2019-09-08 18:35:36 +08:00
|
|
|
test: rclone test_all
|
2018-09-29 21:48:29 +08:00
|
|
|
-test_all 2>&1 | tee test_all.log
|
|
|
|
@echo "Written logs in test_all.log"
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2016-07-13 19:25:19 +08:00
|
|
|
# Quick test
|
|
|
|
quicktest:
|
2024-04-17 21:05:55 +08:00
|
|
|
RCLONE_CONFIG="/notfound" go test $(LDFLAGS) $(BUILDTAGS) ./...
|
2019-01-24 19:14:37 +08:00
|
|
|
|
|
|
|
racequicktest:
|
2024-04-17 21:05:55 +08:00
|
|
|
RCLONE_CONFIG="/notfound" go test $(LDFLAGS) $(BUILDTAGS) -cpu=2 -race ./...
|
2016-07-13 19:25:19 +08:00
|
|
|
|
2022-12-12 19:45:33 +08:00
|
|
|
compiletest:
|
2024-04-17 21:05:55 +08:00
|
|
|
RCLONE_CONFIG="/notfound" go test $(LDFLAGS) $(BUILDTAGS) -run XXX ./...
|
2022-12-12 19:45:33 +08:00
|
|
|
|
2016-07-13 19:25:19 +08:00
|
|
|
# Do source code quality checks
|
2015-09-23 01:47:16 +08:00
|
|
|
check: rclone
|
2019-01-12 00:29:49 +08:00
|
|
|
@echo "-- START CODE QUALITY REPORT -------------------------------"
|
2019-04-12 22:48:36 +08:00
|
|
|
@golangci-lint run $(LINTTAGS) ./...
|
2019-01-12 00:29:49 +08:00
|
|
|
@echo "-- END CODE QUALITY REPORT ---------------------------------"
|
2015-09-23 01:47:16 +08:00
|
|
|
|
2016-07-13 19:25:19 +08:00
|
|
|
# Get the build dependencies
|
|
|
|
build_dep:
|
2024-01-15 23:34:37 +08:00
|
|
|
go run bin/get-github-release.go -use-api -extract golangci-lint golangci/golangci-lint 'golangci-lint-.*\.tar\.gz'
|
2016-07-13 19:25:19 +08:00
|
|
|
|
2020-06-16 01:27:20 +08:00
|
|
|
# Get the release dependencies we only install on linux
|
|
|
|
release_dep_linux:
|
2023-06-07 18:59:17 +08:00
|
|
|
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
|
2018-03-23 20:42:44 +08:00
|
|
|
|
2016-07-13 19:25:19 +08:00
|
|
|
# Update dependencies
|
2020-03-04 22:01:25 +08:00
|
|
|
showupdates:
|
|
|
|
@echo "*** Direct dependencies that could be updated ***"
|
|
|
|
@GO111MODULE=on go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' -m all 2> /dev/null
|
|
|
|
|
2021-11-10 18:33:48 +08:00
|
|
|
# Update direct dependencies only
|
|
|
|
updatedirect:
|
|
|
|
GO111MODULE=on go get -d $$(go list -m -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' all)
|
|
|
|
GO111MODULE=on go mod tidy
|
|
|
|
|
2020-03-04 22:01:25 +08:00
|
|
|
# Update direct and indirect dependencies and test dependencies
|
2016-07-13 19:25:19 +08:00
|
|
|
update:
|
2021-11-10 18:33:48 +08:00
|
|
|
GO111MODULE=on go get -d -u -t ./...
|
2018-09-21 22:46:48 +08:00
|
|
|
GO111MODULE=on go mod tidy
|
2016-07-13 19:25:19 +08:00
|
|
|
|
2019-10-26 18:04:54 +08:00
|
|
|
# Tidy the module dependencies
|
|
|
|
tidy:
|
|
|
|
GO111MODULE=on go mod tidy
|
|
|
|
|
2018-09-01 17:19:03 +08:00
|
|
|
doc: rclone.1 MANUAL.html MANUAL.txt rcdocs commanddocs
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
rclone.1: MANUAL.md
|
2020-06-25 19:14:29 +08:00
|
|
|
pandoc -s --from markdown-smart --to man MANUAL.md -o rclone.1
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2021-03-08 19:07:48 +08:00
|
|
|
MANUAL.md: bin/make_manual.py docs/content/*.md commanddocs backenddocs rcdocs
|
2016-10-04 18:37:31 +08:00
|
|
|
./bin/make_manual.py
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
MANUAL.html: MANUAL.md
|
2020-06-25 19:14:29 +08:00
|
|
|
pandoc -s --from markdown-smart --to html MANUAL.md -o MANUAL.html
|
2015-06-06 17:05:21 +08:00
|
|
|
|
|
|
|
MANUAL.txt: MANUAL.md
|
2020-06-25 19:14:29 +08:00
|
|
|
pandoc -s --from markdown-smart --to plain MANUAL.md -o MANUAL.txt
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2016-08-04 04:36:28 +08:00
|
|
|
commanddocs: rclone
|
2019-06-20 23:18:02 +08:00
|
|
|
XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" rclone gendocs docs/content/
|
2016-08-04 04:36:28 +08:00
|
|
|
|
2018-10-02 03:48:54 +08:00
|
|
|
backenddocs: rclone bin/make_backend_docs.py
|
2019-05-14 00:28:36 +08:00
|
|
|
XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" ./bin/make_backend_docs.py
|
2018-10-02 03:48:54 +08:00
|
|
|
|
2018-04-24 03:44:44 +08:00
|
|
|
rcdocs: rclone
|
|
|
|
bin/make_rc_docs.sh
|
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
install: rclone
|
|
|
|
install -d ${DESTDIR}/usr/bin
|
2023-11-20 06:06:18 +08:00
|
|
|
install ${GOPATH}/bin/rclone ${DESTDIR}/usr/bin
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2014-03-29 06:34:13 +08:00
|
|
|
clean:
|
2014-04-25 01:11:08 +08:00
|
|
|
go clean ./...
|
2014-03-29 06:34:13 +08:00
|
|
|
find . -name \*~ | xargs -r rm -f
|
2014-04-18 05:32:39 +08:00
|
|
|
rm -rf build docs/public
|
2018-01-16 19:21:12 +08:00
|
|
|
rm -f rclone fs/operations/operations.test fs/sync/sync.test fs/test_all.log test.log
|
2014-03-29 06:34:13 +08:00
|
|
|
|
|
|
|
website:
|
2020-05-22 18:20:51 +08:00
|
|
|
rm -rf docs/public
|
2014-04-18 05:32:39 +08:00
|
|
|
cd docs && hugo
|
2020-05-22 19:22:52 +08:00
|
|
|
@if grep -R "raw HTML omitted" docs/public ; then echo "ERROR: found unescaped HTML - fix the markdown source" ; fi
|
2014-03-29 06:34:13 +08:00
|
|
|
|
|
|
|
upload_website: website
|
2024-04-25 18:12:38 +08:00
|
|
|
rclone -v sync docs/public www.rclone.org:
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2020-05-22 00:26:48 +08:00
|
|
|
upload_test_website: website
|
|
|
|
rclone -P sync docs/public test-rclone-org:
|
|
|
|
|
2020-05-22 18:20:51 +08:00
|
|
|
validate_website: website
|
|
|
|
find docs/public -type f -name "*.html" | xargs tidy --mute-id yes -errors --gnu-emacs yes --drop-empty-elements no --warn-proprietary-attributes no --mute MISMATCHED_ATTRIBUTE_WARN
|
|
|
|
|
2018-03-17 23:06:04 +08:00
|
|
|
tarball:
|
2018-04-02 17:56:13 +08:00
|
|
|
git archive -9 --format=tar.gz --prefix=rclone-$(TAG)/ -o build/rclone-$(TAG).tar.gz $(TAG)
|
2018-03-17 23:06:04 +08:00
|
|
|
|
2020-09-03 00:53:05 +08:00
|
|
|
vendorball:
|
|
|
|
go mod vendor
|
|
|
|
tar -zcf build/rclone-$(TAG)-vendor.tar.gz vendor
|
|
|
|
rm -rf vendor
|
|
|
|
|
2018-03-17 23:06:04 +08:00
|
|
|
sign_upload:
|
2018-04-28 21:59:40 +08:00
|
|
|
cd build && md5sum rclone-v* | gpg --clearsign > MD5SUMS
|
|
|
|
cd build && sha1sum rclone-v* | gpg --clearsign > SHA1SUMS
|
|
|
|
cd build && sha256sum rclone-v* | gpg --clearsign > SHA256SUMS
|
2018-03-17 23:06:04 +08:00
|
|
|
|
|
|
|
check_sign:
|
|
|
|
cd build && gpg --verify MD5SUMS && gpg --decrypt MD5SUMS | md5sum -c
|
|
|
|
cd build && gpg --verify SHA1SUMS && gpg --decrypt SHA1SUMS | sha1sum -c
|
|
|
|
cd build && gpg --verify SHA256SUMS && gpg --decrypt SHA256SUMS | sha256sum -c
|
|
|
|
|
2014-03-29 06:34:13 +08:00
|
|
|
upload:
|
2024-04-25 18:12:38 +08:00
|
|
|
rclone -P copy build/ downloads.rclone.org:/$(TAG)
|
|
|
|
rclone lsf build --files-only --include '*.{zip,deb,rpm}' --include version.txt | xargs -i bash -c 'i={}; j="$$i"; [[ $$i =~ (.*)(-v[0-9\.]+-)(.*) ]] && j=$${BASH_REMATCH[1]}-current-$${BASH_REMATCH[3]}; rclone copyto -v "downloads.rclone.org:/$(TAG)/$$i" "downloads.rclone.org:/$$j"'
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2015-11-24 05:58:54 +08:00
|
|
|
upload_github:
|
2016-10-04 18:37:31 +08:00
|
|
|
./bin/upload-github $(TAG)
|
2015-11-24 05:58:54 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
cross: doc
|
2021-02-18 01:28:44 +08:00
|
|
|
go run bin/cross-compile.go -release current $(BUILD_FLAGS) $(BUILDTAGS) $(BUILD_ARGS) $(TAG)
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2016-02-21 18:29:48 +08:00
|
|
|
beta:
|
2021-02-18 01:28:44 +08:00
|
|
|
go run bin/cross-compile.go $(BUILD_FLAGS) $(BUILDTAGS) $(BUILD_ARGS) $(TAG)
|
2024-04-25 18:12:38 +08:00
|
|
|
rclone -v copy build/ pub.rclone.org:/$(TAG)
|
2018-09-01 21:02:09 +08:00
|
|
|
@echo Beta release ready at https://pub.rclone.org/$(TAG)/
|
2015-11-12 00:55:49 +08:00
|
|
|
|
2017-05-13 16:59:41 +08:00
|
|
|
log_since_last_release:
|
|
|
|
git log $(LAST_TAG)..
|
|
|
|
|
2017-08-05 06:20:26 +08:00
|
|
|
compile_all:
|
2021-02-18 01:28:44 +08:00
|
|
|
go run bin/cross-compile.go -compile-only $(BUILD_FLAGS) $(BUILDTAGS) $(BUILD_ARGS) $(TAG)
|
2017-08-05 06:20:26 +08:00
|
|
|
|
2020-06-16 03:20:25 +08:00
|
|
|
ci_upload:
|
|
|
|
sudo chown -R $$USER build
|
|
|
|
find build -type l -delete
|
|
|
|
gzip -r9v build
|
2024-04-25 18:12:38 +08:00
|
|
|
./rclone --no-check-dest --config bin/ci.rclone.conf -v copy build/ $(BETA_UPLOAD)/testbuilds
|
2020-11-25 01:59:52 +08:00
|
|
|
ifeq ($(or $(BRANCH_PATH),$(RELEASE_TAG)),)
|
2024-04-25 18:12:38 +08:00
|
|
|
./rclone --no-check-dest --config bin/ci.rclone.conf -v copy build/ $(BETA_UPLOAD_ROOT)/test/testbuilds-latest
|
2020-06-16 03:20:25 +08:00
|
|
|
endif
|
|
|
|
@echo Beta release ready at $(BETA_URL)/testbuilds
|
|
|
|
|
2020-06-16 01:27:20 +08:00
|
|
|
ci_beta:
|
2017-02-21 01:08:07 +08:00
|
|
|
git log $(LAST_TAG).. > /tmp/git-log.txt
|
2021-01-07 21:02:57 +08:00
|
|
|
go run bin/cross-compile.go -release beta-latest -git-log /tmp/git-log.txt $(BUILD_FLAGS) $(BUILDTAGS) $(BUILD_ARGS) $(TAG)
|
2024-04-25 18:12:38 +08:00
|
|
|
rclone --no-check-dest --config bin/ci.rclone.conf -v copy --exclude '*beta-latest*' build/ $(BETA_UPLOAD)
|
2020-11-25 01:59:52 +08:00
|
|
|
ifeq ($(or $(BRANCH_PATH),$(RELEASE_TAG)),)
|
2024-04-25 18:12:38 +08:00
|
|
|
rclone --no-check-dest --config bin/ci.rclone.conf -v copy --include '*beta-latest*' --include version.txt build/ $(BETA_UPLOAD_ROOT)$(BETA_SUBDIR)
|
2018-02-20 23:11:41 +08:00
|
|
|
endif
|
2016-10-08 18:23:21 +08:00
|
|
|
@echo Beta release ready at $(BETA_URL)
|
2016-10-05 00:10:20 +08:00
|
|
|
|
2020-06-16 01:27:20 +08:00
|
|
|
# Fetch the binary builds from GitHub actions
|
2018-09-01 17:19:03 +08:00
|
|
|
fetch_binaries:
|
2019-04-13 20:08:53 +08:00
|
|
|
rclone -P sync --exclude "/testbuilds/**" --delete-excluded $(BETA_UPLOAD) build/
|
2017-07-23 01:16:46 +08:00
|
|
|
|
2016-01-16 22:10:57 +08:00
|
|
|
serve: website
|
2024-06-14 23:04:51 +08:00
|
|
|
cd docs && hugo server --logLevel info -w --disableFastRender
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2020-08-19 04:24:54 +08:00
|
|
|
tag: retag doc
|
|
|
|
bin/make_changelog.py $(LAST_TAG) $(VERSION) > docs/content/changelog.md.new
|
2018-08-27 19:18:35 +08:00
|
|
|
mv docs/content/changelog.md.new docs/content/changelog.md
|
2017-03-18 19:16:43 +08:00
|
|
|
@echo "Edit the new changelog in docs/content/changelog.md"
|
2018-08-27 19:18:35 +08:00
|
|
|
@echo "Then commit all the changes"
|
2020-08-19 04:24:54 +08:00
|
|
|
@echo git commit -m \"Version $(VERSION)\" -a -v
|
2020-10-14 06:07:12 +08:00
|
|
|
@echo "And finally run make retag before make cross, etc."
|
2014-04-25 01:11:08 +08:00
|
|
|
|
|
|
|
retag:
|
2020-08-19 04:24:54 +08:00
|
|
|
@echo "Version is $(VERSION)"
|
2019-09-17 21:22:47 +08:00
|
|
|
git tag -f -s -m "Version $(VERSION)" $(VERSION)
|
2017-03-18 19:30:04 +08:00
|
|
|
|
|
|
|
startdev:
|
2020-08-19 04:24:54 +08:00
|
|
|
@echo "Version is $(VERSION)"
|
|
|
|
@echo "Next version is $(NEXT_VERSION)"
|
2022-02-05 06:46:12 +08:00
|
|
|
echo -e "package fs\n\n// VersionTag of rclone\nvar VersionTag = \"$(NEXT_VERSION)\"\n" | gofmt > fs/versiontag.go
|
2020-08-19 04:24:54 +08:00
|
|
|
echo -n "$(NEXT_VERSION)" > docs/layouts/partials/version.html
|
|
|
|
echo "$(NEXT_VERSION)" > VERSION
|
2022-02-05 06:46:12 +08:00
|
|
|
git commit -m "Start $(NEXT_VERSION)-DEV development" fs/versiontag.go VERSION docs/layouts/partials/version.html
|
2014-07-27 00:18:29 +08:00
|
|
|
|
2020-09-03 18:29:33 +08:00
|
|
|
startstable:
|
|
|
|
@echo "Version is $(VERSION)"
|
|
|
|
@echo "Next stable version is $(NEXT_PATCH_VERSION)"
|
2022-02-05 06:46:12 +08:00
|
|
|
echo -e "package fs\n\n// VersionTag of rclone\nvar VersionTag = \"$(NEXT_PATCH_VERSION)\"\n" | gofmt > fs/versiontag.go
|
2020-09-03 18:29:33 +08:00
|
|
|
echo -n "$(NEXT_PATCH_VERSION)" > docs/layouts/partials/version.html
|
|
|
|
echo "$(NEXT_PATCH_VERSION)" > VERSION
|
2022-02-05 06:46:12 +08:00
|
|
|
git commit -m "Start $(NEXT_PATCH_VERSION)-DEV development" fs/versiontag.go VERSION docs/layouts/partials/version.html
|
2020-09-03 18:29:33 +08:00
|
|
|
|
2017-05-12 17:03:35 +08:00
|
|
|
winzip:
|
|
|
|
zip -9 rclone-$(TAG).zip rclone.exe
|
2021-05-26 17:43:50 +08:00
|
|
|
|
|
|
|
# docker volume plugin
|
2021-07-16 06:35:54 +08:00
|
|
|
PLUGIN_USER ?= rclone
|
|
|
|
PLUGIN_TAG ?= latest
|
|
|
|
PLUGIN_BASE_TAG ?= latest
|
|
|
|
PLUGIN_ARCH ?= amd64
|
|
|
|
PLUGIN_IMAGE := $(PLUGIN_USER)/docker-volume-rclone:$(PLUGIN_TAG)
|
|
|
|
PLUGIN_BASE := $(PLUGIN_USER)/rclone:$(PLUGIN_BASE_TAG)
|
2021-05-26 17:43:50 +08:00
|
|
|
PLUGIN_BUILD_DIR := ./build/docker-plugin
|
2021-07-16 06:35:54 +08:00
|
|
|
PLUGIN_CONTRIB_DIR := ./contrib/docker-plugin/managed
|
2021-05-26 17:43:50 +08:00
|
|
|
|
|
|
|
docker-plugin-create:
|
2021-07-16 06:35:54 +08:00
|
|
|
docker buildx inspect |grep -q /${PLUGIN_ARCH} || \
|
|
|
|
docker run --rm --privileged tonistiigi/binfmt --install all
|
|
|
|
rm -rf ${PLUGIN_BUILD_DIR}
|
|
|
|
docker buildx build \
|
|
|
|
--no-cache --pull \
|
|
|
|
--build-arg BASE_IMAGE=${PLUGIN_BASE} \
|
|
|
|
--platform linux/${PLUGIN_ARCH} \
|
|
|
|
--output ${PLUGIN_BUILD_DIR}/rootfs \
|
|
|
|
${PLUGIN_CONTRIB_DIR}
|
|
|
|
cp ${PLUGIN_CONTRIB_DIR}/config.json ${PLUGIN_BUILD_DIR}
|
|
|
|
docker plugin rm --force ${PLUGIN_IMAGE} 2>/dev/null || true
|
2021-05-26 17:43:50 +08:00
|
|
|
docker plugin create ${PLUGIN_IMAGE} ${PLUGIN_BUILD_DIR}
|
|
|
|
|
2021-07-16 06:35:54 +08:00
|
|
|
docker-plugin-push:
|
2021-05-26 17:43:50 +08:00
|
|
|
docker plugin push ${PLUGIN_IMAGE}
|
|
|
|
docker plugin rm ${PLUGIN_IMAGE}
|
2021-07-16 06:35:54 +08:00
|
|
|
|
|
|
|
docker-plugin: docker-plugin-create docker-plugin-push
|