mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
update taskfile to new version 2 format
This commit is contained in:
parent
647ec115a1
commit
99616d857f
247
Taskfile.yml
247
Taskfile.yml
@ -3,142 +3,147 @@
|
||||
#
|
||||
# Tasks without a `desc:` field are intended mainly to be called
|
||||
# internally by other tasks and therefore are not listed when running `task` or `task -l`
|
||||
version: '2'
|
||||
|
||||
all:
|
||||
desc: Install, Compile, Test and Build Semaphore for local architecture
|
||||
cmds:
|
||||
- deps
|
||||
- compile
|
||||
- test
|
||||
- build:local
|
||||
vars:
|
||||
VERSION: '2.5.0-dev'
|
||||
|
||||
deps:
|
||||
desc: Install all dependencies
|
||||
cmds:
|
||||
- task: deps:be
|
||||
- task: deps:fe
|
||||
- task: deps:watch
|
||||
tasks:
|
||||
all:
|
||||
desc: Install, Compile, Test and Build Semaphore for local architecture
|
||||
cmds:
|
||||
- deps
|
||||
- compile
|
||||
- test
|
||||
- build:local
|
||||
|
||||
deps:be:
|
||||
desc: Install golang tools for project building
|
||||
cmds:
|
||||
- go get github.com/gobuffalo/packr/...
|
||||
- go get github.com/mitchellh/gox
|
||||
deps:
|
||||
desc: Install all dependencies
|
||||
cmds:
|
||||
- task: deps:be
|
||||
- task: deps:fe
|
||||
- task: deps:watch
|
||||
|
||||
deps:fe:
|
||||
desc: Installs npm requirements for front end from package.json
|
||||
dir: public
|
||||
cmds:
|
||||
- git submodule update --init --recursive
|
||||
- npm i -g less pug-cli
|
||||
- npm i async
|
||||
deps:be:
|
||||
desc: Install golang tools for project building
|
||||
cmds:
|
||||
- go get github.com/gobuffalo/packr/...
|
||||
- go get github.com/mitchellh/gox
|
||||
|
||||
deps:watch:
|
||||
desc: Installs tools needed for watch commands
|
||||
dir: public
|
||||
cmds:
|
||||
- npm install -g nodemon
|
||||
- go get github.com/cespare/reflex
|
||||
deps:fe:
|
||||
desc: Installs npm requirements for front end from package.json
|
||||
dir: public
|
||||
cmds:
|
||||
- git submodule update --init --recursive
|
||||
- npm i -g less pug-cli
|
||||
- npm i async
|
||||
|
||||
compile:
|
||||
desc: Generates compiled frontend and backend resources (must be in this order)
|
||||
cmds:
|
||||
- task: compile:fe
|
||||
- task: compile:be
|
||||
deps:watch:
|
||||
desc: Installs tools needed for watch commands
|
||||
dir: public
|
||||
cmds:
|
||||
- npm install -g nodemon
|
||||
- go get github.com/cespare/reflex
|
||||
|
||||
compile:fe:
|
||||
desc: Runs less, pug and node
|
||||
dir: public
|
||||
sources:
|
||||
- css/semaphore.less
|
||||
- html/*.pug
|
||||
- html/**/*.pug
|
||||
generates:
|
||||
- css/semaphore.css
|
||||
- html/*.html
|
||||
- html/**/*.html
|
||||
- js/bundle.json
|
||||
cmds:
|
||||
- lessc css/semaphore.less > css/semaphore.css
|
||||
- pug $(find ./html/ -name "*.pug")
|
||||
- node ./bundler.js
|
||||
compile:
|
||||
desc: Generates compiled frontend and backend resources (must be in this order)
|
||||
cmds:
|
||||
- task: compile:fe
|
||||
- task: compile:be
|
||||
|
||||
compile:be:
|
||||
desc: Runs Packr for static assets
|
||||
sources:
|
||||
- public/*
|
||||
- db/migrations/*
|
||||
generates:
|
||||
- db/db-packr.go
|
||||
- api/api-packr.go
|
||||
cmds:
|
||||
- packr
|
||||
compile:fe:
|
||||
desc: Runs less, pug and node
|
||||
dir: public
|
||||
sources:
|
||||
- css/semaphore.less
|
||||
- html/*.pug
|
||||
- html/**/*.pug
|
||||
generates:
|
||||
- css/semaphore.css
|
||||
- html/*.html
|
||||
- html/**/*.html
|
||||
- js/bundle.json
|
||||
cmds:
|
||||
- lessc css/semaphore.less > css/semaphore.css
|
||||
- pug $(find ./html/ -name "*.pug")
|
||||
- node ./bundler.js
|
||||
|
||||
watch:
|
||||
desc: Watch fe and be file changes and rebuild
|
||||
dir: public
|
||||
deps: ['deps:watch']
|
||||
cmds:
|
||||
- task: watch:fe
|
||||
- task: watch:be
|
||||
compile:be:
|
||||
desc: Runs Packr for static assets
|
||||
sources:
|
||||
- public/*
|
||||
- db/migrations/*
|
||||
generates:
|
||||
- db/db-packr.go
|
||||
- api/api-packr.go
|
||||
cmds:
|
||||
- packr
|
||||
|
||||
watch:be:
|
||||
cmds:
|
||||
- reflex -r '\.go$' -R '^public/vendor/' -R '^node_modules/' -s -d none -- sh -c 'go build -i -o /tmp/semaphore_bin cli/main.go && /tmp/semaphore_bin -config $(pwd)/config.json'
|
||||
watch:
|
||||
desc: Watch fe and be file changes and rebuild
|
||||
dir: public
|
||||
deps: ['deps:watch']
|
||||
cmds:
|
||||
- task: watch:fe
|
||||
- task: watch:be
|
||||
|
||||
watch:fe:
|
||||
dir: public
|
||||
cmds:
|
||||
- nodemon -w js -i bundle.js -e js bundler.js &
|
||||
- nodemon -w css -e less --exec "lessc css/semaphore.less > css/semaphore.css" &
|
||||
- pug -w -P --doctype html $(find ./html/ -name "*.pug") &
|
||||
watch:be:
|
||||
cmds:
|
||||
- reflex -r '\.go$' -R '^public/vendor/' -R '^node_modules/' -s -d none -- sh -c 'go build -i -o /tmp/semaphore_bin cli/main.go && /tmp/semaphore_bin -config $(pwd)/config.json'
|
||||
|
||||
build:
|
||||
desc: Build a full set of release binaries
|
||||
dir: cli
|
||||
cmds:
|
||||
- gox -output="../bin/semaphore_{{"{{"}}.OS{{"}}"}}_{{"{{"}}.Arch{{"}}"}}" ./...
|
||||
watch:fe:
|
||||
dir: public
|
||||
cmds:
|
||||
- nodemon -w js -i bundle.js -e js bundler.js &
|
||||
- nodemon -w css -e less --exec "lessc css/semaphore.less > css/semaphore.css" &
|
||||
- pug -w -P --doctype html $(find ./html/ -name "*.pug") &
|
||||
|
||||
build:local:
|
||||
desc: Build a binary for the current architecture
|
||||
dir: cli
|
||||
cmds:
|
||||
- go build -o ../bin/semaphore
|
||||
build:
|
||||
desc: Build a full set of release binaries
|
||||
dir: cli
|
||||
cmds:
|
||||
- gox -output="../bin/semaphore_{{"{{"}}.OS{{"}}"}}_{{"{{"}}.Arch{{"}}"}}" ./...
|
||||
|
||||
test:
|
||||
desc: Run go code tests
|
||||
cmds:
|
||||
- go vet ./...
|
||||
- go test ./...
|
||||
build:local:
|
||||
desc: Build a binary for the current architecture
|
||||
dir: cli
|
||||
cmds:
|
||||
- go build -o ../bin/semaphore
|
||||
|
||||
ci:artifacts:
|
||||
cmds:
|
||||
- rsync -a bin/semaphore_* $CIRCLE_ARTIFACTS/
|
||||
test:
|
||||
desc: Run go code tests
|
||||
cmds:
|
||||
- go vet ./...
|
||||
- go test ./...
|
||||
|
||||
release:
|
||||
cmds:
|
||||
- |
|
||||
cat <<HEREDOC > util/version.go
|
||||
package util
|
||||
ci:artifacts:
|
||||
cmds:
|
||||
- rsync -a bin/semaphore_* $CIRCLE_ARTIFACTS/
|
||||
|
||||
var Version string = "{{ .VERSION }}"
|
||||
release:
|
||||
cmds:
|
||||
- |
|
||||
cat <<HEREDOC > util/version.go
|
||||
package util
|
||||
|
||||
HEREDOC
|
||||
- echo "Updating changelog:"
|
||||
- set +e
|
||||
- git changelog -t "v$VERSION"
|
||||
- set -e
|
||||
- echo "\nCommitting version.go and changelog update"
|
||||
- git add util/version.go CHANGELOG.md && git commit -m "update changelog, bump version to $VERSION"
|
||||
- echo "\nTagging release"
|
||||
- git tag -m "v$VERSION release" "v$VERSION"
|
||||
- echo "\nPushing to repository"
|
||||
- git push origin develop "v$VERSION"
|
||||
- echo "\nCreating draft release v$VERSION"
|
||||
- github-release release --draft -u ansible-semaphore -r semaphore -t "v$VERSION" -d "## Special thanks to\n\n## Installation\n\nFollow [wiki/Installation](https://github.com/ansible-semaphore/semaphore/wiki/Installation)\n\n## Changelog"
|
||||
- task: build
|
||||
- echo "Uploading files.."
|
||||
- find . -name "bin/semaphore_*" -exec sh -c 'gpg --armor --detach-sig "$1"' _ {} \;
|
||||
- VERSION=$2 find . -name "bin/semaphore_*" -exec sh -c 'github-release upload -u ansible-semaphore -r semaphore -t "v$VERSION" -n "${1/.\/}" -f "$1"' _ {} \;
|
||||
- echo "Done"
|
||||
- rm -rf bin
|
||||
var Version string = "{{ .VERSION }}"
|
||||
|
||||
HEREDOC
|
||||
- echo "Updating changelog:"
|
||||
- set +e
|
||||
- git changelog -t "v$VERSION"
|
||||
- set -e
|
||||
- echo "\nCommitting version.go and changelog update"
|
||||
- git add util/version.go CHANGELOG.md && git commit -m "update changelog, bump version to $VERSION"
|
||||
- echo "\nTagging release"
|
||||
- git tag -m "v$VERSION release" "v$VERSION"
|
||||
- echo "\nPushing to repository"
|
||||
- git push origin develop "v$VERSION"
|
||||
- echo "\nCreating draft release v$VERSION"
|
||||
- github-release release --draft -u ansible-semaphore -r semaphore -t "v$VERSION" -d "## Special thanks to\n\n## Installation\n\nFollow [wiki/Installation](https://github.com/ansible-semaphore/semaphore/wiki/Installation)\n\n## Changelog"
|
||||
- task: build
|
||||
- echo "Uploading files.."
|
||||
- find . -name "bin/semaphore_*" -exec sh -c 'gpg --armor --detach-sig "$1"' _ {} \;
|
||||
- VERSION=$2 find . -name "bin/semaphore_*" -exec sh -c 'github-release upload -u ansible-semaphore -r semaphore -t "v$VERSION" -n "${1/.\/}" -f "$1"' _ {} \;
|
||||
- echo "Done"
|
||||
- rm -rf bin
|
||||
|
@ -1 +0,0 @@
|
||||
VERSION: '2.5.0-dev'
|
Loading…
Reference in New Issue
Block a user