Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
backport of commit 1698c1d
Browse files Browse the repository at this point in the history
  • Loading branch information
briancain committed Oct 31, 2022
1 parent dcf7bb8 commit b4090a2
Show file tree
Hide file tree
Showing 150 changed files with 8,298 additions and 10,442 deletions.
3 changes: 0 additions & 3 deletions .changelog/3856.txt

This file was deleted.

3 changes: 0 additions & 3 deletions .changelog/3872.txt

This file was deleted.

4 changes: 0 additions & 4 deletions .changelog/3988.txt

This file was deleted.

3 changes: 0 additions & 3 deletions .changelog/4054.txt

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ IMPROVEMENTS:

BUG FIXES:


## 0.10.2 (October 03, 2022)

BREAKING CHANGES:
Expand Down
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Copyright (c) 2020 HashiCorp, Inc.

Mozilla Public License Version 2.0
==================================

Expand Down
52 changes: 23 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,69 @@ WP_SERVER_PLATFORM?="linux/amd64"
LAST_RELEASE?=$$(git describe --tags $$(git rev-list --tags --max-count=1))
THIS_RELEASE?=$$(git rev-parse --abbrev-ref HEAD)


.PHONY: bin
bin: # Creates the binaries for Waypoint for the current platform
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(GOLDFLAGS) -o ./internal/assets/ceb/ceb ./cmd/waypoint-entrypoint
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(GOLDFLAGS) -o ./internal/assets/ceb/ceb-arm64 ./cmd/waypoint-entrypoint
bin: # bin creates the binaries for Waypoint for the current platform
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./internal/assets/ceb/ceb ./cmd/waypoint-entrypoint
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ./internal/assets/ceb/ceb-arm64 ./cmd/waypoint-entrypoint
cd internal/assets && go-bindata -pkg assets -o prod.go -tags assetsembedded ./ceb
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./waypoint ./cmd/waypoint

# bin/cli-only only recompiles waypoint, and doesn't recompile or embed the ceb.
# You can use the binary it produces as a server, runner, or CLI, but it won't contain the CEB, so
# it won't be able to build projects that don't have `disable_entrypoint = true` set in their build hcl.
.PHONY: bin/no-ceb
bin/cli-only: # Builds only the cli with no ceb
bin/cli-only:
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./waypoint ./cmd/waypoint

.PHONY: bin/linux
bin/linux: # Creates the binaries for Waypoint for the linux platform
bin/linux: # bin creates the binaries for Waypoint for the linux platform
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./internal/assets/ceb/ceb ./cmd/waypoint-entrypoint
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ./internal/assets/ceb/ceb-arm64 ./cmd/waypoint-entrypoint
cd internal/assets && go-bindata -pkg assets -o prod.go -tags assetsembedded ./ceb
GOOS=linux CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./waypoint ./cmd/waypoint

.PHONY: bin/windows
bin/windows: # Create windows binaries
bin/windows: # create windows binaries
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./internal/assets/ceb/ceb ./cmd/waypoint-entrypoint
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ./internal/assets/ceb/ceb-arm64 ./cmd/waypoint-entrypoint
cd internal/assets && go-bindata -pkg assets -o prod.go -tags assetsembedded ./ceb
GOOS=windows GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./waypoint.exe ./cmd/waypoint

.PHONY: bin/entrypoint
bin/entrypoint: # Create the entrypoint for the current platform
bin/entrypoint: # create the entrypoint for the current platform
CGO_ENABLED=0 go build -tags assetsembedded -o ./waypoint-entrypoint ./cmd/waypoint-entrypoint

.PHONY: install
install: bin # Build and copy binaries to $GOPATH/bin/waypoint
install: bin # build and copy binaries to $GOPATH/bin/waypoint
ifneq ("$(wildcard $(GOPATH)/bin/waypoint)","")
rm $(GOPATH)/bin/waypoint
endif
mkdir -p $(GOPATH)/bin
cp ./waypoint $(GOPATH)/bin/waypoint

.PHONY: format
format: # Format all go code in project
format: # format go code
gofmt -s -w ./

.PHONY: docker/server
docker/server: docker/server-only docker/odr

.PHONY: docker/server-only
docker/server-only: # Builds a Waypoint server docker image
docker/server-only:
DOCKER_BUILDKIT=1 docker buildx build \
--platform $(WP_SERVER_PLATFORM) \
-t waypoint:dev \
.

.PHONY: docker/odr
docker/odr: # Builds a Waypoint on-demand runner docker image
docker/odr:
DOCKER_BUILDKIT=1 docker buildx build --target odr \
--platform $(WP_SERVER_PLATFORM) \
-t waypoint-odr:dev \
.

