Skip to content

Commit

Permalink
Add image build config and release script (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimansk authored Oct 11, 2024
1 parent b23ef4f commit d0ae268
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module knative.dev/eventing-integrations

go 1.23.1

require knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d h1:aCfX7kwkvgGxXXGbso5tLqdwQmzBkJ9d+EIRwksKTvk=
knative.dev/hack v0.0.0-20241010131451-05b2fb30cb4d/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
30 changes: 30 additions & 0 deletions hack/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# Copyright 2024 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script release.sh)"

function build_release() {
header "Building images"

# KO_DOCKER_REPO and TAG are calculated in release.sh script

./mvnw clean package -P knative -DskipTests || return $?

echo "Image build & push completed"
}

main "$@"
20 changes: 20 additions & 0 deletions hack/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//go:build tools

/*
Copyright 2024 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package tools

import (
_ "knative.dev/hack/cmd/script" // Allow calling embedded scripts from hack
)
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,23 @@
</build>

<profiles>
<profile>
<id>knative</id>
<activation>
<property>
<name>knative</name>
</property>
</activation>
<properties>
<quarkus.container-image.image>${env.KO_DOCKER_REPO}/${project.artifactId}:${env.TAG}</quarkus.container-image.image>

<quarkus.container-image.build>true</quarkus.container-image.build>
<quarkus.container-image.push>true</quarkus.container-image.push>

<!-- Unset to prevent default inheritance -->
<quarkus.container-image.insecure>false</quarkus.container-image.insecure>
</properties>
</profile>
<profile>
<id>native</id>
<activation>
Expand Down

0 comments on commit d0ae268

Please sign in to comment.