Skip to content

Commit 6f2ee84

Browse files
committed
stembuild: cleanup Makefile targets
- improve naming - remove unused builds
1 parent b3d565c commit 6f2ee84

File tree

8 files changed

+34
-46
lines changed

8 files changed

+34
-46
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
go-version-file: stembuild/go.mod
1717
- name: Provide `StemcellAutomation.zip` for `go:embed` consumption in `assets` package
1818
run: |
19-
make generate-fake-stemcell-automation
19+
make stubbed-stemcell-automation-zip
2020
working-directory: stembuild
2121
- uses: golangci/golangci-lint-action@v8
2222
with:
@@ -33,7 +33,7 @@ jobs:
3333
go-version-file: stembuild/go.mod
3434
- name: Provide `StemcellAutomation.zip` for `go:embed` consumption in `assets` package
3535
run: |
36-
make generate-fake-stemcell-automation
36+
make stubbed-stemcell-automation-zip
3737
working-directory: stembuild
3838
# skip specs for packager,ovftool because `ovftool` binary is required
3939
- run: |

ci/tasks/build-stembuild-linux/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cp "${ROOT_DIR}"/${STEMCELL_AUTOMATION_ZIP} \
1212

1313
pushd "${ROOT_DIR}/stemcell-builder/stembuild"
1414
echo '***Building Stembuild***'
15-
make STEMCELL_VERSION="${VERSION}" build
15+
make STEMCELL_VERSION="${VERSION}" stembuild
1616
popd
1717

1818
echo '***Copying stembuild to output directory***'

ci/tasks/build-stembuild-windows/run.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $INPUT_ZIP_GLOB=Join-Path $ROOT_DIR $env:STEMCELL_AUTOMATION_ZIP
1717

1818
Copy-Item -Path $INPUT_ZIP_GLOB "assets\StemcellAutomation.zip" -Recurse -Force
1919

20-
make STEMCELL_VERSION=${VERSION} build
20+
make STEMCELL_VERSION=${VERSION} stembuild
2121

2222
Write-Host ***Copying stembuild to output directory***
2323
Copy-Item out/stembuild.exe $OUTPUT_DIR/stembuild-windows-x86_64-$VERSION.exe

ci/tasks/test-contract-stembuild-linux/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ go -C govmomi/vcsim install
1616
pushd "${ROOT_DIR}/stemcell-builder/stembuild"
1717
echo ***Test Stembuild Code***
1818

19-
make contract
19+
make iaas_cli
2020
popd

ci/tasks/test-contract-stembuild-windows/run.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Write-Host ***Test Stembuild Code***
1212

1313
Set-Location stemcell-builder\stembuild
1414