.PHONY: docker/tools
docker/tools: # Creates a docker tools file for generating waypoint server protobuf files
docker/tools:
@echo "Building docker tools image"
docker build -f tools.Dockerfile -t waypoint-tools:dev .

Expand All @@ -88,7 +87,7 @@ docker/gen/server: docker/tools

# expected to be invoked by make gen/changelog LAST_RELEASE=gitref THIS_RELEASE=gitref
.PHONY: gen/changelog
gen/changelog: # Generates the changelog for Waypoint
gen/changelog:
@echo "Generating changelog for $(THIS_RELEASE) from $(LAST_RELEASE)..."
@echo
@changelog-build -last-release $(LAST_RELEASE) \
Expand All @@ -99,17 +98,17 @@ gen/changelog: # Generates the changelog for Waypoint

# generates protos for the plugins inside builtin
.PHONY: gen/plugins
gen/plugins: # Generates plugin protobuf Go files
gen/plugins:
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
go generate ./builtin/...

.PHONY: gen/server
gen/server: # Generates server protobuf Go files from server.proto
gen/server:
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
go generate ./pkg/server

.PHONY: gen/ts
gen/ts: # Generates frontend typescript files
gen/ts:
# Clear existing generated files
@rm -rf ./ui/lib/api-common-protos/google 2> /dev/null
@rm -rf ./ui/lib/opaqueany/*.{js,ts} 2> /dev/null
Expand Down Expand Up @@ -157,12 +156,12 @@ gen/ts: # Generates frontend typescript files
--ts_out=ui/lib/opaqueany/

# This currently assumes you have run `ember build` in the ui/ directory
static-assets: # Generates the UI static assets
static-assets:
@go-bindata -pkg gen -prefix dist -o $(ASSETFS_PATH) ./ui/dist/...
@gofmt -s -w $(ASSETFS_PATH)

.PHONY: gen/doc
gen/doc: # generates the server proto docs
gen/doc:
mkdir -p ./doc/
@rm -rf ./doc/* 2> /dev/null
protoc -I=. \
Expand All @@ -171,21 +170,21 @@ gen/doc: # generates the server proto docs
./pkg/server/proto/server.proto

.PHONY: gen/website-mdx
gen/website-mdx: # Generates the website markdown files
gen/website-mdx:
go run ./cmd/waypoint docs -website-mdx
go run ./cmd/waypoint docs -json
go run ./tools/gendocs
cd ./website; npx --no-install next-hashicorp format content # only format the content folder in website

.PHONY: tools
tools: # Install dependencies and tools required to build
tools: # install dependencies and tools required to build
@echo "Fetching tools..."
$(GO_CMD) generate -tags tools tools/tools.go
@echo
@echo "Done!"

.PHONY: test
test: # Run tests
test: # run tests
go test ./...

# Run state tests found in pkg/serverstate/statetest/
Expand All @@ -194,17 +193,12 @@ test: # Run tests
#
# >$ TESTARGS="-run TestImpl/runner_ondemand/TestOnDemandRunnerConfig" make test/boltdbstate
.PHONY: test/boltdbstate
test/boltdbstate: # Runs the boltdbstate tests
test/boltdbstate:
@echo "Running state tests..."
go test -test.v ./internal/server/boltdbstate $(TESTARGS)

.PHONY: test/service
test/service: # Runs the server API function tests. Requires a local postgresql and horizon via docker-compose
test/service:
$(warning "Running the full service suite requires `docker-compose up`! Some Tests rely on a local Horizon instance to be running.")
@echo "Running service API server tests..."
go test -test.v ./pkg/server/singleprocess/

.PHONY: help
help: # Print valid Make targets
@echo "Valid targets:"
@grep --extended-regexp --no-filename '^[a-zA-Z/_-]+:' Makefile | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
2 changes: 1 addition & 1 deletion builtin/k8s/helm/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ These must be passed in using Helm values (i.e. the chart must make
environment variables configurable).
This is documented in more detail with a full example in the
[Kubernetes Helm Deployment documentation](/docs/platforms/kubernetes/helm-deploy).
[Kubernetes Helm Deployment documentation](/docs/kubernetes/helm-deploy).
#### URL Service
Expand Down
44 changes: 0 additions & 44 deletions builtin/null/builder.go

This file was deleted.

2 changes: 1 addition & 1 deletion builtin/null/null.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ import (

// Options are the SDK options to use for instantiation for this plugin.
var Options = []sdk.Option{
sdk.WithComponents(&ConfigSourcer{}, &Builder{}, &Platform{}, &Releaser{}),
sdk.WithComponents(&ConfigSourcer{}),
}
90 changes: 0 additions & 90 deletions builtin/null/platform.go

This file was deleted.

Loading

0 comments on commit b4090a2

Please sign in to comment.