Skip to content

Commit

Permalink
resolve issue 358
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkstar committed May 16, 2024
1 parent b0b6171 commit 51119ae
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ vars:
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || echo latest
J: "{}"
RUNTIMES: "golang,nodejs,php,python"

tasks:

Expand All @@ -41,13 +42,17 @@ tasks:
- if ! which python3 | grep python3 ; then echo "python3 not found" ; exit 1; fi
- sudo apt-get -y install python3-pip python3-virtualenv
- python3 -m pip install ipython watchdog requests cram

image-tag:
image-tag:
silent: true
cmds:
- git tag -d $(git tag)
- git tag -f {{.BASETAG}}.$(date +%y%m%d%H%M)
- env PAGER= git tag
- git tag -d $(git tag)
- |
if test -n "{{.RT}}"
then git tag -f {{.BASETAG}}-{{.RT}}.$(date +%y%m%d%H%M)
else git tag -f {{.BASETAG}}.$(date +%y%m%d%H%M)
fi
- env PAGER= git tag

compile: go build -o proxy

Expand Down Expand Up @@ -104,10 +109,25 @@ tasks:
VER: "{{base .ITEM}}"

build:
- task build-lang RT=golang PUSH="{{.PUSH}}" DRY={{.DRY}}
- task build-lang RT=python PUSH="{{.PUSH}}" DRY={{.DRY}}
- task build-lang RT=nodejs PUSH="{{.PUSH}}" DRY={{.DRY}}
- task build-lang RT=php PUSH="{{.PUSH}}" DRY={{.DRY}}
silent: true
requires: { vars: [TAG,RUNTIMES] }
vars:
RT_REGEX:
sh: echo "{{.RUNTIMES}}" | tr ',' '|'
SPECIFIC_RT:
sh: echo "{{.TAG}}" | grep -E -o '({{.RT_REGEX}})' || echo ''
cmds:
- |
if [ -z "{{.SPECIFIC_RT}}" ];
then
echo "==> BUILDING RUNTIMES {{.RUNTIMES}}"
for ITEM in `echo {{.RUNTIMES}} | tr ',' ' '`; do
echo "==> BUILDING $ITEM:{{.TAG}}"
task build-lang RT=$ITEM PUSH="{{.PUSH}}" DRY={{.DRY}}
done
else echo "Build {{.SPECIFIC_RT}}"
task build-lang RT={{.SPECIFIC_RT}} PUSH="{{.PUSH}}" DRY={{.DRY}}
fi
build-and-push:
- task build PUSH=y DRY={{.DRY}}
Expand Down Expand Up @@ -141,5 +161,4 @@ tasks:
desc: invoke a runtime listening in port 8080, optionally with J=<json>
cmds:
- python3 packages/invoke.py run '{{.J}}'



0 comments on commit 51119ae

Please sign in to comment.