15-
make contract
15+
make iaas_cli
1616
if ($lastexitcode -ne 0)
1717
{
1818
throw "contract tests failed"

stembuild/Makefile

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,39 @@ else
1616
endif
1717
endif
1818

19-
all : test build
20-
21-
build : out/stembuild
22-
23-
build-integration : generate-fake-stemcell-automation $(GOSRC)
24-
go build -o $(COMMAND) -ldflags $(LD_FLAGS) .
25-
26-
clean :
27-
rm -rf version/version.go assets/StemcellAutomation.zip assets/local/* out/*
28-
29-
format :
30-
go fmt ./...
31-
32-
integration : generate-fake-stemcell-automation
33-
go run github.com/onsi/ginkgo/v2/ginkgo -r -vv --randomize-all --keep-going --flake-attempts 2 --timeout 3h --output-interceptor-mode=none integration
34-
35-
integration/construct : generate-fake-stemcell-automation
36-
go run github.com/onsi/ginkgo/v2/ginkgo -r -v --randomize-all --keep-going --flake-attempts 2 --timeout 3h --output-interceptor-mode=none integration/construct
19+
assets/StemcellAutomation.zip:
20+
@echo "Unable to locate assets/StemcellAutomation.zip. This file is bundled into the final stembuild executable and must be present. Please see README.md on how to construct this file."
21+
exit 1
3722

38-
integration-badger : generate-fake-stemcell-automation
39-
go run github.com/onsi/ginkgo/v2/ginkgo -r -v --randomize-all --until-it-fails --timeout 3h integration
40-
41-
generate-fake-stemcell-automation:
42-
$(CP) integration/construct/assets/StemcellAutomation.zip assets/
23+
all : stembuild stembuild.exe
24+
stembuild : out/stembuild
25+
stembuild.exe : out/stembuild.exe
4326

4427
out/stembuild : assets $(GOSRC)
4528
CGO_ENABLED=0 go build -o $(COMMAND) -ldflags $(LD_FLAGS) .
4629

4730
out/stembuild.exe : assets $(GOSRC)
4831
GOOS=windows CGO_ENABLED=0 go build -o out/stembuild.exe -ldflags $(LD_FLAGS) .
4932

50-
test : units
33+
clean :
34+
rm -rf version/version.go assets/StemcellAutomation.zip out/*
5135

52-
units : format generate-fake-stemcell-automation
53-
@go run github.com/onsi/ginkgo/v2/ginkgo version
54-
go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-all --randomize-suites --keep-going --skip-package integration,iaas_cli
55-
@echo ""
56-
@echo "SWEET SUITE SUCCESS"
5736

58-
contract :
59-
go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-all --randomize-suites --keep-going --flake-attempts 2 iaas_cli
37+
units : stubbed-stemcell-automation-zip
38+
go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --skip-package integration,iaas_cli
6039

61-
.PHONY : all build build-integration clean format generate-fake-stemcell-automation
62-
.PHONY : test units units-full integration integration-tests-full
40+
iaas_cli :
41+
go run github.com/onsi/ginkgo/v2/ginkgo run -r --randomize-all --randomize-suites --keep-going --flake-attempts 2 iaas_cli
6342

64-
assets/StemcellAutomation.zip:
65-
@echo "Unable to locate assets/StemcellAutomation.zip. This file is bundled into the final stembuild executable and must be present. Please see README.md on how to construct this file."
66-
exit 1
43+
integration-build : stubbed-stemcell-automation-zip $(GOSRC)
44+
go build -o $(COMMAND) -ldflags $(LD_FLAGS) .
45+
46+
integration : stubbed-stemcell-automation-zip
47+
go run github.com/onsi/ginkgo/v2/ginkgo run -r -vv --timeout 3h --randomize-all --keep-going --flake-attempts 2 integration
48+
49+
stubbed-stemcell-automation-zip :
50+
$(CP) integration/construct/assets/StemcellAutomation.zip assets/
51+
52+
53+
.PHONY : all stembuild stembuild.exe clean
54+
.PHONY : units iaas_cli integration integration-build stubbed-stemcell-automation-zip

stembuild/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ ZIP_FILE_DESTINATION="stembuild/assets/StemcellAutomation.zip" \
288288
./ci/tasks/zip-files/run.bash
289289
```
290290

291-
Use `make build` to build stembuild, providing the corresponding values for the stemcell version you
291+
Use `make stembuild` to build stembuild, providing the corresponding values for the stemcell version you
292292
would like to build, for example:
293293
```
294-
STEMBUILD_VERSION=2019.70 make build
294+
STEMBUILD_VERSION=2019.70 make stembuild
295295
```

stembuild/test/helpers/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func ReadFile(name string) (string, error) {
170170
}
171171

172172
func BuildStembuild(version string) (string, error) {
173-
command := exec.Command("make", "build-integration")
173+
command := exec.Command("make", "integration-build")
174174
command.Env = AddOrReplaceEnvironment(os.Environ(), "STEMBUILD_VERSION", version)
175175

176176
_, b, _, _ := runtime.Caller(0)
@@ -195,7 +195,7 @@ func BuildStembuild(version string) (string, error) {
195195
}
196196
}
197197

198-
panic("Unable to find binary generated by 'make build'")
198+
panic("Unable to find binary generated by 'make integration-build'")
199199
}
200200

201201
func EnvMustExist(variableName string) string {

0 commit comments

Comments
 (0)