Skip to content

Commit

Permalink
Use apim
Browse files Browse the repository at this point in the history
The assets proto file is now suitable for APIM

Removed the requirement for avid-builder

Added standard default and environment runes

AB#10288
  • Loading branch information
eccles committed Jan 23, 2025
1 parent 9e1cecf commit 60ff218
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .env.tools
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export TOOLS_BUILDNUMBER=20241007.3
export TOOLS_BUILDNUMBER=20241108.3
53 changes: 9 additions & 44 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,25 @@ includes:
# dev-notes/build-warts.md#always-set-dir-relative-to-current-task-file
dir: ./taskfiles

vars:
ACR: rkvstdev.azurecr.io
# Default to the stage master-latest builder image
# Note: the CI tags builder images with the build number of the avid-builder pipeline run,
# i.e. 20220607.10
# For local builder development build run `task builder` in the avid-builder git repo to
# build a new local builder image, then run these tasks like
# task generate BUILDER_ACR=rkvstdev.azurecr.io BUILDER_IMAGE_TAG=dev-$USER
BUILDER_ACR: rkvststage.azurecr.io
BUILDER_IMAGE_TAG: master-latest

BUILD_CONTAINER: go-datatrails-common-api-builder

tasks:

### -------------------------
# Docker container tasks
### -------------------------

builder-start:
summary: |
Creates the build container for go-datatrails-common-api
Many tasks docker exec into this container so DO NOT ADD --rm.
Use defer to cleanup the docker container in top level workflow tasks
which create the builder container
vars:
BUILDER_IMAGE: '{{.BUILDER_ACR}}/avid-builder:{{.BUILDER_IMAGE_TAG}}'
default:
desc: Default task lists all available tasks to run.
cmds:
- which task
- |
docker run \
--env CONCURRENCY={{.SKAFFOLD_CONCURRENCY | default 2}} \
--name {{.BUILD_CONTAINER}} \
-dt -u $(id -u):$(id -g) \
--mount type=bind,src=$(pwd),dst=/avid -w /avid \
{{.BUILDER_IMAGE}}
task --list
builder-cleanup:
summary: cleans up the forestrie build container
environment:
desc: Show environment and location of tools executables.
cmds:
- docker rm -f {{.BUILD_CONTAINER}}
- env | sort
- which go

### -------------------------
# Primary workflow tasks
### -------------------------
all:
desc: "do everything necessary after clone (or rebase) in the builder"
cmds:
- task: builder-start
- defer: {task: builder-cleanup}
- docker exec -t {{.BUILD_CONTAINER}} task local-all

local-all:
desc: |
do everything necessary after clone (or rebase) (faster as it RUNS ON NATIVE HOST)
Expand Down Expand Up @@ -105,4 +70,4 @@ tasks:
generate:
desc: generates all the artifacts we need pre-build
cmds:
- task: apis:generate
- task: apis:generate
6 changes: 1 addition & 5 deletions taskfiles/Taskfile_apis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ tasks:
rm -rf {{.GOOGLE_COMMON_INC_ARCHIVE_BASEDIR}}-{{.GOOGLE_COMMON_PROTOS_VERSION}}
find proto-include -type d
bootstrap:grpc_health:
desc: download and prepare the grpc health definitions we require under proto-include
dir: '..'
Expand Down Expand Up @@ -114,15 +113,12 @@ tasks:
github.com/envoyproxy/protoc-gen-validate
cmds:
- |
go get github.com/datatrails/go-datatrails-common-api-gen/tools
go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc \
github.com/envoyproxy/protoc-gen-validate \
github.com/lyft/protoc-gen-star/v2 \
github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
- for: { var: API_PROTO_DEPS }
cmd: |
Expand Down Expand Up @@ -278,4 +274,4 @@ tasks:
# OUTPATH: datatrails-common-api
OUTPATH: .
GOBIN:
sh: echo ${GOBIN:-$HOME/go/bin}
sh: echo ${GOBIN:-$HOME/go/bin}

0 comments on commit 60ff218

Please sign in to comment.