This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push: new 2d9eda0 do not include runtime artefacts in operator image by default #468 2d9eda0 is described below commit 2d9eda01dadc6da106c8b65436d57a130871c636 Author: lburgazzoli <lburgazz...@gmail.com> AuthorDate: Fri Feb 22 10:01:07 2019 +0100 do not include runtime artefacts in operator image by default #468 --- .gitmodules | 3 - build/maven/pom-catalog.xml | 104 ++++++++++++++++ build/maven/pom-runtime.xml | 146 +++++++++++++++++++++++ build/maven/settings.xml | 6 - cmd/util/json-schema-gen/jsonschemagen.go | 10 +- deploy/camel-catalog-2.23.0.yaml | 8 +- deploy/camel-catalog-2.23.1.yaml | 8 +- deploy/resources.go | 16 +-- pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go | 101 +++++++++++++++- pkg/builder/builder_utils.go | 8 +- pkg/cmd/completion_bash.go | 2 +- pkg/cmd/install.go | 5 + pkg/cmd/version.go | 5 +- pkg/controller/integrationplatform/initialize.go | 2 +- pkg/platform/images/images.go | 5 +- pkg/platform/images/images_test.go | 12 +- pkg/trait/builder_test.go | 2 +- pkg/trait/environment.go | 4 +- pkg/trait/rest-dsl.go | 4 +- pkg/util/defaults/defaults.go | 41 +++---- pkg/util/digest/digest.go | 6 +- pkg/util/test/catalog.go | 2 +- pkg/util/test/catalog_test.go | 3 - runtime | 1 - script/Makefile | 145 +++++++++++++--------- script/build_catalog.sh | 27 ++--- script/cross_compile.sh | 8 +- script/get_version.sh | 4 - script/git_tag.sh | 20 ++-- script/images_build.sh | 6 - script/images_push.sh | 9 +- script/install_minikube.sh | 2 - script/install_minishift.sh | 2 - script/package_examples.sh | 7 +- script/package_maven_artifacts.sh | 15 ++- script/publish_base_images.sh | 9 +- script/set_version.sh | 23 ++-- script/travis_build.sh | 5 +- version/version.go | 25 ---- 39 files changed, 585 insertions(+), 226 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1f98a99..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "runtime"] - path = runtime - url = https://github.com/apache/camel-k-runtime.git diff --git a/build/maven/pom-catalog.xml b/build/maven/pom-catalog.xml new file mode 100644 index 0000000..db52c6d --- /dev/null +++ b/build/maven/pom-catalog.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-catalog-generator</artifactId> + <version>1.0.0</version> + + <build> + <defaultGoal>generate-resources</defaultGoal> + <plugins> + <plugin> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-maven-plugin</artifactId> + <version>${runtime.version}</version> + <executions> + <execution> + <id>generate-catalog</id> + <goals> + <goal>generate-catalog</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-catalog</artifactId> + <version>${catalog.version}</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + + <repositories> + <repository> + <id>apache.snapshots</id> + <name>Apache Development Snapshot Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + <repository> + <id>oss.snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + + <pluginRepositories> + <pluginRepository> + <id>apache.snapshots</id> + <name>Apache Development Snapshot Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>oss.snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + +</project> diff --git a/build/maven/pom-runtime.xml b/build/maven/pom-runtime.xml new file mode 100644 index 0000000..b3f58fc --- /dev/null +++ b/build/maven/pom-runtime.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-catalog-generator</artifactId> + <version>1.0.0</version> + + <dependencies> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-maven-plugin</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-knative</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-knative-http</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-core</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-jvm</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-groovy</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-kotlin</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-yaml</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-spring-boot</artifactId> + <version>${runtime.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.k</groupId> + <artifactId>camel-k-runtime-spring-boot-layout</artifactId> + <version>${runtime.version}</version> + </dependency> + </dependencies> + + <repositories> + <repository> + <id>apache.snapshots</id> + <name>Apache Development Snapshot Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + <repository> + <id>oss.snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + + <pluginRepositories> + <pluginRepository> + <id>apache.snapshots</id> + <name>Apache Development Snapshot Repository</name> + <url>https://repository.apache.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>oss.snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>3.1.1</version> + <configuration> + <useRepositoryLayout>true</useRepositoryLayout> + <addParentPoms>true</addParentPoms> + <copyPom>true</copyPom> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/build/maven/settings.xml b/build/maven/settings.xml deleted file mode 100644 index 6c6c5c7..0000000 --- a/build/maven/settings.xml +++ /dev/null @@ -1,6 +0,0 @@ -<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 - https://maven.apache.org/xsd/settings-1.0.0.xsd"> - <localRepository>build/_maven_output</localRepository> -</settings> \ No newline at end of file diff --git a/cmd/util/json-schema-gen/jsonschemagen.go b/cmd/util/json-schema-gen/jsonschemagen.go index 30125b0..79ce8a4 100644 --- a/cmd/util/json-schema-gen/jsonschemagen.go +++ b/cmd/util/json-schema-gen/jsonschemagen.go @@ -30,7 +30,6 @@ import ( "github.com/spf13/cobra" ) -// Publishes predefined images for all Camel components func main() { sources := []interface{}{ v1alpha1.Integration{}, @@ -54,6 +53,15 @@ func main() { fmt.Println("error:", err) } + if _, err := os.Stat(out); err != nil { + if os.IsNotExist(err) { + if err := os.MkdirAll(out, os.ModePerm); err != nil { + fmt.Println("error:", err) + return + } + } + } + v := reflect.ValueOf(source) t := reflect.Indirect(v).Type().Name() o := path.Join(out, t+".json") diff --git a/deploy/camel-catalog-2.23.0.yaml b/deploy/camel-catalog-2.23.0.yaml index 7dd2125..0473433 100644 --- a/deploy/camel-catalog-2.23.0.yaml +++ b/deploy/camel-catalog-2.23.0.yaml @@ -1110,21 +1110,21 @@ spec: camel-k-runtime-groovy: groupId: org.apache.camel.k artifactId: camel-k-runtime-groovy - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-groovy camel-k-runtime-jvm: groupId: org.apache.camel.k artifactId: camel-k-runtime-jvm - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-core camel-k-runtime-kotlin: groupId: org.apache.camel.k artifactId: camel-k-runtime-kotlin - version: 0.3.0-SNAPSHOT + version: 1.0.0 camel-kafka: groupId: org.apache.camel artifactId: camel-kafka @@ -1142,7 +1142,7 @@ spec: camel-knative: groupId: org.apache.camel.k artifactId: camel-knative - version: 0.3.0-SNAPSHOT + version: 1.0.0 schemes: - id: knative http: true diff --git a/deploy/camel-catalog-2.23.1.yaml b/deploy/camel-catalog-2.23.1.yaml index 573b5a8..0ccd37a 100644 --- a/deploy/camel-catalog-2.23.1.yaml +++ b/deploy/camel-catalog-2.23.1.yaml @@ -1110,21 +1110,21 @@ spec: camel-k-runtime-groovy: groupId: org.apache.camel.k artifactId: camel-k-runtime-groovy - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-groovy camel-k-runtime-jvm: groupId: org.apache.camel.k artifactId: camel-k-runtime-jvm - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-core camel-k-runtime-kotlin: groupId: org.apache.camel.k artifactId: camel-k-runtime-kotlin - version: 0.3.0-SNAPSHOT + version: 1.0.0 camel-kafka: groupId: org.apache.camel artifactId: camel-kafka @@ -1142,7 +1142,7 @@ spec: camel-knative: groupId: org.apache.camel.k artifactId: camel-knative - version: 0.3.0-SNAPSHOT + version: 1.0.0 schemes: - id: knative http: true diff --git a/deploy/resources.go b/deploy/resources.go index 95ade1a..2d1f38c 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -1154,21 +1154,21 @@ spec: camel-k-runtime-groovy: groupId: org.apache.camel.k artifactId: camel-k-runtime-groovy - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-groovy camel-k-runtime-jvm: groupId: org.apache.camel.k artifactId: camel-k-runtime-jvm - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-core camel-k-runtime-kotlin: groupId: org.apache.camel.k artifactId: camel-k-runtime-kotlin - version: 0.3.0-SNAPSHOT + version: 1.0.0 camel-kafka: groupId: org.apache.camel artifactId: camel-kafka @@ -1186,7 +1186,7 @@ spec: camel-knative: groupId: org.apache.camel.k artifactId: camel-knative - version: 0.3.0-SNAPSHOT + version: 1.0.0 schemes: - id: knative http: true @@ -3223,21 +3223,21 @@ spec: camel-k-runtime-groovy: groupId: org.apache.camel.k artifactId: camel-k-runtime-groovy - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-groovy camel-k-runtime-jvm: groupId: org.apache.camel.k artifactId: camel-k-runtime-jvm - version: 0.3.0-SNAPSHOT + version: 1.0.0 dependencies: - groupId: org.apache.camel artifactId: camel-core camel-k-runtime-kotlin: groupId: org.apache.camel.k artifactId: camel-k-runtime-kotlin - version: 0.3.0-SNAPSHOT + version: 1.0.0 camel-kafka: groupId: org.apache.camel artifactId: camel-kafka @@ -3255,7 +3255,7 @@ spec: camel-knative: groupId: org.apache.camel.k artifactId: camel-knative - version: 0.3.0-SNAPSHOT + version: 1.0.0 schemes: - id: knative http: true diff --git a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go index d4afdef..e9a0f03 100644 --- a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go @@ -41,12 +41,88 @@ func (in *Artifact) DeepCopy() *Artifact { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CamelArtifact) DeepCopyInto(out *CamelArtifact) { + *out = *in + in.CamelArtifactDependency.DeepCopyInto(&out.CamelArtifactDependency) + if in.Schemes != nil { + in, out := &in.Schemes, &out.Schemes + *out = make([]CamelScheme, len(*in)) + copy(*out, *in) + } + if in.Languages != nil { + in, out := &in.Languages, &out.Languages + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DataFormats != nil { + in, out := &in.DataFormats, &out.DataFormats + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Dependencies != nil { + in, out := &in.Dependencies, &out.Dependencies + *out = make([]CamelArtifact, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelArtifact. +func (in *CamelArtifact) DeepCopy() *CamelArtifact { + if in == nil { + return nil + } + out := new(CamelArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CamelArtifactDependency) DeepCopyInto(out *CamelArtifactDependency) { + *out = *in + if in.Exclusions != nil { + in, out := &in.Exclusions, &out.Exclusions + *out = make([]CamelArtifactExclusion, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelArtifactDependency. +func (in *CamelArtifactDependency) DeepCopy() *CamelArtifactDependency { + if in == nil { + return nil + } + out := new(CamelArtifactDependency) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CamelArtifactExclusion) DeepCopyInto(out *CamelArtifactExclusion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelArtifactExclusion. +func (in *CamelArtifactExclusion) DeepCopy() *CamelArtifactExclusion { + if in == nil { + return nil + } + out := new(CamelArtifactExclusion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CamelCatalog) DeepCopyInto(out *CamelCatalog) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec out.Status = in.Status + in.Spec.DeepCopyInto(&out.Spec) return } @@ -104,6 +180,13 @@ func (in *CamelCatalogList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CamelCatalogSpec) DeepCopyInto(out *CamelCatalogSpec) { *out = *in + if in.Artifacts != nil { + in, out := &in.Artifacts, &out.Artifacts + *out = make(map[string]CamelArtifact, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } return } @@ -134,6 +217,22 @@ func (in *CamelCatalogStatus) DeepCopy() *CamelCatalogStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CamelScheme) DeepCopyInto(out *CamelScheme) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelScheme. +func (in *CamelScheme) DeepCopy() *CamelScheme { + if in == nil { + return nil + } + out := new(CamelScheme) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) { *out = *in return diff --git a/pkg/builder/builder_utils.go b/pkg/builder/builder_utils.go index 1d0cfce..45d5b25 100644 --- a/pkg/builder/builder_utils.go +++ b/pkg/builder/builder_utils.go @@ -20,11 +20,11 @@ package builder import ( "encoding/xml" - "github.com/apache/camel-k/pkg/util/camel" - "github.com/apache/camel-k/pkg/util/maven" - "github.com/apache/camel-k/version" + "github.com/apache/camel-k/pkg/util/defaults" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/util/camel" + "github.com/apache/camel-k/pkg/util/maven" ) // ArtifactIDs -- @@ -57,7 +57,7 @@ func NewProject(ctx *Context) (maven.Project, error) { ModelVersion: "4.0.0", GroupID: "org.apache.camel.k.integration", ArtifactID: "camel-k-integration", - Version: version.Version, + Version: defaults.Version, Properties: ctx.Request.Platform.Build.Properties, DependencyManagement: maven.DependencyManagement{ Dependencies: []maven.Dependency{ diff --git a/pkg/cmd/completion_bash.go b/pkg/cmd/completion_bash.go index c249487..25f0733 100644 --- a/pkg/cmd/completion_bash.go +++ b/pkg/cmd/completion_bash.go @@ -267,7 +267,7 @@ func configureBashAnnotationForFlag(command *cobra.Command, flagName string, ann func computeCamelDependencies() string { catalog, err := test.DefaultCatalog() - if err != nil { + if err != nil || catalog == nil { catalog = camel.NewRuntimeCatalog(v1alpha1.CamelCatalog{}.Spec) } diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go index 9b17db5..a381088 100644 --- a/pkg/cmd/install.go +++ b/pkg/cmd/install.go @@ -63,6 +63,7 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command { cmd.Flags().StringVar(&impl.localRepository, "local-repository", "", "Location of the local maven repository") cmd.Flags().StringSliceVarP(&impl.properties, "property", "p", nil, "Add a camel property") cmd.Flags().StringVar(&impl.camelVersion, "camel-version", "", "Set the camel version") + cmd.Flags().StringVar(&impl.runtimeVersion, "runtime-version", "", "Set the camel-k runtime version") cmd.Flags().StringVar(&impl.baseImage, "base-image", "", "Set the base image used to run integrations") cmd.Flags().StringSliceVar(&impl.contexts, "context", nil, "Add a camel context to build at startup, by default all known contexts are built") @@ -90,6 +91,7 @@ type installCmdOptions struct { organization string pushSecret string camelVersion string + runtimeVersion string baseImage string localRepository string repositories []string @@ -174,6 +176,9 @@ func (o *installCmdOptions) install(_ *cobra.Command, _ []string) error { if o.camelVersion != "" { platform.Spec.Build.CamelVersion = o.camelVersion } + if o.runtimeVersion != "" { + platform.Spec.Build.RuntimeVersion = o.runtimeVersion + } if o.baseImage != "" { platform.Spec.Build.BaseImage = o.baseImage } diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index a6fbbd2..1118725 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -20,7 +20,8 @@ package cmd import ( "fmt" - rootVersion "github.com/apache/camel-k/version" + "github.com/apache/camel-k/pkg/util/defaults" + "github.com/spf13/cobra" ) @@ -30,7 +31,7 @@ func newCmdVersion() *cobra.Command { Short: "Display client version", Long: `Display Camel K client version.`, Run: func(_ *cobra.Command, _ []string) { - fmt.Println("Camel K Client " + rootVersion.Version) + fmt.Println("Camel K Client " + defaults.Version) }, } } diff --git a/pkg/controller/integrationplatform/initialize.go b/pkg/controller/integrationplatform/initialize.go index cc598d1..a901739 100644 --- a/pkg/controller/integrationplatform/initialize.go +++ b/pkg/controller/integrationplatform/initialize.go @@ -93,7 +93,7 @@ func (action *initializeAction) Handle(ctx context.Context, ip *v1alpha1.Integra target.Spec.Profile = platform.GetProfile(target) } if target.Spec.Build.CamelVersion == "" { - target.Spec.Build.CamelVersion = defaults.CamelVersion + target.Spec.Build.CamelVersion = defaults.CamelVersionConstraint } if target.Spec.Build.RuntimeVersion == "" { target.Spec.Build.RuntimeVersion = defaults.RuntimeVersion diff --git a/pkg/platform/images/images.go b/pkg/platform/images/images.go index 5c80b34..09dc3af 100644 --- a/pkg/platform/images/images.go +++ b/pkg/platform/images/images.go @@ -22,8 +22,7 @@ import ( "strings" "github.com/apache/camel-k/pkg/util/camel" - - "github.com/apache/camel-k/version" + "github.com/apache/camel-k/pkg/util/defaults" ) // BaseRepository is the docker repository that contains images @@ -84,5 +83,5 @@ func LookupPredefinedImage(catalog *camel.RuntimeCatalog, dependencies []string) // PredefinedImageNameFor -- func PredefinedImageNameFor(comp string) string { - return fmt.Sprintf("%s/%s%s:%s", BaseRepository, ImagePrefix, comp, version.Version) + return fmt.Sprintf("%s/%s%s:%s", BaseRepository, ImagePrefix, comp, defaults.Version) } diff --git a/pkg/platform/images/images_test.go b/pkg/platform/images/images_test.go index 2db6c22..85a4337 100644 --- a/pkg/platform/images/images_test.go +++ b/pkg/platform/images/images_test.go @@ -21,9 +21,9 @@ import ( "strconv" "testing" + "github.com/apache/camel-k/pkg/util/defaults" "github.com/apache/camel-k/pkg/util/test" - "github.com/apache/camel-k/version" "github.com/stretchr/testify/assert" ) @@ -40,26 +40,26 @@ func TestImageLookup(t *testing.T) { }, { dependencies: []string{"camel:telegram", "camel:core", "camel-k:knative"}, - image: BaseRepository + "/" + ImagePrefix + "telegram:" + version.Version, + image: BaseRepository + "/" + ImagePrefix + "telegram:" + defaults.Version, }, { dependencies: []string{"camel:telegram", "camel-k:knative"}, - image: BaseRepository + "/" + ImagePrefix + "telegram:" + version.Version, + image: BaseRepository + "/" + ImagePrefix + "telegram:" + defaults.Version, }, { dependencies: []string{"camel:telegram", "camel:core", "camel-k:knative", "camel:dropbox"}, }, { dependencies: []string{"camel:core", "camel-k:knative"}, - image: BaseRepository + "/" + ImagePrefix + "core:" + version.Version, + image: BaseRepository + "/" + ImagePrefix + "core:" + defaults.Version, }, { dependencies: []string{"camel:dropbox", "camel:core", "camel-k:knative", "runtime:jvm"}, - image: BaseRepository + "/" + ImagePrefix + "dropbox:" + version.Version, + image: BaseRepository + "/" + ImagePrefix + "dropbox:" + defaults.Version, }, { dependencies: []string{"camel:dropbox", "camel:core", "camel-k:knative", "runtime:jvm", "runtime:yaml"}, - image: BaseRepository + "/" + ImagePrefix + "dropbox:" + version.Version, + image: BaseRepository + "/" + ImagePrefix + "dropbox:" + defaults.Version, }, { dependencies: []string{"camel:dropbox", "camel:core", "runtime:jvm", "runtime:yaml"}, diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go index 4735aca..1bd7da6 100644 --- a/pkg/trait/builder_test.go +++ b/pkg/trait/builder_test.go @@ -146,7 +146,7 @@ func createBuilderTestEnv(cluster v1alpha1.IntegrationPlatformCluster, strategy Build: v1alpha1.IntegrationPlatformBuildSpec{ PublishStrategy: strategy, Registry: "registry", - CamelVersion: defaults.CamelVersion, + CamelVersion: defaults.CamelVersionConstraint, }, }, }, diff --git a/pkg/trait/environment.go b/pkg/trait/environment.go index 34567e6..b12d285 100644 --- a/pkg/trait/environment.go +++ b/pkg/trait/environment.go @@ -19,8 +19,8 @@ package trait import ( "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/util/defaults" "github.com/apache/camel-k/pkg/util/envvar" - "github.com/apache/camel-k/version" ) type environmentTrait struct { @@ -52,7 +52,7 @@ func (t *environmentTrait) Configure(e *Environment) (bool, error) { } func (t *environmentTrait) Apply(e *Environment) error { - envvar.SetVal(&e.EnvVars, envVarCamelKVersion, version.Version) + envvar.SetVal(&e.EnvVars, envVarCamelKVersion, defaults.Version) envvar.SetVal(&e.EnvVars, envVarCamelKRuntimeVersion, e.RuntimeVersion) envvar.SetVal(&e.EnvVars, envVarCamelVersion, e.CamelCatalog.Version) diff --git a/pkg/trait/rest-dsl.go b/pkg/trait/rest-dsl.go index f10f9b1..41a32bb 100644 --- a/pkg/trait/rest-dsl.go +++ b/pkg/trait/rest-dsl.go @@ -28,13 +28,13 @@ import ( "strconv" "strings" - "github.com/apache/camel-k/version" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/apache/camel-k/pkg/gzip" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/util/defaults" "github.com/apache/camel-k/pkg/util/maven" ) @@ -215,7 +215,7 @@ func (t *restDslTrait) generateProject(e *Environment) (maven.Project, error) { ModelVersion: "4.0.0", GroupID: "org.apache.camel.k.integration", ArtifactID: "camel-k-red-dsl-generator", - Version: version.Version, + Version: defaults.Version, Build: maven.Build{ DefaultGoal: "generate-resources", Plugins: []maven.Plugin{ diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go index 3b19a5f..f5d9e6c 100644 --- a/pkg/util/defaults/defaults.go +++ b/pkg/util/defaults/defaults.go @@ -1,34 +1,23 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You 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 defaults -import "github.com/apache/camel-k/version" +// *********************** +// DO NOT EDIT THIS FILE +// *********************** const ( - // CamelVersion -- - CamelVersion = "~2.23.x" + // Version -- + Version = "0.3.0-SNAPSHOT" - // RuntimeVersion -- - RuntimeVersion = version.Version + // CamelVersionConstraint -- + CamelVersionConstraint = "~2.23.x" - // BaseImage -- - BaseImage = "fabric8/s2i-java:3.0-java8" + // RuntimeVersion -- + RuntimeVersion = "0.2.1" - // LocalRepository -- - LocalRepository = "/tmp/artifacts/m2" + // BaseImage -- + BaseImage = "fabric8/s2i-java:3.0-java8" + + // LocalRepository -- + LocalRepository = "/tmp/artifacts/m2" ) + diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go index 67054fb..1cec6b7 100644 --- a/pkg/util/digest/digest.go +++ b/pkg/util/digest/digest.go @@ -24,7 +24,7 @@ import ( "strconv" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" - "github.com/apache/camel-k/version" + "github.com/apache/camel-k/pkg/util/defaults" ) // ComputeForIntegration a digest of the fields that are relevant for the deployment @@ -32,7 +32,7 @@ import ( func ComputeForIntegration(integration *v1alpha1.Integration) (string, error) { hash := sha256.New() // Operator version is relevant - if _, err := hash.Write([]byte(version.Version)); err != nil { + if _, err := hash.Write([]byte(defaults.Version)); err != nil { return "", err } // Integration Context is relevant @@ -80,7 +80,7 @@ func ComputeForIntegration(integration *v1alpha1.Integration) (string, error) { func ComputeForIntegrationContext(context *v1alpha1.IntegrationContext) (string, error) { hash := sha256.New() // Operator version is relevant - if _, err := hash.Write([]byte(version.Version)); err != nil { + if _, err := hash.Write([]byte(defaults.Version)); err != nil { return "", err } diff --git a/pkg/util/test/catalog.go b/pkg/util/test/catalog.go index 2482e1c..110fe31 100644 --- a/pkg/util/test/catalog.go +++ b/pkg/util/test/catalog.go @@ -43,5 +43,5 @@ func DefaultCatalog() (*camel.RuntimeCatalog, error) { } } - return camel.FindBestMatch(defaults.CamelVersion, catalogs) + return camel.FindBestMatch(defaults.CamelVersionConstraint, catalogs) } diff --git a/pkg/util/test/catalog_test.go b/pkg/util/test/catalog_test.go index 38a2cf2..aae53c4 100644 --- a/pkg/util/test/catalog_test.go +++ b/pkg/util/test/catalog_test.go @@ -20,8 +20,6 @@ package test import ( "testing" - "github.com/apache/camel-k/pkg/util/defaults" - "github.com/stretchr/testify/assert" ) @@ -35,7 +33,6 @@ func TestRuntimeContainsEmbeddedArtifacts(t *testing.T) { assert.Equal(t, 1, len(artifact.Schemes)) assert.Equal(t, "org.apache.camel.k", artifact.GroupID) assert.Equal(t, "camel-knative", artifact.ArtifactID) - assert.Equal(t, defaults.RuntimeVersion, artifact.Version) scheme, found := catalog.GetScheme("knative") assert.True(t, found) diff --git a/runtime b/runtime deleted file mode 160000 index a9f6a69..0000000 --- a/runtime +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a9f6a69d444cb9732db0076acdb1167e9e73755a diff --git a/script/Makefile b/script/Makefile index c5aaef8..67adaef 100644 --- a/script/Makefile +++ b/script/Makefile @@ -1,8 +1,55 @@ -build: build-runtime build-operator build-kamel build-publisher build-compile-integration-tests test +VERSIONFILE := pkg/util/defaults/defaults.go +VERSION := 0.3.0-SNAPSHOT +RUNTIME_VERSION := 0.2.1 +CAMEL_VERSION := 2.23.1 +CAMEL_VERSION_CONSTRAINT := ~2.23.x +BASE_IMAGE := fabric8/s2i-java:3.0-java8 +LOCAL_REPOSITORY := /tmp/artifacts/m2 +IMAGE_NAME := docker.io/apache/camel-k +RELEASE_GIT_REMOTE := upstream + +default: test + +# +# Generates the version file +# +codegen: + @echo "package defaults" > $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) + @echo "// ***********************" >> $(VERSIONFILE) + @echo "// DO NOT EDIT THIS FILE" >> $(VERSIONFILE) + @echo "// ***********************" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) + @echo "const (" >> $(VERSIONFILE) + @echo " // Version -- " >> $(VERSIONFILE) + @echo " Version = \"$(VERSION)\"" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) + @echo " // CamelVersionConstraint -- " >> $(VERSIONFILE) + @echo " CamelVersionConstraint = \"$(CAMEL_VERSION_CONSTRAINT)\"" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) + @echo " // RuntimeVersion -- " >> $(VERSIONFILE) + @echo " RuntimeVersion = \"$(RUNTIME_VERSION)\"" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) + @echo " // BaseImage -- " >> $(VERSIONFILE) + @echo " BaseImage = \"$(BASE_IMAGE)\"" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) + @echo " // LocalRepository -- " >> $(VERSIONFILE) + @echo " LocalRepository = \"$(LOCAL_REPOSITORY)\"" >> $(VERSIONFILE) + @echo ")" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) -build-go: build-embed-resources build-operator build-kamel build-publisher +generate: + operator-sdk generate k8s + +build: build-operator build-kamel build-publisher build-compile-integration-tests + +test: build + go test ./... + +test-integration: build + go test ./... -tags=integration -build-operator: build-embed-resources +build-operator: go build -o camel-k ./cmd/manager/*.go build-kamel: @@ -11,82 +58,68 @@ build-kamel: build-publisher: go build -o publisher ./cmd/util/publisher/*.go -build-embed-resources: - ./script/build_catalog.sh - ./script/build_catalog.sh 2.23.0 +build-resources: + ./script/build_catalog.sh $(CAMEL_VERSION) $(RUNTIME_VERSION) + ./script/build_catalog.sh 2.23.0 $(RUNTIME_VERSION) ./script/embed_resources.sh deploy - mkdir -p ./assets/json-schema go run cmd/util/json-schema-gen/jsonschemagen.go --out=./assets/json-schema build-compile-integration-tests: go test -c -tags=integration ./test/*.go -build-runtime: - ./mvnw clean install -B -f ./runtime/pom.xml +clean: + go clean + rm -f camel-k + rm -f kamel + rm -f publisher + rm -rf build/_maven_output + rm -rf build/_output + rm -rf camel-k-client-*.tar.gz + rm -rf camel-k-examples-*.tar.gz -push-runtime-snapshot: - ./mvnw deploy -B -f ./runtime/pom.xml +version: + @echo $(VERSION) -release: clean prepare-release build images-build images-push cross-compile package-examples git-tag publish-base-images +dep: + dep ensure -v -prepare-release: - ./script/prepare_release.sh +lint: + golangci-lint run -new-version: increment-snapshot build images-build images-push +images: test + mkdir -p build/_maven_output + operator-sdk build $(IMAGE_NAME):$(VERSION) -increment-snapshot: - ./script/next_snapshot.sh +images-dev: test package-artifacts + mkdir -p build/_maven_output + operator-sdk build $(IMAGE_NAME):$(VERSION) -cross-compile: - ./script/cross_compile.sh +images-push: + docker push $(IMAGE_NAME):$(VERSION) -package-examples: - ./script/package_examples.sh +set-version: + ./script/set_version.sh $(VERSION) git-tag: - ./script/git_tag.sh + ./script/git_tag.sh $(VERSION) $(RELEASE_GIT_REMOTE) -publish-base-images: - ./script/publish_base_images.sh - -dep: - dep ensure -v - -generate: - operator-sdk generate k8s +cross-compile: + ./script/cross_compile.sh $(VERSION) -clean: - ./mvnw clean -f ./runtime/pom.xml - go clean - rm -f camel-k - rm -f kamel - rm -rf build/_maven_output - rm -rf build/_output +package-examples: + ./script/package_examples.sh $(VERSION) -images: images-build +package-artifacts: + ./script/package_maven_artifacts.sh $(RUNTIME_VERSION) -images-build: - ./script/images_build.sh $(imgDestination) +publish-base-images: + go run cmd/util/publisher/publisher.go --runtime-version=$(RUNTIME_VERSION) -images-push: - ./script/images_push.sh $(imgDestination) +release: clean build images images-push cross-compile package-examples git-tag -install: install-minishift install-minishift: ./script/install_minishift.sh - install-minikube: ./script/install_minikube.sh -test: check -check: - go test ./... - -test-integration: check-integration -check-integration: - go test ./... -tags=integration - -lint: - golangci-lint run - -.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 +.PHONY: build build-operator build-kamel build-resources dep codegen images images-dec images-push test check test-integration clean release cross-compile package-examples set-version git-tag publish-base-images diff --git a/script/build_catalog.sh b/script/build_catalog.sh index dd42c64..492befa 100755 --- a/script/build_catalog.sh +++ b/script/build_catalog.sh @@ -3,22 +3,13 @@ location=$(dirname $0) rootdir=$location/../ -version=$($location/get_version.sh) - -if [ "$#" -eq 0 ]; then - echo "build default catalog" - ./mvnw -q -f runtime/pom.xml \ - -N \ - -Pcatalog \ - -Dcatalog.path=${rootdir}/deploy -else - for ver in "$@" - do - echo "build catalog for version $ver" - ./mvnw -q -f runtime/pom.xml \ - -N \ - -Pcatalog \ - -Dcatalog.version=$ver \ - -Dcatalog.path=${rootdir}/deploy - done +if [ "$#" -ne 2 ]; then + echo "usage: $0 catalog.version runtime.version" + exit 1 fi + +$rootdir/mvnw -q \ + -f ${rootdir}/build/maven/pom-catalog.xml \ + -Dcatalog.path=${rootdir}/deploy \ + -Dcatalog.version=$1 \ + -Druntime.version=$2 \ No newline at end of file diff --git a/script/cross_compile.sh b/script/cross_compile.sh index b05a668..88e857d 100755 --- a/script/cross_compile.sh +++ b/script/cross_compile.sh @@ -6,7 +6,13 @@ builddir=$(realpath $location/../xtmp) rm -rf $builddir basename=camel-k-client -version=$($location/get_version.sh) + +if [ "$#" -ne 1 ]; then + echo "usage: $0 version" + exit 1 +fi + +version=$1 cross_compile () { label=$1 diff --git a/script/get_version.sh b/script/get_version.sh deleted file mode 100755 index 1357527..0000000 --- a/script/get_version.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -location=$(dirname $0) -cat $location/../version/version.go | grep "Version" | grep "=" | awk '{print $NF}' | tr -d '"' \ No newline at end of file diff --git a/script/git_tag.sh b/script/git_tag.sh index 3e5fc51..c69054a 100755 --- a/script/git_tag.sh +++ b/script/git_tag.sh @@ -2,14 +2,20 @@ set -e +if [ "$#" -ne 2 ]; then + echo "usage: $0 version branch" + exit 1 +fi + location=$(dirname $0) -version=$($location/get_version.sh) +target_version=$1 +target_branch=$2 -git branch -D staging-$version || true -git checkout -b staging-$version +git branch -D staging-${target_version} || true +git checkout -b staging-${target_version} git add * || true -git commit -a -m "Release $version" -git tag --force $version staging-$version -git push --force upstream $version +git commit -a -m "Release ${target_version}" +git tag --force ${target_version} staging-${target_version} +git push --force ${target_branch} ${target_version} -echo "Tag $version pushed upstream" +echo "Tag ${target_version} pushed ${target_branch}" diff --git a/script/images_build.sh b/script/images_build.sh deleted file mode 100755 index 969151a..0000000 --- a/script/images_build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -location=$(dirname $0) -version=$($location/get_version.sh) - -$location/package_maven_artifacts.sh && operator-sdk build ${imgDestination:-'docker.io/apache/camel-k'}:$version \ No newline at end of file diff --git a/script/images_push.sh b/script/images_push.sh index 94d9654..0e1068e 100755 --- a/script/images_push.sh +++ b/script/images_push.sh @@ -1,6 +1,11 @@ #!/bin/sh location=$(dirname $0) -version=$($location/get_version.sh) -docker push ${imgDestination:-'docker.io/apache/camel-k'}:$version \ No newline at end of file +if [ "$#" -ne 2 ]; then + echo "usage: $0 version" + exit 1 +fi + + +docker push ${imgDestination:-'docker.io/apache/camel-k'}:$1 \ No newline at end of file diff --git a/script/install_minikube.sh b/script/install_minikube.sh index cc6a159..6c75bef 100755 --- a/script/install_minikube.sh +++ b/script/install_minikube.sh @@ -3,8 +3,6 @@ # Exit on error set -e -# Compile and build images -make eval $(minikube docker-env) make images diff --git a/script/install_minishift.sh b/script/install_minishift.sh index 52829e4..1959dde 100755 --- a/script/install_minishift.sh +++ b/script/install_minishift.sh @@ -9,8 +9,6 @@ else oc new-project $project 2>/dev/null || true fi -# Compile and build images -make eval $(minishift docker-env) make images diff --git a/script/package_examples.sh b/script/package_examples.sh index adef3dd..0a50863 100755 --- a/script/package_examples.sh +++ b/script/package_examples.sh @@ -3,6 +3,11 @@ location=$(dirname $0) rootdir=$(realpath $location/../) -version=$($location/get_version.sh) +if [ "$#" -ne 1 ]; then + echo "usage: $0 version" + exit 1 +fi + +version=$1 tar -zcvf $rootdir/camel-k-examples-$version.tar.gz examples diff --git a/script/package_maven_artifacts.sh b/script/package_maven_artifacts.sh index 8426521..ed63664 100755 --- a/script/package_maven_artifacts.sh +++ b/script/package_maven_artifacts.sh @@ -1,5 +1,16 @@ #!/bin/sh location=$(dirname $0) -cd $location/../ -./mvnw clean install --batch-mode -DskipTests -f runtime/pom.xml -s build/maven/settings.xml + +if [ "$#" -ne 1 ]; then + echo "usage: $0 version" + exit 1 +fi + +cd ${location}/.. + +./mvnw \ + -f build/maven/pom-runtime.xml \ + -DoutputDirectory=$PWD/build/_maven_output \ + -Druntime.version=$1 \ + dependency:copy-dependencies \ No newline at end of file diff --git a/script/publish_base_images.sh b/script/publish_base_images.sh index 4915dee..8bd9bd8 100755 --- a/script/publish_base_images.sh +++ b/script/publish_base_images.sh @@ -5,8 +5,13 @@ set -e location=$(dirname $0) rootdir=$(realpath $location/../) -echo "Start publishing base images" +if [ "$#" -ne 1 ]; then + echo "usage: $0 runtime-version" + exit 1 +fi -$rootdir/publisher +echo "Start publishing base images with runtime $1" + +$rootdir/publisher --runtime-version=$1 "" echo "All base images have been published" diff --git a/script/set_version.sh b/script/set_version.sh index 2f0ca0b..c96d76c 100755 --- a/script/set_version.sh +++ b/script/set_version.sh @@ -2,18 +2,17 @@ set -e -location=$(dirname $0) -new_version=$1 - -global_version_file=$location/../version/version.go -version=$($location/get_version.sh) +if [ "$#" -ne 1 ]; then + echo "usage: $0 version" + exit 1 +fi -# Set the new global version -sed -i "s/$version/$new_version/g" $global_version_file -find $location/../deploy -type f -exec sed -i "s/$version/$new_version/g" {} \; - -# Updating the Java modules -./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$new_version -f $location/../runtime +location=$(dirname $0) +version=$1 -echo "Camel K version set to: $new_version" +for f in $(find $location/../deploy -type f -name "*.yaml"); +do + sed -i -r "s/docker.io\/apache\/camel-k:([0-9]+[a-zA-Z0-9\-\.].*).*/docker.io\/apache\/camel-k:${version}/" $f +done +echo "Camel K version set to: $version" diff --git a/script/travis_build.sh b/script/travis_build.sh index 797294b..042a7f2 100755 --- a/script/travis_build.sh +++ b/script/travis_build.sh @@ -51,14 +51,14 @@ echo "openshift is deployed and reachable" oc describe nodes echo "Adding maven artifacts to the image context" -./script/package_maven_artifacts.sh +make package-artifacts echo "Copying binary file to docker dir" mkdir -p ./build/_output/bin cp ./camel-k ./build/_output/bin/ echo "Building the images" -export IMAGE=docker.io/apache/camel-k:$(./script/get_version.sh) +export IMAGE=docker.io/apache/camel-k:$(make version) docker build -t "${IMAGE}" -f build/Dockerfile . echo "installing camel k cluster resources" @@ -66,6 +66,5 @@ echo "installing camel k cluster resources" oc login -u developer - # Then run integration tests make test-integration diff --git a/version/version.go b/version/version.go deleted file mode 100644 index 9a73247..0000000 --- a/version/version.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You 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 version - -// Do not change this file manually - -const ( - // Version is the global Camel K Version - Version = "0.3.0-SNAPSHOT" -)