diff --git a/.drone.yml b/.drone.yml index 3ccff83..92f00ca 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,12 +12,37 @@ pipeline: commands: - ./build.sh - build_website: + test_example: image: alpine commands: - ls -la - ./dist/mark2web-linux-amd64 -version - - ./dist/mark2web-linux-amd64 -in website -out html -create -logLevel debug + - ./dist/mark2web-linux-amd64 -in example -out example_out -create -logLevel debug + + build_mark2web_freebsd: + image: golang:latest + environment: + - CGO_ENABLED=0 + - GOOS=freebsd + - GOARCH=amd64 + commands: + - ./build.sh + when: + branch: master + event: push + + build_mark2web_windows: + image: golang:latest + environment: + - CGO_ENABLED=0 + - GOOS=windows + - GOARCH=amd64 + - FILEEXT=.exe + commands: + - ./build.sh + when: + branch: master + event: push build_docker: image: docker @@ -27,4 +52,22 @@ pipeline: - /var/run/docker.sock:/var/run/docker.sock when: branch: master - event: push \ No newline at end of file + event: push + + deploy_website: + image: apairon/mark2web:latest + commands: + - ls -la + - /mark2web -version + - /mark2web -in website -out html -create -logLevel debug + when: + branch: master + event: push + + prepare_release: + image: apairon/mark2web:latest + commands: + - ls -la dist/ + - gzip dist/* + - ls -la dist/ + diff --git a/Dockerfile b/Dockerfile index 9c0edfd..72a828f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM alpine -RUN apk update && apk add openssh-client sshpass rsync && rm -r /var/cache/ +RUN apk update && apk add openssh-client sshpass rsync gzip && rm -r /var/cache/ ADD dist/mark2web-linux-amd64 /mark2web CMD ["/mark2web"] diff --git a/build.sh b/build.sh index f44d91b..0005a87 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/sh mkdir -p dist -go build -v -ldflags "-X main.Version=`cat VERSION` -X main.GitHash=`git rev-parse HEAD` -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" -o dist/mark2web-${GOOS}-${GOARCH}${ext} +go build -v -ldflags "-X main.Version=`cat VERSION` -X main.GitHash=`git rev-parse HEAD` -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" -o dist/mark2web-${GOOS}-${GOARCH}${FILEEXT}