From 51e4ad9a0a8e9eb562da32422978f985e42f2528 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 14 Feb 2019 12:47:48 +0100 Subject: [PATCH] chore(deploy snapshot): deploy runtime snapshots to apache snapshot repo, fixes #432 --- Gopkg.lock | 1 + contributing.adoc | 24 ++++++++++++++++++++ deploy/resources.go | 54 ++++++++++++++++++++++++++------------------- script/Makefile | 5 ++++- 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 6f10ebf2e7..f47e069f60 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1102,6 +1102,7 @@ "github.com/spf13/cobra", "github.com/stoewer/go-strcase", "github.com/stretchr/testify/assert", + "go.uber.org/multierr", "gopkg.in/yaml.v2", "k8s.io/api/apps/v1", "k8s.io/api/core/v1", diff --git a/contributing.adoc b/contributing.adoc index 99234ac5ac..b16f2e8071 100644 --- a/contributing.adoc +++ b/contributing.adoc @@ -90,6 +90,30 @@ After a successful build, if you're connected to a Docker daemon, you can build make images ``` +[[push-snapshot]] +== Push runtime snapshot + +For the Java bits in runtime you can push to the snapshost to the Apache Snapshot repository with: + +* `make push-runtime-snapshot`: to push the Java-based runtime snapshot JARs. + +In your settings.xml you'll need to have the correct ASF credentials to push. + +``` + + apache.snapshots.https + username + password + + + apache.releases.https + username + password + +``` + +Don't forget to first run a `make build-runtime` before pushing the snapshot + [[testing]] == Testing diff --git a/deploy/resources.go b/deploy/resources.go index dd46d97a58..b9094dedfd 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -4177,29 +4177,6 @@ spec: passive: false version: 2.23.1 -` - Resources["cr-example.yaml"] = - ` -apiVersion: camel.apache.org/v1alpha1 -kind: Integration -metadata: - name: example -spec: - source: - content: |- - // This is Camel K Groovy example route - - rnd = new Random() - - from('timer:groovy?period=1s') - .routeId('groovy') - .setBody() - .constant('Hello Camel K!') - .process { - it.in.headers['RandomValue'] = rnd.nextInt() - } - .to('log:info?showHeaders=true') - name: routes.groovy ` Resources["crd-camel-catalog.yaml"] = ` @@ -4319,6 +4296,29 @@ spec: description: The IntegrationContext to use JSONPath: .status.context +` + Resources["cr-example.yaml"] = + ` +apiVersion: camel.apache.org/v1alpha1 +kind: Integration +metadata: + name: example +spec: + source: + content: |- + // This is Camel K Groovy example route + + rnd = new Random() + + from('timer:groovy?period=1s') + .routeId('groovy') + .setBody() + .constant('Hello Camel K!') + .process { + it.in.headers['RandomValue'] = rnd.nextInt() + } + .to('log:info?showHeaders=true') + name: routes.groovy ` Resources["operator-deployment-kubernetes.yaml"] = ` @@ -4359,6 +4359,10 @@ spec: fieldPath: metadata.namespace - name: OPERATOR_NAME value: "camel-k" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name volumeMounts: - mountPath: /workspace name: camel-k-builder @@ -4418,6 +4422,10 @@ spec: fieldPath: metadata.namespace - name: OPERATOR_NAME value: "camel-k" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name ` Resources["operator-role-binding-knative.yaml"] = diff --git a/script/Makefile b/script/Makefile index 95f4e6c487..47acae65f2 100644 --- a/script/Makefile +++ b/script/Makefile @@ -22,6 +22,9 @@ build-compile-integration-tests: build-runtime: ./mvnw clean install -B -f ./runtime/pom.xml +push-runtime-snapshot: + ./mvnw deploy -B -f ./runtime/pom.xml + release: clean prepare-release build images-build images-push cross-compile package-examples git-tag publish-base-images prepare-release: @@ -84,4 +87,4 @@ check-integration: lint: golangci-lint run -.PHONY: build build-operator build-kamel build-embed-resources build-runtime dep codegen images images-build images-push test check test-integration check-integration clean release prepare-release cross-compile package-examples new-version git-tag publish-base-images increment-snapshot install-minishift +.PHONY: build build-operator build-kamel build-embed-resources build-runtime push-runtime-snapshot dep codegen images images-build images-push test check test-integration check-integration clean release prepare-release cross-compile package-examples new-version git-tag publish-base-images increment-snapshot install-minishift