Skip to content

Commit

Permalink
Merge pull request #196 from ripienaar/dependencies
Browse files Browse the repository at this point in the history
(misc) update dependencies
  • Loading branch information
ripienaar authored Apr 19, 2023
2 parents 0663f7c + 2416852 commit 4d24ddf
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 79 deletions.
223 changes: 223 additions & 0 deletions ABTaskFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
name: build_tasks
description: Choria Build Tasks

commands:
- name: dependencies
type: parent
description: Manage dependencies
aliases: [d]
commands:
- name: update
description: Update dependencies
type: exec
aliases: [up]
flags:
- name: verbose
description: Log verbosely
bool: true
- name: proxy
description: Enable using go proxy
bool: true
default: "true"
banner: |
>>>
>>> Updating all dependencies
>>>
script: |
{{ if eq .Flags.proxy false }}
export GOPROXY=direct
echo ">>>"
echo ">>> Disabling go mod proxy"
echo ">>>"
echo
{{ end }}

go get -u -n -a -t {{- if .Flags.verbose }} -d -x {{ end }} ./...

echo ">>> Running go mod tidy"
go mod tidy

- name: test
type: parent
aliases: [t]
description: Perform various tests
commands:
- name: unit
type: exec
description: Run ginkgo unit tests
aliases: [u]
arguments:
- name: dir
description: Directory to test
default: .
flags:
- name: update
description: Updates the ginkgo runtime
bool: true
script: |
set -e

{{ if .Flags.update }}
echo ">>> Updating ginkgo binary"
go install github.com/onsi/ginkgo/v2/ginkgo
{{ end }}

ginkgo -r --skip Integration {{ .Arguments.dir | escape }}

- name: docs
type: parent
description: Documentation related commands
commands:
- name: serve
description: Serves documentation locally
type: exec
flags:
- name: port
description: The port to listen on
default: "8081"
command: hugo serve -p {{ .Flags.port }} -s docs

- name: build
type: parent
aliases: [b]
description: Code build steps
commands:
- name: binary
description: Build a basic test binary
type: exec
aliases: [bin]
banner: |
>>>
>>> Building 'go-choria' locally
>>>
>>> Target: {{ if .Flags.target }}{{ .Flags.target }}{{else}}host{{end}}
>>>
flags:
- name: target
description: Target platform to build for
enum: ["linux/amd64"]
short: T
- name: verbose
description: Logs packages being build
bool: true
short: v
script: |
set -e

{{ if eq .Flags.target "linux/amd64" }}
export GOOS=linux
export GOARCH=amd64
{{ end }}

{{ if .Flags.verbose }}
echo ">>> Packages being build"
{{ end }}

go build \
{{ if .Flags.verbose }}-v{{ end }} \
-ldflags="-s -w \
-X 'github.com/choria-io/provisioner/config.version=0.0.$(date +%s)' \
" -o provisioner

echo
ls -l provisioner
echo
file provisioner
echo

- name: nightly-docker
description: Builds nightly docker container
type: exec
aliases: [nd]
flags:
- name: repo
description: YUM Repository to use
default: https://yum.eu.choria.io/nightly/el/nightly.repo
- name: push
description: Push the built images
default: false
bool: true
banner: |
>>>
>>> Building nightly docker container using {{ .Flags.repo }}
>>>
script: |
set -e

docker pull almalinux:8

DATE=$(date +%Y%m%d)

docker build \
--no-cache \
--build-arg REPO={{ .Flags.repo | escape }} \
--tag "choria/provisioner:nightly-${DATE}" \
--tag "choria/provisioner:nightly" \
--tag "registry.choria.io/choria-nightly/provisioner:nightly-${DATE}" \
--tag "registry.choria.io/choria-nightly/provisioner:nightly" \
.

{{ if .Flags.push }}
echo
echo ">>> Pushing built containers"
echo
docker push "choria/provisioner:nightly"
docker push "choria/provisioner:nightly-${DATE}"
docker push "registry.choria.io/choria-nightly/provisioner:nightly-${DATE}"
docker push "registry.choria.io/choria-nightly/provisioner:nightly"
{{ else }}
echo
echo ">>> Skipping container push"
echo
{{ end }}

- name: release-docker
description: Builds release docker container
type: exec
aliases: [rd]
flags:
- name: repo
description: YUM Repository to use
default: https://yum.eu.choria.io/release/el/release.repo
- name: push
description: Push the built images
default: false
bool: true
banner: |
>>>
>>> Building release docker container using {{ .Flags.repo }}
>>>
script: |
set -e

TAG=$(git tag --points-at HEAD|sed -e s/^v//)
if [ -z "${TAG}" ]
then
echo "!!! HEAD is not a tag"
exit 1
fi

docker pull almalinux:8

docker build \
--no-cache \
--build-arg REPO={{ .Flags.repo | escape }} \
--tag "choria/provisioner:${TAG}" \
--tag "choria/provisioner:latest" \
--tag "registry.choria.io/choria/provisioner:${TAG}" \
--tag "registry.choria.io/choria/provisioner:latest" \
.

{{ if .Flags.push }}
echo
echo ">>> Pushing built containers"
echo
docker push "choria/provisioner:${TAG}"
docker push "choria/provisioner:latest"
docker push "registry.choria.io/choria/provisioner:${TAG}"
docker push "registry.choria.io/choria/provisioner:latest"
{{ else }}
echo
echo ">>> Skipping container push"
echo
{{ end }}
43 changes: 21 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.19

require (
github.com/choria-io/fisk v0.4.0
github.com/choria-io/go-choria v0.27.0
github.com/choria-io/tokens v0.0.1
github.com/choria-io/go-choria v0.27.1-0.20230419143246-b414cb95c864
github.com/choria-io/tokens v0.0.2
github.com/ghodss/yaml v1.0.0
github.com/onsi/ginkgo/v2 v2.9.1
github.com/onsi/gomega v1.27.4
github.com/prometheus/client_golang v1.14.0
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.6
github.com/prometheus/client_golang v1.15.0
github.com/sirupsen/logrus v1.9.0
)

Expand All @@ -23,27 +23,26 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/choria-io/go-updater v0.1.0 // indirect
github.com/cloudevents/sdk-go/v2 v2.13.0 // indirect
github.com/cloudevents/sdk-go/v2 v2.14.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect
github.com/google/pprof v0.0.0-20230406165453-00490a63f317 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gosuri/uilive v0.0.4 // indirect
github.com/gosuri/uiprogress v0.0.1 // indirect
github.com/guptarohit/asciigraph v0.5.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/looplab/fsm v1.0.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
Expand All @@ -53,16 +52,16 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nats-io/jsm.go v0.0.35 // indirect
github.com/nats-io/nats-server/v2 v2.9.15 // indirect
github.com/nats-io/nats.go v1.24.0 // indirect
github.com/nats-io/nats-server/v2 v2.9.16 // indirect
github.com/nats-io/nats.go v1.25.0 // indirect
github.com/nats-io/nkeys v0.4.4 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/open-policy-agent/opa v0.50.2 // indirect
github.com/open-policy-agent/opa v0.51.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
Expand All @@ -73,14 +72,14 @@ require (
github.com/xlab/tablewriter v0.0.0-20160610135559-80b567a11ad5 // indirect
github.com/yashtewari/glob-intersection v0.1.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.8.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 4d24ddf

Please sign in to comment.