kind: pipeline type: docker name: default workspace: base: /go path: src/gitbase.de/apairon/mark2web steps: - name: init submodules image: docker:git commands: #- git submodule update --init --recursive - git fetch --tags when: event: [ push, tag ] - name: test image: golang:latest environment: CGO_ENABLED: 1 GOOS: linux GOARCH: amd64 commands: # fake term for goconvey color output - env TERM=xterm-color256 go test -v -coverprofile coverage.out ./pkg/* when: event: [ push, tag ] - name: build for linux image: golang:latest environment: CGO_ENABLED: 1 GOOS: linux GOARCH: amd64 commands: - scripts/build.sh when: event: [ push, tag ] - name: test with example content image: alpine commands: - apk add --no-cache libc6-compat - dist/mark2web-`cat build/VERSION`-linux-amd64 -version - dist/mark2web-`cat build/VERSION`-linux-amd64 -in example -out example_out -create -logLevel debug when: event: [ push, tag ] - name: build for freebsd image: golang:latest environment: CGO_ENABLED: 0 GOOS: freebsd GOARCH: amd64 commands: - scripts/build.sh when: event: [ tag ] - name: build for macos image: golang:latest environment: CGO_ENABLED: 0 GOOS: darwin GOARCH: amd64 commands: - scripts/build.sh when: event: [ tag ] - name: build for windows image: golang:latest environment: CGO_ENABLED: 0 GOOS: windows GOARCH: amd64 FILEEXT: .exe commands: - scripts/build.sh when: event: [ tag ] - name: build docker image image: docker commands: - cp dist/mark2web-`cat build/VERSION`-linux-amd64 build/package/mark2web - docker build -t apairon/mark2web build/package volumes: - name: docker path: /var/run/docker.sock when: branch: [ master ] event: [ push ] - name: build website image: apairon/mark2web:latest pull: never commands: - /mark2web -version - /mark2web -in website -out html -create -logLevel info when: branch: [ master ] event: [ promote, push ] target: [ "", website ] - name: deploy website image: apairon/mark2web:latest pull: never environment: RSYNC_PASS: from_secret: rsync_pass commands: - ' rsync -rlcgD -i -u -v --stats --delete -e "sshpass -p $${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o HostKeyAlgorithms=ssh-rsa -o PubkeyAcceptedKeyTypes=ssh-rsa -p 22222" html/ basiskonfiguration_mark2web_rsync@deploy.bc1.basehosts.de:./' when: branch: [ master ] event: [ promote, push ] target: [ "", website ] - name: prepare release image: apairon/mark2web:latest pull: never commands: - gzip dist/* - ls -la dist/ when: event: [ tag ] - name: gitea release image: plugins/gitea-release settings: api_key: from_secret: gitea_token base_url: https://gitbase.de files: - dist/* title: build/VERSION note: build/RELEASE.md checksum: - md5 - sha256 when: event: [ tag ] volumes: - name: docker host: path: /var/run/docker.sock