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
24 changes: 8 additions & 16 deletions hack/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
# Load github.com/knative/test-infra/images/prow-tests/scripts/library.sh
[ -f /workspace/library.sh ] \
&& source /workspace/library.sh \
|| eval "$(docker run --entrypoint sh gcr.io/knative-tests/test-infra/prow-tests -c 'cat library.sh')"
[ -v KNATIVE_TEST_INFRA ] || exit 1

source "$(dirname $(readlink -f ${BASH_SOURCE}))/../test/library.sh"
set -o errexit

: ${PROJECT_ID:="knative-environments"}
readonly PROJECT_ID
readonly K8S_CLUSTER_NAME=${1:?"First argument must be the kubernetes cluster name."}
readonly K8S_CLUSTER_ZONE=us-central1-a
readonly K8S_CLUSTER_MACHINE=n1-standard-8
readonly K8S_CLUSTER_NODES=5
readonly SERVING_RELEASE=https://storage.googleapis.com/knative-releases/latest/release.yaml
readonly ISTIO_YAML=https://storage.googleapis.com/knative-releases/latest/istio.yaml
readonly PROJECT_USER=$(gcloud config get-value core/account)
readonly CURRENT_PROJECT=$(gcloud config get-value project)

function cleanup() {
gcloud config set project ${CURRENT_PROJECT}
}

cd ${SERVING_ROOT_DIR}
cd ${REPO_ROOT_DIR}
trap cleanup EXIT

echo "Using project ${PROJECT_ID} and user ${PROJECT_USER}"
Expand All @@ -60,16 +62,6 @@ gcloud --project=${PROJECT_ID} container clusters create \
header "Setting cluster admin"
acquire_cluster_admin_role ${PROJECT_USER} ${K8S_CLUSTER_NAME} ${K8S_CLUSTER_ZONE}

header "Installing istio"
kubectl apply -f ${ISTIO_YAML}
wait_until_pods_running istio-system

kubectl label namespace default istio-injection=enabled

header "Installing Knative Serving"
kubectl apply -f ${SERVING_RELEASE}

wait_until_pods_running knative-serving
wait_until_pods_running knative-build
start_latest_knative_serving

header "Knative Serving deployed successfully to ${K8S_CLUSTER_NAME}"
5 changes: 2 additions & 3 deletions hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

source "$(dirname $(readlink -f ${BASH_SOURCE}))/../test/library.sh"

set -o errexit
set -o nounset
set -o pipefail

readonly SERVING_ROOT_DIR="$(git rev-parse --show-toplevel)"
readonly TMP_DIFFROOT="$(mktemp -d -p ${SERVING_ROOT_DIR})"

cleanup() {
Expand All @@ -43,7 +42,7 @@ cp -a "${SERVING_ROOT_DIR}/config"/* "${TMP_DIFFROOT}/config"
"${SERVING_ROOT_DIR}/hack/update-codegen.sh"
echo "Diffing ${SERVING_ROOT_DIR} against freshly generated codegen"
ret=0
diff -Naupr "${SERVING_ROOT_DIR}/pkg" "${TMP_DIFFROOT}/pkg" || ret=$?
diff -Naupr "${SERVING_ROOT_DIR}/pkg" "${TMP_DIFFROOT}/pkg" || ret=1

# Restore working tree state
rm -fr "${TMP_DIFFROOT}/config"
Expand Down
185 changes: 0 additions & 185 deletions test/library.sh

This file was deleted.