Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def generateTestCheckSinglePackageStage(Map args = [:]) {
dir("${BASE_DIR}"){
withMageEnv(){
withCloudTestEnv() {
sh(label: 'Build elastic-package',script: "make build")
sh(label: 'Install elastic-package',script: "make install")
sh(label: 'Build elastic-package',script: "make PACKAGE_UNDER_TEST=${it} test-check-packages-parallel")
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ def generateTestCommandStage(Map args = [:]){
withMageEnv(){
withKubernetes() {
withCloudTestEnv() {
sh(label: 'Check',script: "make build ${command} check-git-clean")
sh(label: 'Check',script: "make install ${command} check-git-clean")
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
CODE_COVERAGE_REPORT_FOLDER = $(PWD)/build/test-coverage
CODE_COVERAGE_REPORT_NAME_UNIT = $(CODE_COVERAGE_REPORT_FOLDER)/coverage-unit-report
VERSION_IMPORT_PATH = github.com/elastic/elastic-package/internal/version
VERSION_COMMIT_HASH = `git describe --always --long --dirty`
VERSION_BUILD_TIME = `date +%s`
VERSION_TAG = `(git describe --exact-match --tags 2>/dev/null || echo '') | tr -d '\n'`
VERSION_LDFLAGS = -X $(VERSION_IMPORT_PATH).CommitHash=$(VERSION_COMMIT_HASH) -X $(VERSION_IMPORT_PATH).BuildTime=$(VERSION_BUILD_TIME) -X $(VERSION_IMPORT_PATH).Tag=$(VERSION_TAG)

.PHONY: build

build:
go install -ldflags \
"-X $(VERSION_IMPORT_PATH).CommitHash=`git describe --always --long --dirty` -X $(VERSION_IMPORT_PATH).BuildTime=`date +%s` -X $(VERSION_IMPORT_PATH).Tag=`(git describe --exact-match --tags 2>/dev/null || echo '') | tr -d '\n'`" \
github.com/elastic/elastic-package
go build -ldflags "$(VERSION_LDFLAGS)" -o elastic-package

clean:
rm -rf build

format:
go run golang.org/x/tools/cmd/goimports -local github.com/elastic/elastic-package/ -w .

install:
go install -ldflags "$(VERSION_LDFLAGS)" github.com/elastic/elastic-package

lint:
go run honnef.co/go/tools/cmd/staticcheck ./...

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ source code:

`make format` - format the Go code

`make install` - build the tool source and move binary to `$GOBIN`

`make vendor` - vendor code of dependencies

`make check` - one-liner, used by CI to verify if source code is ready to be pushed to the repository
Expand Down Expand Up @@ -297,4 +299,4 @@ git push upstream v0.15.0
```

The CI will run a new job for the just pushed tag and publish released artifacts. Please expect an automated follow-up PR
in the [Integrations](https://github.com/elastic/integrations) repository to bump up the version ([sample PR](https://github.com/elastic/integrations/pull/1516)).
in the [Integrations](https://github.com/elastic/integrations) repository to bump up the version ([sample PR](https://github.com/elastic/integrations/pull/1516)).
4 changes: 3 additions & 1 deletion tools/readme/readme.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ source code:

`make format` - format the Go code

`make install` - build the tool source and move binary to `$GOBIN`

`make vendor` - vendor code of dependencies

`make check` - one-liner, used by CI to verify if source code is ready to be pushed to the repository
Expand Down Expand Up @@ -131,4 +133,4 @@ git push upstream v0.15.0
```

The CI will run a new job for the just pushed tag and publish released artifacts. Please expect an automated follow-up PR
in the [Integrations](https://github.com/elastic/integrations) repository to bump up the version ([sample PR](https://github.com/elastic/integrations/pull/1516)).
in the [Integrations](https://github.com/elastic/integrations) repository to bump up the version ([sample PR](https://github.com/elastic/integrations/pull/1516)).