Skip to content

Commit eee7a15

Browse files
committed
flesh out Makefile, allow specifying binary for presubmit
this should allow us to change the testing job to call the Makefile without breaking the build in the meantime Signed-off-by: Ashley Davis <[email protected]>
1 parent 3d72173 commit eee7a15

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Built cmrel binary
1+
# Built binaries
22
/cmrel
3+
bin/
34

45
# Binaries for programs and plugins
56
*.exe

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
.PHONY: build
16+
build: bin/cmrel
17+
18+
.PHONY: bin/cmrel
19+
bin/cmrel:
20+
go build -o $@ ./cmd/cmrel
21+
22+
.PHONY: presubmit
23+
presubmit: bin/cmrel verify-boilerplate
24+
./test/presubmit.sh $<
25+
1526
.PHONY: verify-boilerplate
1627
verify-boilerplate:
1728
@./hack/verify_boilerplate.py
29+
30+
.PHONY: clean
31+
clean:
32+
rm -rf ./bin ./cmrel

test/presubmit.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ set -o nounset
1818
set -o errexit
1919
set -o pipefail
2020

21-
echo "+++ Building cmrel tool"
22-
go build -o cmrel ./cmd/cmrel
21+
if [ -z ${1+x} ]; then
22+
echo "+++ Building cmrel tool"
23+
go build -o ./cmrel ./cmd/cmrel
24+
CMREL=./cmrel
25+
else
26+
CMREL=$1
27+
fi
2328

2429
# clone cert-manager @ master
2530
echo "+++ Cloning jetstack/cert-manager repository"
@@ -28,7 +33,7 @@ trap "rm -rf ${tmpdir}" EXIT
2833
git clone https://github.com/jetstack/cert-manager.git "${tmpdir}"
2934

3035
echo "+++ Running 'gcb stage' command"
31-
./cmrel gcb stage \
36+
$CMREL gcb stage \
3237
--repo-path="${tmpdir}" \
3338
--skip-push=true \
3439
--debug

0 commit comments

Comments
 (0)