diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..801ea35 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,28 @@ +--- +kind: pipeline +type: exec +name: default + +platform: + os: linux + arch: amd64 + +steps: +- name: Setup + commands: + - make setup + +- name: Test + commands: + - make test + +- name: Build Release + commands: + - cd debian && make release + - cd debian && make build + +- name: deploy + commands: + - cd debian && make copy + - cd debian && make deploy +... \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fa72be2..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "assets/src/vendor/sour-is"] - path = assets/src/vendor/sour-is - url = git@git.dn42.us:xuu/souris-react.git - branch = master diff --git a/Makefile b/Makefile index 656a6c5..76b98c8 100644 --- a/Makefile +++ b/Makefile @@ -17,23 +17,23 @@ endef export DUMMY_BINDATA all: $(BINARY) - clean: rm -rf $(BINARY) $(ROUTE_ASSET) $(DOCS_ASSET) setup: - git submodule update cd assets; npm i fmt: go fmt ./... - -run: $(BINARY) +test: + go test ./... + go vet ./... +run: $(BINARY) ./$(BINARY) -vv serve $(BINARY): $(SOURCE) $(ROUTE_ASSET) $(VENDOR_FILES) $(DOCS_ASSET) - go vet ./... - go test ./... + # go vet ./... + # go test ./... go build "sour.is/x/paste/cmd/paste" $(ROUTE_ASSET): $(ROUTE_FILES) @@ -41,17 +41,14 @@ $(ROUTE_ASSET): $(ROUTE_FILES) rm -rf build ../public; \ npm run build; \ cp -r build ../public - go generate "sour.is/x/paste/src/routes" $(DOCS_ASSET): $(DOCS_FILES) $(SOURCE) echo "$$DUMMY_BINDATA" > src/docs/bindata.go go generate "sour.is/x/paste/cmd/paste" go generate "sour.is/x/paste/src/docs" - - deploy: $(SOURCE) $(ROUTE_ASSET) cd debian && make -.PHONEY: all clean deploy run setup +.PHONEY: all clean build deploy run setup # DO NOT DELETE diff --git a/debian/Makefile b/debian/Makefile index d4c6a62..c23b09d 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -11,25 +11,22 @@ clean: rm -r BUILD/* release: - export RELEASE=`cat RELEASE`; \ echo `expr $${RELEASE} + 1` > RELEASE + git commit -am "release version $${RELEASE}" + git tag -am "release version $${RELEASE}" + git push --tags build: - export VERSION=`cat VERSION`; \ - export RELEASE=`cat RELEASE`; \ - export DATE=`date -u +%FT%TZ`; \ export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \ rm -rf ./$${BUILD}; \ cp -r ROOT "$${BUILD}"; \ sed -i'.tmp' "s_Version:.*_Version: $${VERSION}-$${RELEASE}_" "$${BUILD}/DEBIAN/control" - export VERSION=`cat VERSION`; \ - export RELEASE=`cat RELEASE`; \ - export DATE=`date -u +%FT%TZ`; \ - export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \ - env GOOS=linux GOARCH=amd64 go build -v -o $${BUILD}/opt/sour.is/bin/paste \ - -ldflags "-X main.AppVersion=$${VERSION}-$${RELEASE} -X main.AppBuild=$${DATE}"\ - sour.is/x/paste/cmd/paste; \ + export DATE=`date -u +%FT%TZ`; \ + export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \ + env GOOS=linux GOARCH=amd64 go build -v -o $${BUILD}/opt/sour.is/bin/paste \ + -ldflags "-X main.AppVersion=$${VERSION}-$${RELEASE} -X main.AppBuild=$${DATE}"\ + sour.is/x/paste/cmd/paste; \ dpkg -b $${BUILD}; copy: