You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2018/11/15 18:37:32 UTC
[camel-k] branch master updated: new builder engine
This is an automated email from the ASF dual-hosted git repository.
nferraro 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 84985a9 new builder engine
84985a9 is described below
commit 84985a9be3774504cbc354a40c81b54f70d1596f
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Nov 14 16:19:52 2018 +0100
new builder engine
---
deploy/resources.go | 484 ++++++++++-----------
pkg/apis/camel/v1alpha1/types.go | 6 +
pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go | 16 +
pkg/build/assemble/maven_assembler.go | 173 --------
pkg/build/assemble/maven_assembler_test.go | 82 ----
pkg/build/build_manager.go | 156 -------
pkg/build/build_types.go | 105 -----
pkg/build/packager/base.go | 177 --------
pkg/build/packager/factory.go | 49 ---
pkg/build/packager/incremental.go | 106 -----
pkg/build/publish/kaniko_publisher.go | 225 ----------
pkg/builder/builder.go | 202 +++++++++
pkg/builder/builder_steps.go | 296 +++++++++++++
pkg/builder/builder_types.go | 137 ++++++
.../packager/doc.go => builder/builder_utils.go} | 13 +-
.../publish/doc.go => builder/kaniko/kaniko.go} | 15 +-
pkg/builder/kaniko/publisher.go | 120 +++++
.../s2i_publisher.go => builder/s2i/publisher.go} | 128 ++----
.../packager/types.go => builder/s2i/s2i.go} | 17 +-
pkg/platform/build.go | 91 ++--
pkg/platform/get.go | 13 +-
pkg/stub/action/context/build.go | 47 +-
pkg/util/maven/maven.go | 125 ++----
pkg/util/maven/maven_test.go | 2 +-
pkg/{build/assemble/doc.go => util/tar/extract.go} | 44 +-
pkg/util/util.go | 26 ++
test/build_manager_integration_test.go | 78 ++--
27 files changed, 1292 insertions(+), 1641 deletions(-)
diff --git a/deploy/resources.go b/deploy/resources.go
index 58bfc75..72a4f7c 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -46,7 +46,7 @@ artifacts:
camel-ahc:
groupId: org.apache.camel
artifactId: camel-ahc
- version: 2.22.1
+ version: 2.22.2
schemes:
- ahc
languages: []
@@ -54,7 +54,7 @@ artifacts:
camel-ahc-ws:
groupId: org.apache.camel
artifactId: camel-ahc-ws
- version: 2.22.1
+ version: 2.22.2
schemes:
- ahc-ws
- ahc-wss
@@ -63,7 +63,7 @@ artifacts:
camel-amqp:
groupId: org.apache.camel
artifactId: camel-amqp
- version: 2.22.1
+ version: 2.22.2
schemes:
- amqp
languages: []
@@ -71,7 +71,7 @@ artifacts:
camel-apns:
groupId: org.apache.camel
artifactId: camel-apns
- version: 2.22.1
+ version: 2.22.2
schemes:
- apns
languages: []
@@ -79,7 +79,7 @@ artifacts:
camel-as2:
groupId: org.apache.camel
artifactId: camel-as2
- version: 2.22.1
+ version: 2.22.2
schemes:
- as2
languages: []
@@ -87,7 +87,7 @@ artifacts:
camel-asterisk:
groupId: org.apache.camel
artifactId: camel-asterisk
- version: 2.22.1
+ version: 2.22.2
schemes:
- asterisk
languages: []
@@ -95,7 +95,7 @@ artifacts:
camel-atmos:
groupId: org.apache.camel
artifactId: camel-atmos
- version: 2.22.1
+ version: 2.22.2
schemes:
- atmos
languages: []
@@ -103,7 +103,7 @@ artifacts:
camel-atmosphere-websocket:
groupId: org.apache.camel
artifactId: camel-atmosphere-websocket
- version: 2.22.1
+ version: 2.22.2
schemes:
- atmosphere-websocket
languages: []
@@ -111,7 +111,7 @@ artifacts:
camel-atom:
groupId: org.apache.camel
artifactId: camel-atom
- version: 2.22.1
+ version: 2.22.2
schemes:
- atom
languages: []
@@ -119,7 +119,7 @@ artifacts:
camel-atomix:
groupId: org.apache.camel
artifactId: camel-atomix
- version: 2.22.1
+ version: 2.22.2
schemes:
- atomix-map
- atomix-messaging
@@ -132,7 +132,7 @@ artifacts:
camel-avro:
groupId: org.apache.camel
artifactId: camel-avro
- version: 2.22.1
+ version: 2.22.2
schemes:
- avro
languages: []
@@ -141,7 +141,7 @@ artifacts:
camel-aws:
groupId: org.apache.camel
artifactId: camel-aws
- version: 2.22.1
+ version: 2.22.2
schemes:
- aws-cw
- aws-ddb
@@ -163,7 +163,7 @@ artifacts:
camel-azure:
groupId: org.apache.camel
artifactId: camel-azure
- version: 2.22.1
+ version: 2.22.2
schemes:
- azure-blob
- azure-queue
@@ -172,7 +172,7 @@ artifacts:
camel-core:
groupId: org.apache.camel
artifactId: camel-core
- version: 2.22.1
+ version: 2.22.2
schemes:
- bean
- binding
@@ -219,7 +219,7 @@ artifacts:
camel-bean-validator:
groupId: org.apache.camel
artifactId: camel-bean-validator
- version: 2.22.1
+ version: 2.22.2
schemes:
- bean-validator
languages: []
@@ -227,7 +227,7 @@ artifacts:
camel-beanstalk:
groupId: org.apache.camel
artifactId: camel-beanstalk
- version: 2.22.1
+ version: 2.22.2
schemes:
- beanstalk
languages: []
@@ -235,7 +235,7 @@ artifacts:
camel-bonita:
groupId: org.apache.camel
artifactId: camel-bonita
- version: 2.22.1
+ version: 2.22.2
schemes:
- bonita
languages: []
@@ -243,7 +243,7 @@ artifacts:
camel-box:
groupId: org.apache.camel
artifactId: camel-box
- version: 2.22.1
+ version: 2.22.2
schemes:
- box
languages: []
@@ -251,7 +251,7 @@ artifacts:
camel-braintree:
groupId: org.apache.camel
artifactId: camel-braintree
- version: 2.22.1
+ version: 2.22.2
schemes:
- braintree
languages: []
@@ -259,7 +259,7 @@ artifacts:
camel-cache:
groupId: org.apache.camel
artifactId: camel-cache
- version: 2.22.1
+ version: 2.22.2
schemes:
- cache
languages: []
@@ -267,7 +267,7 @@ artifacts:
camel-caffeine:
groupId: org.apache.camel
artifactId: camel-caffeine
- version: 2.22.1
+ version: 2.22.2
schemes:
- caffeine-cache
- caffeine-loadcache
@@ -276,7 +276,7 @@ artifacts:
camel-chronicle:
groupId: org.apache.camel
artifactId: camel-chronicle
- version: 2.22.1
+ version: 2.22.2
schemes:
- chronicle-engine
languages: []
@@ -284,7 +284,7 @@ artifacts:
camel-chunk:
groupId: org.apache.camel
artifactId: camel-chunk
- version: 2.22.1
+ version: 2.22.2
schemes:
- chunk
languages: []
@@ -292,7 +292,7 @@ artifacts:
camel-cm-sms:
groupId: org.apache.camel
artifactId: camel-cm-sms
- version: 2.22.1
+ version: 2.22.2
schemes:
- cm-sms
languages: []
@@ -300,7 +300,7 @@ artifacts:
camel-cmis:
groupId: org.apache.camel
artifactId: camel-cmis
- version: 2.22.1
+ version: 2.22.2
schemes:
- cmis
languages: []
@@ -308,7 +308,7 @@ artifacts:
camel-coap:
groupId: org.apache.camel
artifactId: camel-coap
- version: 2.22.1
+ version: 2.22.2
schemes:
- coap
languages: []
@@ -316,7 +316,7 @@ artifacts:
camel-cometd:
groupId: org.apache.camel
artifactId: camel-cometd
- version: 2.22.1
+ version: 2.22.2
schemes:
- cometd
- cometds
@@ -325,7 +325,7 @@ artifacts:
camel-consul:
groupId: org.apache.camel
artifactId: camel-consul
- version: 2.22.1
+ version: 2.22.2
schemes:
- consul
languages: []
@@ -333,7 +333,7 @@ artifacts:
camel-context:
groupId: org.apache.camel
artifactId: camel-context
- version: 2.22.1
+ version: 2.22.2
schemes:
- context
languages: []
@@ -341,7 +341,7 @@ artifacts:
camel-couchbase:
groupId: org.apache.camel
artifactId: camel-couchbase
- version: 2.22.1
+ version: 2.22.2
schemes:
- couchbase
languages: []
@@ -349,7 +349,7 @@ artifacts:
camel-couchdb:
groupId: org.apache.camel
artifactId: camel-couchdb
- version: 2.22.1
+ version: 2.22.2
schemes:
- couchdb
languages: []
@@ -357,7 +357,7 @@ artifacts:
camel-cassandraql:
groupId: org.apache.camel
artifactId: camel-cassandraql
- version: 2.22.1
+ version: 2.22.2
schemes:
- cql
languages: []
@@ -365,7 +365,7 @@ artifacts:
camel-crypto:
groupId: org.apache.camel
artifactId: camel-crypto
- version: 2.22.1
+ version: 2.22.2
schemes:
- crypto
languages: []
@@ -375,7 +375,7 @@ artifacts:
camel-crypto-cms:
groupId: org.apache.camel
artifactId: camel-crypto-cms
- version: 2.22.1
+ version: 2.22.2
schemes:
- crypto-cms
languages: []
@@ -383,7 +383,7 @@ artifacts:
camel-cxf:
groupId: org.apache.camel
artifactId: camel-cxf
- version: 2.22.1
+ version: 2.22.2
schemes:
- cxf
- cxfrs
@@ -392,7 +392,7 @@ artifacts:
camel-digitalocean:
groupId: org.apache.camel
artifactId: camel-digitalocean
- version: 2.22.1
+ version: 2.22.2
schemes:
- digitalocean
languages: []
@@ -400,7 +400,7 @@ artifacts:
camel-disruptor:
groupId: org.apache.camel
artifactId: camel-disruptor
- version: 2.22.1
+ version: 2.22.2
schemes:
- disruptor
- disruptor-vm
@@ -409,7 +409,7 @@ artifacts:
camel-dns:
groupId: org.apache.camel
artifactId: camel-dns
- version: 2.22.1
+ version: 2.22.2
schemes:
- dns
languages: []
@@ -417,7 +417,7 @@ artifacts:
camel-docker:
groupId: org.apache.camel
artifactId: camel-docker
- version: 2.22.1
+ version: 2.22.2
schemes:
- docker
languages: []
@@ -425,7 +425,7 @@ artifacts:
camel-dozer:
groupId: org.apache.camel
artifactId: camel-dozer
- version: 2.22.1
+ version: 2.22.2
schemes:
- dozer
languages: []
@@ -433,7 +433,7 @@ artifacts:
camel-drill:
groupId: org.apache.camel
artifactId: camel-drill
- version: 2.22.1
+ version: 2.22.2
schemes:
- drill
languages: []
@@ -441,7 +441,7 @@ artifacts:
camel-dropbox:
groupId: org.apache.camel
artifactId: camel-dropbox
- version: 2.22.1
+ version: 2.22.2
schemes:
- dropbox
languages: []
@@ -449,7 +449,7 @@ artifacts:
camel-ehcache:
groupId: org.apache.camel
artifactId: camel-ehcache
- version: 2.22.1
+ version: 2.22.2
schemes:
- ehcache
languages: []
@@ -457,7 +457,7 @@ artifacts:
camel-ejb:
groupId: org.apache.camel
artifactId: camel-ejb
- version: 2.22.1
+ version: 2.22.2
schemes:
- ejb
languages: []
@@ -465,7 +465,7 @@ artifacts:
camel-elasticsearch:
groupId: org.apache.camel
artifactId: camel-elasticsearch
- version: 2.22.1
+ version: 2.22.2
schemes:
- elasticsearch
languages: []
@@ -473,7 +473,7 @@ artifacts:
camel-elasticsearch-rest:
groupId: org.apache.camel
artifactId: camel-elasticsearch-rest
- version: 2.22.1
+ version: 2.22.2
schemes:
- elasticsearch-rest
languages: []
@@ -481,7 +481,7 @@ artifacts:
camel-elasticsearch5:
groupId: org.apache.camel
artifactId: camel-elasticsearch5
- version: 2.22.1
+ version: 2.22.2
schemes:
- elasticsearch5
languages: []
@@ -489,7 +489,7 @@ artifacts:
camel-elsql:
groupId: org.apache.camel
artifactId: camel-elsql
- version: 2.22.1
+ version: 2.22.2
schemes:
- elsql
languages: []
@@ -497,7 +497,7 @@ artifacts:
camel-etcd:
groupId: org.apache.camel
artifactId: camel-etcd
- version: 2.22.1
+ version: 2.22.2
schemes:
- etcd
languages: []
@@ -505,7 +505,7 @@ artifacts:
camel-eventadmin:
groupId: org.apache.camel
artifactId: camel-eventadmin
- version: 2.22.1
+ version: 2.22.2
schemes:
- eventadmin
languages: []
@@ -513,7 +513,7 @@ artifacts:
camel-exec:
groupId: org.apache.camel
artifactId: camel-exec
- version: 2.22.1
+ version: 2.22.2
schemes:
- exec
languages: []
@@ -521,7 +521,7 @@ artifacts:
camel-facebook:
groupId: org.apache.camel
artifactId: camel-facebook
- version: 2.22.1
+ version: 2.22.2
schemes:
- facebook
languages: []
@@ -529,7 +529,7 @@ artifacts:
camel-flatpack:
groupId: org.apache.camel
artifactId: camel-flatpack
- version: 2.22.1
+ version: 2.22.2
schemes:
- flatpack
languages: []
@@ -538,7 +538,7 @@ artifacts:
camel-flink:
groupId: org.apache.camel
artifactId: camel-flink
- version: 2.22.1
+ version: 2.22.2
schemes:
- flink
languages: []
@@ -546,7 +546,7 @@ artifacts:
camel-fop:
groupId: org.apache.camel
artifactId: camel-fop
- version: 2.22.1
+ version: 2.22.2
schemes:
- fop
languages: []
@@ -554,7 +554,7 @@ artifacts:
camel-freemarker:
groupId: org.apache.camel
artifactId: camel-freemarker
- version: 2.22.1
+ version: 2.22.2
schemes:
- freemarker
languages: []
@@ -562,7 +562,7 @@ artifacts:
camel-ftp:
groupId: org.apache.camel
artifactId: camel-ftp
- version: 2.22.1
+ version: 2.22.2
schemes:
- ftp
- ftps
@@ -572,7 +572,7 @@ artifacts:
camel-ganglia:
groupId: org.apache.camel
artifactId: camel-ganglia
- version: 2.22.1
+ version: 2.22.2
schemes:
- ganglia
languages: []
@@ -580,7 +580,7 @@ artifacts:
camel-geocoder:
groupId: org.apache.camel
artifactId: camel-geocoder
- version: 2.22.1
+ version: 2.22.2
schemes:
- geocoder
languages: []
@@ -588,7 +588,7 @@ artifacts:
camel-git:
groupId: org.apache.camel
artifactId: camel-git
- version: 2.22.1
+ version: 2.22.2
schemes:
- git
languages: []
@@ -596,7 +596,7 @@ artifacts:
camel-github:
groupId: org.apache.camel
artifactId: camel-github
- version: 2.22.1
+ version: 2.22.2
schemes:
- github
languages: []
@@ -604,7 +604,7 @@ artifacts:
camel-google-bigquery:
groupId: org.apache.camel
artifactId: camel-google-bigquery
- version: 2.22.1
+ version: 2.22.2
schemes:
- google-bigquery
languages: []
@@ -612,7 +612,7 @@ artifacts:
camel-google-calendar:
groupId: org.apache.camel
artifactId: camel-google-calendar
- version: 2.22.1
+ version: 2.22.2
schemes:
- google-calendar
languages: []
@@ -620,7 +620,7 @@ artifacts:
camel-google-drive:
groupId: org.apache.camel
artifactId: camel-google-drive
- version: 2.22.1
+ version: 2.22.2
schemes:
- google-drive
languages: []
@@ -628,7 +628,7 @@ artifacts:
camel-google-mail:
groupId: org.apache.camel
artifactId: camel-google-mail
- version: 2.22.1
+ version: 2.22.2
schemes:
- google-mail
- google-mail-stream
@@ -637,7 +637,7 @@ artifacts:
camel-google-pubsub:
groupId: org.apache.camel
artifactId: camel-google-pubsub
- version: 2.22.1
+ version: 2.22.2
schemes:
- google-pubsub
languages: []
@@ -645,7 +645,7 @@ artifacts:
camel-gora:
groupId: org.apache.camel
artifactId: camel-gora
- version: 2.22.1
+ version: 2.22.2
schemes:
- gora
languages: []
@@ -653,7 +653,7 @@ artifacts:
camel-grape:
groupId: org.apache.camel
artifactId: camel-grape
- version: 2.22.1
+ version: 2.22.2
schemes:
- grape
languages: []
@@ -661,7 +661,7 @@ artifacts:
camel-grpc:
groupId: org.apache.camel
artifactId: camel-grpc
- version: 2.22.1
+ version: 2.22.2
schemes:
- grpc
languages: []
@@ -669,7 +669,7 @@ artifacts:
camel-guava-eventbus:
groupId: org.apache.camel
artifactId: camel-guava-eventbus
- version: 2.22.1
+ version: 2.22.2
schemes:
- guava-eventbus
languages: []
@@ -677,7 +677,7 @@ artifacts:
camel-hazelcast:
groupId: org.apache.camel
artifactId: camel-hazelcast
- version: 2.22.1
+ version: 2.22.2
schemes:
- hazelcast-atomicvalue
- hazelcast-instance
@@ -695,7 +695,7 @@ artifacts:
camel-hbase:
groupId: org.apache.camel
artifactId: camel-hbase
- version: 2.22.1
+ version: 2.22.2
schemes:
- hbase
languages: []
@@ -703,7 +703,7 @@ artifacts:
camel-hdfs:
groupId: org.apache.camel
artifactId: camel-hdfs
- version: 2.22.1
+ version: 2.22.2
schemes:
- hdfs
languages: []
@@ -711,7 +711,7 @@ artifacts:
camel-hdfs2:
groupId: org.apache.camel
artifactId: camel-hdfs2
- version: 2.22.1
+ version: 2.22.2
schemes:
- hdfs2
languages: []
@@ -719,7 +719,7 @@ artifacts:
camel-hipchat:
groupId: org.apache.camel
artifactId: camel-hipchat
- version: 2.22.1
+ version: 2.22.2
schemes:
- hipchat
languages: []
@@ -727,7 +727,7 @@ artifacts:
camel-http:
groupId: org.apache.camel
artifactId: camel-http
- version: 2.22.1
+ version: 2.22.2
schemes:
- http
- https
@@ -736,7 +736,7 @@ artifacts:
camel-http4:
groupId: org.apache.camel
artifactId: camel-http4
- version: 2.22.1
+ version: 2.22.2
schemes:
- http4
- https4
@@ -745,7 +745,7 @@ artifacts:
camel-ibatis:
groupId: org.apache.camel
artifactId: camel-ibatis
- version: 2.22.1
+ version: 2.22.2
schemes:
- ibatis
languages: []
@@ -753,7 +753,7 @@ artifacts:
camel-iec60870:
groupId: org.apache.camel
artifactId: camel-iec60870
- version: 2.22.1
+ version: 2.22.2
schemes:
- iec60870-client
- iec60870-server
@@ -762,7 +762,7 @@ artifacts:
camel-ignite:
groupId: org.apache.camel
artifactId: camel-ignite
- version: 2.22.1
+ version: 2.22.2
schemes:
- ignite-cache
- ignite-compute
@@ -776,7 +776,7 @@ artifacts:
camel-mail:
groupId: org.apache.camel
artifactId: camel-mail
- version: 2.22.1
+ version: 2.22.2
schemes:
- imap
- imaps
@@ -790,7 +790,7 @@ artifacts:
camel-infinispan:
groupId: org.apache.camel
artifactId: camel-infinispan
- version: 2.22.1
+ version: 2.22.2
schemes:
- infinispan
languages: []
@@ -798,7 +798,7 @@ artifacts:
camel-influxdb:
groupId: org.apache.camel
artifactId: camel-influxdb
- version: 2.22.1
+ version: 2.22.2
schemes:
- influxdb
languages: []
@@ -806,7 +806,7 @@ artifacts:
camel-irc:
groupId: org.apache.camel
artifactId: camel-irc
- version: 2.22.1
+ version: 2.22.2
schemes:
- irc
languages: []
@@ -814,7 +814,7 @@ artifacts:
camel-ironmq:
groupId: org.apache.camel
artifactId: camel-ironmq
- version: 2.22.1
+ version: 2.22.2
schemes:
- ironmq
languages: []
@@ -822,7 +822,7 @@ artifacts:
camel-javaspace:
groupId: org.apache.camel
artifactId: camel-javaspace
- version: 2.22.1
+ version: 2.22.2
schemes:
- javaspace
languages: []
@@ -830,7 +830,7 @@ artifacts:
camel-jbpm:
groupId: org.apache.camel
artifactId: camel-jbpm
- version: 2.22.1
+ version: 2.22.2
schemes:
- jbpm
languages: []
@@ -838,7 +838,7 @@ artifacts:
camel-jcache:
groupId: org.apache.camel
artifactId: camel-jcache
- version: 2.22.1
+ version: 2.22.2
schemes:
- jcache
languages: []
@@ -846,7 +846,7 @@ artifacts:
camel-jclouds:
groupId: org.apache.camel
artifactId: camel-jclouds
- version: 2.22.1
+ version: 2.22.2
schemes:
- jclouds
languages: []
@@ -854,7 +854,7 @@ artifacts:
camel-jcr:
groupId: org.apache.camel
artifactId: camel-jcr
- version: 2.22.1
+ version: 2.22.2
schemes:
- jcr
languages: []
@@ -862,7 +862,7 @@ artifacts:
camel-jdbc:
groupId: org.apache.camel
artifactId: camel-jdbc
- version: 2.22.1
+ version: 2.22.2
schemes:
- jdbc
languages: []
@@ -870,7 +870,7 @@ artifacts:
camel-jetty9:
groupId: org.apache.camel
artifactId: camel-jetty9
- version: 2.22.1
+ version: 2.22.2
schemes:
- jetty
languages: []
@@ -878,7 +878,7 @@ artifacts:
camel-jgroups:
groupId: org.apache.camel
artifactId: camel-jgroups
- version: 2.22.1
+ version: 2.22.2
schemes:
- jgroups
languages: []
@@ -886,7 +886,7 @@ artifacts:
camel-jing:
groupId: org.apache.camel
artifactId: camel-jing
- version: 2.22.1
+ version: 2.22.2
schemes:
- jing
languages: []
@@ -894,7 +894,7 @@ artifacts:
camel-jira:
groupId: org.apache.camel
artifactId: camel-jira
- version: 2.22.1
+ version: 2.22.2
schemes:
- jira
languages: []
@@ -902,7 +902,7 @@ artifacts:
camel-jms:
groupId: org.apache.camel
artifactId: camel-jms
- version: 2.22.1
+ version: 2.22.2
schemes:
- jms
languages: []
@@ -910,7 +910,7 @@ artifacts:
camel-jmx:
groupId: org.apache.camel
artifactId: camel-jmx
- version: 2.22.1
+ version: 2.22.2
schemes:
- jmx
languages: []
@@ -918,7 +918,7 @@ artifacts:
camel-jolt:
groupId: org.apache.camel
artifactId: camel-jolt
- version: 2.22.1
+ version: 2.22.2
schemes:
- jolt
languages: []
@@ -926,7 +926,7 @@ artifacts:
camel-jpa:
groupId: org.apache.camel
artifactId: camel-jpa
- version: 2.22.1
+ version: 2.22.2
schemes:
- jpa
languages: []
@@ -934,7 +934,7 @@ artifacts:
camel-json-validator:
groupId: org.apache.camel
artifactId: camel-json-validator
- version: 2.22.1
+ version: 2.22.2
schemes:
- json-validator
languages: []
@@ -942,7 +942,7 @@ artifacts:
camel-jt400:
groupId: org.apache.camel
artifactId: camel-jt400
- version: 2.22.1
+ version: 2.22.2
schemes:
- jt400
languages: []
@@ -950,7 +950,7 @@ artifacts:
camel-kafka:
groupId: org.apache.camel
artifactId: camel-kafka
- version: 2.22.1
+ version: 2.22.2
schemes:
- kafka
languages: []
@@ -958,7 +958,7 @@ artifacts:
camel-kestrel:
groupId: org.apache.camel
artifactId: camel-kestrel
- version: 2.22.1
+ version: 2.22.2
schemes:
- kestrel
languages: []
@@ -966,7 +966,7 @@ artifacts:
camel-krati:
groupId: org.apache.camel
artifactId: camel-krati
- version: 2.22.1
+ version: 2.22.2
schemes:
- krati
languages: []
@@ -974,7 +974,7 @@ artifacts:
camel-kubernetes:
groupId: org.apache.camel
artifactId: camel-kubernetes
- version: 2.22.1
+ version: 2.22.2
schemes:
- kubernetes
- kubernetes-config-maps
@@ -996,7 +996,7 @@ artifacts:
camel-ldap:
groupId: org.apache.camel
artifactId: camel-ldap
- version: 2.22.1
+ version: 2.22.2
schemes:
- ldap
languages: []
@@ -1004,7 +1004,7 @@ artifacts:
camel-ldif:
groupId: org.apache.camel
artifactId: camel-ldif
- version: 2.22.1
+ version: 2.22.2
schemes:
- ldif
languages: []
@@ -1012,7 +1012,7 @@ artifacts:
camel-linkedin:
groupId: org.apache.camel
artifactId: camel-linkedin
- version: 2.22.1
+ version: 2.22.2
schemes:
- linkedin
languages: []
@@ -1020,7 +1020,7 @@ artifacts:
camel-printer:
groupId: org.apache.camel
artifactId: camel-printer
- version: 2.22.1
+ version: 2.22.2
schemes:
- lpr
languages: []
@@ -1028,7 +1028,7 @@ artifacts:
camel-lucene:
groupId: org.apache.camel
artifactId: camel-lucene
- version: 2.22.1
+ version: 2.22.2
schemes:
- lucene
languages: []
@@ -1036,7 +1036,7 @@ artifacts:
camel-lumberjack:
groupId: org.apache.camel
artifactId: camel-lumberjack
- version: 2.22.1
+ version: 2.22.2
schemes:
- lumberjack
languages: []
@@ -1044,7 +1044,7 @@ artifacts:
camel-master:
groupId: org.apache.camel
artifactId: camel-master
- version: 2.22.1
+ version: 2.22.2
schemes:
- master
languages: []
@@ -1052,7 +1052,7 @@ artifacts:
camel-metrics:
groupId: org.apache.camel
artifactId: camel-metrics
- version: 2.22.1
+ version: 2.22.2
schemes:
- metrics
languages: []
@@ -1060,7 +1060,7 @@ artifacts:
camel-micrometer:
groupId: org.apache.camel
artifactId: camel-micrometer
- version: 2.22.1
+ version: 2.22.2
schemes:
- micrometer
languages: []
@@ -1068,7 +1068,7 @@ artifacts:
camel-milo:
groupId: org.apache.camel
artifactId: camel-milo
- version: 2.22.1
+ version: 2.22.2
schemes:
- milo-client
- milo-server
@@ -1077,7 +1077,7 @@ artifacts:
camel-mina:
groupId: org.apache.camel
artifactId: camel-mina
- version: 2.22.1
+ version: 2.22.2
schemes:
- mina
languages: []
@@ -1085,7 +1085,7 @@ artifacts:
camel-mina2:
groupId: org.apache.camel
artifactId: camel-mina2
- version: 2.22.1
+ version: 2.22.2
schemes:
- mina2
languages: []
@@ -1093,7 +1093,7 @@ artifacts:
camel-mllp:
groupId: org.apache.camel
artifactId: camel-mllp
- version: 2.22.1
+ version: 2.22.2
schemes:
- mllp
languages: []
@@ -1101,7 +1101,7 @@ artifacts:
camel-mongodb:
groupId: org.apache.camel
artifactId: camel-mongodb
- version: 2.22.1
+ version: 2.22.2
schemes:
- mongodb
languages: []
@@ -1109,7 +1109,7 @@ artifacts:
camel-mongodb-gridfs:
groupId: org.apache.camel
artifactId: camel-mongodb-gridfs
- version: 2.22.1
+ version: 2.22.2
schemes:
- mongodb-gridfs
languages: []
@@ -1117,7 +1117,7 @@ artifacts:
camel-mongodb3:
groupId: org.apache.camel
artifactId: camel-mongodb3
- version: 2.22.1
+ version: 2.22.2
schemes:
- mongodb3
languages: []
@@ -1125,7 +1125,7 @@ artifacts:
camel-mqtt:
groupId: org.apache.camel
artifactId: camel-mqtt
- version: 2.22.1
+ version: 2.22.2
schemes:
- mqtt
languages: []
@@ -1133,7 +1133,7 @@ artifacts:
camel-msv:
groupId: org.apache.camel
artifactId: camel-msv
- version: 2.22.1
+ version: 2.22.2
schemes:
- msv
languages: []
@@ -1141,7 +1141,7 @@ artifacts:
camel-mustache:
groupId: org.apache.camel
artifactId: camel-mustache
- version: 2.22.1
+ version: 2.22.2
schemes:
- mustache
languages: []
@@ -1149,7 +1149,7 @@ artifacts:
camel-mvel:
groupId: org.apache.camel
artifactId: camel-mvel
- version: 2.22.1
+ version: 2.22.2
schemes:
- mvel
languages:
@@ -1158,7 +1158,7 @@ artifacts:
camel-mybatis:
groupId: org.apache.camel
artifactId: camel-mybatis
- version: 2.22.1
+ version: 2.22.2
schemes:
- mybatis
- mybatis-bean
@@ -1167,7 +1167,7 @@ artifacts:
camel-nagios:
groupId: org.apache.camel
artifactId: camel-nagios
- version: 2.22.1
+ version: 2.22.2
schemes:
- nagios
languages: []
@@ -1175,7 +1175,7 @@ artifacts:
camel-nats:
groupId: org.apache.camel
artifactId: camel-nats
- version: 2.22.1
+ version: 2.22.2
schemes:
- nats
languages: []
@@ -1183,7 +1183,7 @@ artifacts:
camel-netty:
groupId: org.apache.camel
artifactId: camel-netty
- version: 2.22.1
+ version: 2.22.2
schemes:
- netty
languages: []
@@ -1191,7 +1191,7 @@ artifacts:
camel-netty-http:
groupId: org.apache.camel
artifactId: camel-netty-http
- version: 2.22.1
+ version: 2.22.2
schemes:
- netty-http
languages: []
@@ -1199,7 +1199,7 @@ artifacts:
camel-netty4:
groupId: org.apache.camel
artifactId: camel-netty4
- version: 2.22.1
+ version: 2.22.2
schemes:
- netty4
languages: []
@@ -1207,7 +1207,7 @@ artifacts:
camel-netty4-http:
groupId: org.apache.camel
artifactId: camel-netty4-http
- version: 2.22.1
+ version: 2.22.2
schemes:
- netty4-http
languages: []
@@ -1215,7 +1215,7 @@ artifacts:
camel-olingo2:
groupId: org.apache.camel
artifactId: camel-olingo2
- version: 2.22.1
+ version: 2.22.2
schemes:
- olingo2
languages: []
@@ -1223,7 +1223,7 @@ artifacts:
camel-olingo4:
groupId: org.apache.camel
artifactId: camel-olingo4
- version: 2.22.1
+ version: 2.22.2
schemes:
- olingo4
languages: []
@@ -1231,7 +1231,7 @@ artifacts:
camel-openshift:
groupId: org.apache.camel
artifactId: camel-openshift
- version: 2.22.1
+ version: 2.22.2
schemes:
- openshift
languages: []
@@ -1239,7 +1239,7 @@ artifacts:
camel-openstack:
groupId: org.apache.camel
artifactId: camel-openstack
- version: 2.22.1
+ version: 2.22.2
schemes:
- openstack-cinder
- openstack-glance
@@ -1252,7 +1252,7 @@ artifacts:
camel-optaplanner:
groupId: org.apache.camel
artifactId: camel-optaplanner
- version: 2.22.1
+ version: 2.22.2
schemes:
- optaplanner
languages: []
@@ -1260,7 +1260,7 @@ artifacts:
camel-paho:
groupId: org.apache.camel
artifactId: camel-paho
- version: 2.22.1
+ version: 2.22.2
schemes:
- paho
languages: []
@@ -1268,7 +1268,7 @@ artifacts:
camel-paxlogging:
groupId: org.apache.camel
artifactId: camel-paxlogging
- version: 2.22.1
+ version: 2.22.2
schemes:
- paxlogging
languages: []
@@ -1276,7 +1276,7 @@ artifacts:
camel-pdf:
groupId: org.apache.camel
artifactId: camel-pdf
- version: 2.22.1
+ version: 2.22.2
schemes:
- pdf
languages: []
@@ -1284,7 +1284,7 @@ artifacts:
camel-pgevent:
groupId: org.apache.camel
artifactId: camel-pgevent
- version: 2.22.1
+ version: 2.22.2
schemes:
- pgevent
languages: []
@@ -1292,7 +1292,7 @@ artifacts:
camel-pubnub:
groupId: org.apache.camel
artifactId: camel-pubnub
- version: 2.22.1
+ version: 2.22.2
schemes:
- pubnub
languages: []
@@ -1300,7 +1300,7 @@ artifacts:
camel-quartz:
groupId: org.apache.camel
artifactId: camel-quartz
- version: 2.22.1
+ version: 2.22.2
schemes:
- quartz
languages: []
@@ -1308,7 +1308,7 @@ artifacts:
camel-quartz2:
groupId: org.apache.camel
artifactId: camel-quartz2
- version: 2.22.1
+ version: 2.22.2
schemes:
- quartz2
languages: []
@@ -1316,7 +1316,7 @@ artifacts:
camel-quickfix:
groupId: org.apache.camel
artifactId: camel-quickfix
- version: 2.22.1
+ version: 2.22.2
schemes:
- quickfix
languages: []
@@ -1324,7 +1324,7 @@ artifacts:
camel-rabbitmq:
groupId: org.apache.camel
artifactId: camel-rabbitmq
- version: 2.22.1
+ version: 2.22.2
schemes:
- rabbitmq
languages: []
@@ -1332,7 +1332,7 @@ artifacts:
camel-reactive-streams:
groupId: org.apache.camel
artifactId: camel-reactive-streams
- version: 2.22.1
+ version: 2.22.2
schemes:
- reactive-streams
languages: []
@@ -1340,7 +1340,7 @@ artifacts:
camel-rest-swagger:
groupId: org.apache.camel
artifactId: camel-rest-swagger
- version: 2.22.1
+ version: 2.22.2
schemes:
- rest-swagger
languages: []
@@ -1348,7 +1348,7 @@ artifacts:
camel-restlet:
groupId: org.apache.camel
artifactId: camel-restlet
- version: 2.22.1
+ version: 2.22.2
schemes:
- restlet
languages: []
@@ -1356,7 +1356,7 @@ artifacts:
camel-rmi:
groupId: org.apache.camel
artifactId: camel-rmi
- version: 2.22.1
+ version: 2.22.2
schemes:
- rmi
languages: []
@@ -1364,7 +1364,7 @@ artifacts:
camel-routebox:
groupId: org.apache.camel
artifactId: camel-routebox
- version: 2.22.1
+ version: 2.22.2
schemes:
- routebox
languages: []
@@ -1372,7 +1372,7 @@ artifacts:
camel-rss:
groupId: org.apache.camel
artifactId: camel-rss
- version: 2.22.1
+ version: 2.22.2
schemes:
- rss
languages: []
@@ -1381,7 +1381,7 @@ artifacts:
camel-salesforce:
groupId: org.apache.camel
artifactId: camel-salesforce
- version: 2.22.1
+ version: 2.22.2
schemes:
- salesforce
languages: []
@@ -1389,7 +1389,7 @@ artifacts:
camel-sap-netweaver:
groupId: org.apache.camel
artifactId: camel-sap-netweaver
- version: 2.22.1
+ version: 2.22.2
schemes:
- sap-netweaver
languages: []
@@ -1397,7 +1397,7 @@ artifacts:
camel-schematron:
groupId: org.apache.camel
artifactId: camel-schematron
- version: 2.22.1
+ version: 2.22.2
schemes:
- schematron
languages: []
@@ -1405,7 +1405,7 @@ artifacts:
camel-jsch:
groupId: org.apache.camel
artifactId: camel-jsch
- version: 2.22.1
+ version: 2.22.2
schemes:
- scp
languages: []
@@ -1413,7 +1413,7 @@ artifacts:
camel-service:
groupId: org.apache.camel
artifactId: camel-service
- version: 2.22.1
+ version: 2.22.2
schemes:
- service
languages: []
@@ -1421,7 +1421,7 @@ artifacts:
camel-servicenow:
groupId: org.apache.camel
artifactId: camel-servicenow
- version: 2.22.1
+ version: 2.22.2
schemes:
- servicenow
languages: []
@@ -1429,7 +1429,7 @@ artifacts:
camel-servlet:
groupId: org.apache.camel
artifactId: camel-servlet
- version: 2.22.1
+ version: 2.22.2
schemes:
- servlet
languages: []
@@ -1437,7 +1437,7 @@ artifacts:
camel-sip:
groupId: org.apache.camel
artifactId: camel-sip
- version: 2.22.1
+ version: 2.22.2
schemes:
- sip
- sips
@@ -1446,7 +1446,7 @@ artifacts:
camel-sjms:
groupId: org.apache.camel
artifactId: camel-sjms
- version: 2.22.1
+ version: 2.22.2
schemes:
- sjms
- sjms-batch
@@ -1455,7 +1455,7 @@ artifacts:
camel-sjms2:
groupId: org.apache.camel
artifactId: camel-sjms2
- version: 2.22.1
+ version: 2.22.2
schemes:
- sjms2
languages: []
@@ -1463,7 +1463,7 @@ artifacts:
camel-slack:
groupId: org.apache.camel
artifactId: camel-slack
- version: 2.22.1
+ version: 2.22.2
schemes:
- slack
languages: []
@@ -1471,7 +1471,7 @@ artifacts:
camel-smpp:
groupId: org.apache.camel
artifactId: camel-smpp
- version: 2.22.1
+ version: 2.22.2
schemes:
- smpp
- smpps
@@ -1480,7 +1480,7 @@ artifacts:
camel-snmp:
groupId: org.apache.camel
artifactId: camel-snmp
- version: 2.22.1
+ version: 2.22.2
schemes:
- snmp
languages: []
@@ -1488,7 +1488,7 @@ artifacts:
camel-solr:
groupId: org.apache.camel
artifactId: camel-solr
- version: 2.22.1
+ version: 2.22.2
schemes:
- solr
- solrs
@@ -1498,7 +1498,7 @@ artifacts:
camel-spark:
groupId: org.apache.camel
artifactId: camel-spark
- version: 2.22.1
+ version: 2.22.2
schemes:
- spark
languages: []
@@ -1506,7 +1506,7 @@ artifacts:
camel-spark-rest:
groupId: org.apache.camel
artifactId: camel-spark-rest
- version: 2.22.1
+ version: 2.22.2
schemes:
- spark-rest
languages: []
@@ -1514,7 +1514,7 @@ artifacts:
camel-splunk:
groupId: org.apache.camel
artifactId: camel-splunk
- version: 2.22.1
+ version: 2.22.2
schemes:
- splunk
languages: []
@@ -1522,7 +1522,7 @@ artifacts:
camel-spring-batch:
groupId: org.apache.camel
artifactId: camel-spring-batch
- version: 2.22.1
+ version: 2.22.2
schemes:
- spring-batch
languages: []
@@ -1530,7 +1530,7 @@ artifacts:
camel-spring:
groupId: org.apache.camel
artifactId: camel-spring
- version: 2.22.1
+ version: 2.22.2
schemes:
- spring-event
languages:
@@ -1539,7 +1539,7 @@ artifacts:
camel-spring-integration:
groupId: org.apache.camel
artifactId: camel-spring-integration
- version: 2.22.1
+ version: 2.22.2
schemes:
- spring-integration
languages: []
@@ -1547,7 +1547,7 @@ artifacts:
camel-spring-ldap:
groupId: org.apache.camel
artifactId: camel-spring-ldap
- version: 2.22.1
+ version: 2.22.2
schemes:
- spring-ldap
languages: []
@@ -1555,7 +1555,7 @@ artifacts:
camel-spring-redis:
groupId: org.apache.camel
artifactId: camel-spring-redis
- version: 2.22.1
+ version: 2.22.2
schemes:
- spring-redis
languages: []
@@ -1563,7 +1563,7 @@ artifacts:
camel-spring-ws:
groupId: org.apache.camel
artifactId: camel-spring-ws
- version: 2.22.1
+ version: 2.22.2
schemes:
- spring-ws
languages: []
@@ -1571,7 +1571,7 @@ artifacts:
camel-sql:
groupId: org.apache.camel
artifactId: camel-sql
- version: 2.22.1
+ version: 2.22.2
schemes:
- sql
- sql-stored
@@ -1580,7 +1580,7 @@ artifacts:
camel-ssh:
groupId: org.apache.camel
artifactId: camel-ssh
- version: 2.22.1
+ version: 2.22.2
schemes:
- ssh
languages: []
@@ -1588,7 +1588,7 @@ artifacts:
camel-stax:
groupId: org.apache.camel
artifactId: camel-stax
- version: 2.22.1
+ version: 2.22.2
schemes:
- stax
languages: []
@@ -1596,7 +1596,7 @@ artifacts:
camel-stomp:
groupId: org.apache.camel
artifactId: camel-stomp
- version: 2.22.1
+ version: 2.22.2
schemes:
- stomp
languages: []
@@ -1604,7 +1604,7 @@ artifacts:
camel-stream:
groupId: org.apache.camel
artifactId: camel-stream
- version: 2.22.1
+ version: 2.22.2
schemes:
- stream
languages: []
@@ -1612,7 +1612,7 @@ artifacts:
camel-stringtemplate:
groupId: org.apache.camel
artifactId: camel-stringtemplate
- version: 2.22.1
+ version: 2.22.2
schemes:
- string-template
languages: []
@@ -1620,7 +1620,7 @@ artifacts:
camel-telegram:
groupId: org.apache.camel
artifactId: camel-telegram
- version: 2.22.1
+ version: 2.22.2
schemes:
- telegram
languages: []
@@ -1628,7 +1628,7 @@ artifacts:
camel-thrift:
groupId: org.apache.camel
artifactId: camel-thrift
- version: 2.22.1
+ version: 2.22.2
schemes:
- thrift
languages: []
@@ -1637,7 +1637,7 @@ artifacts:
camel-tika:
groupId: org.apache.camel
artifactId: camel-tika
- version: 2.22.1
+ version: 2.22.2
schemes:
- tika
languages: []
@@ -1645,7 +1645,7 @@ artifacts:
camel-twilio:
groupId: org.apache.camel
artifactId: camel-twilio
- version: 2.22.1
+ version: 2.22.2
schemes:
- twilio
languages: []
@@ -1653,7 +1653,7 @@ artifacts:
camel-twitter:
groupId: org.apache.camel
artifactId: camel-twitter
- version: 2.22.1
+ version: 2.22.2
schemes:
- twitter
- twitter-directmessage
@@ -1665,7 +1665,7 @@ artifacts:
camel-undertow:
groupId: org.apache.camel
artifactId: camel-undertow
- version: 2.22.1
+ version: 2.22.2
schemes:
- undertow
languages: []
@@ -1673,7 +1673,7 @@ artifacts:
camel-velocity:
groupId: org.apache.camel
artifactId: camel-velocity
- version: 2.22.1
+ version: 2.22.2
schemes:
- velocity
languages: []
@@ -1681,7 +1681,7 @@ artifacts:
camel-vertx:
groupId: org.apache.camel
artifactId: camel-vertx
- version: 2.22.1
+ version: 2.22.2
schemes:
- vertx
languages: []
@@ -1689,7 +1689,7 @@ artifacts:
camel-weather:
groupId: org.apache.camel
artifactId: camel-weather
- version: 2.22.1
+ version: 2.22.2
schemes:
- weather
languages: []
@@ -1697,7 +1697,7 @@ artifacts:
camel-web3j:
groupId: org.apache.camel
artifactId: camel-web3j
- version: 2.22.1
+ version: 2.22.2
schemes:
- web3j
languages: []
@@ -1705,7 +1705,7 @@ artifacts:
camel-websocket:
groupId: org.apache.camel
artifactId: camel-websocket
- version: 2.22.1
+ version: 2.22.2
schemes:
- websocket
languages: []
@@ -1713,7 +1713,7 @@ artifacts:
camel-wordpress:
groupId: org.apache.camel
artifactId: camel-wordpress
- version: 2.22.1
+ version: 2.22.2
schemes:
- wordpress
languages: []
@@ -1721,7 +1721,7 @@ artifacts:
camel-xchange:
groupId: org.apache.camel
artifactId: camel-xchange
- version: 2.22.1
+ version: 2.22.2
schemes:
- xchange
languages: []
@@ -1729,7 +1729,7 @@ artifacts:
camel-xmlrpc:
groupId: org.apache.camel
artifactId: camel-xmlrpc
- version: 2.22.1
+ version: 2.22.2
schemes:
- xmlrpc
languages: []
@@ -1738,7 +1738,7 @@ artifacts:
camel-xmlsecurity:
groupId: org.apache.camel
artifactId: camel-xmlsecurity
- version: 2.22.1
+ version: 2.22.2
schemes:
- xmlsecurity
languages: []
@@ -1747,7 +1747,7 @@ artifacts:
camel-xmpp:
groupId: org.apache.camel
artifactId: camel-xmpp
- version: 2.22.1
+ version: 2.22.2
schemes:
- xmpp
languages: []
@@ -1755,7 +1755,7 @@ artifacts:
camel-saxon:
groupId: org.apache.camel
artifactId: camel-saxon
- version: 2.22.1
+ version: 2.22.2
schemes:
- xquery
languages:
@@ -1764,7 +1764,7 @@ artifacts:
camel-yammer:
groupId: org.apache.camel
artifactId: camel-yammer
- version: 2.22.1
+ version: 2.22.2
schemes:
- yammer
languages: []
@@ -1772,7 +1772,7 @@ artifacts:
camel-yql:
groupId: org.apache.camel
artifactId: camel-yql
- version: 2.22.1
+ version: 2.22.2
schemes:
- yql
languages: []
@@ -1780,7 +1780,7 @@ artifacts:
camel-zendesk:
groupId: org.apache.camel
artifactId: camel-zendesk
- version: 2.22.1
+ version: 2.22.2
schemes:
- zendesk
languages: []
@@ -1788,7 +1788,7 @@ artifacts:
camel-zookeeper:
groupId: org.apache.camel
artifactId: camel-zookeeper
- version: 2.22.1
+ version: 2.22.2
schemes:
- zookeeper
languages: []
@@ -1796,7 +1796,7 @@ artifacts:
camel-zookeeper-master:
groupId: org.apache.camel
artifactId: camel-zookeeper-master
- version: 2.22.1
+ version: 2.22.2
schemes:
- zookeeper-master
languages: []
@@ -1804,7 +1804,7 @@ artifacts:
camel-juel:
groupId: org.apache.camel
artifactId: camel-juel
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- el
@@ -1812,7 +1812,7 @@ artifacts:
camel-groovy:
groupId: org.apache.camel
artifactId: camel-groovy
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- groovy
@@ -1820,7 +1820,7 @@ artifacts:
camel-script:
groupId: org.apache.camel
artifactId: camel-script
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- javaScript
@@ -1831,7 +1831,7 @@ artifacts:
camel-jsonpath:
groupId: org.apache.camel
artifactId: camel-jsonpath
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- jsonpath
@@ -1839,7 +1839,7 @@ artifacts:
camel-jxpath:
groupId: org.apache.camel
artifactId: camel-jxpath
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- jxpath
@@ -1847,7 +1847,7 @@ artifacts:
camel-ognl:
groupId: org.apache.camel
artifactId: camel-ognl
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- ognl
@@ -1855,7 +1855,7 @@ artifacts:
camel-josql:
groupId: org.apache.camel
artifactId: camel-josql
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- sql
@@ -1863,7 +1863,7 @@ artifacts:
camel-hl7:
groupId: org.apache.camel
artifactId: camel-hl7
- version: 2.22.1
+ version: 2.22.2
components: []
languages:
- terser
@@ -1872,7 +1872,7 @@ artifacts:
camel-asn1:
groupId: org.apache.camel
artifactId: camel-asn1
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1880,7 +1880,7 @@ artifacts:
camel-barcode:
groupId: org.apache.camel
artifactId: camel-barcode
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1888,7 +1888,7 @@ artifacts:
camel-base64:
groupId: org.apache.camel
artifactId: camel-base64
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1896,7 +1896,7 @@ artifacts:
camel-beanio:
groupId: org.apache.camel
artifactId: camel-beanio
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1904,7 +1904,7 @@ artifacts:
camel-bindy:
groupId: org.apache.camel
artifactId: camel-bindy
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1914,7 +1914,7 @@ artifacts:
camel-boon:
groupId: org.apache.camel
artifactId: camel-boon
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1922,7 +1922,7 @@ artifacts:
camel-castor:
groupId: org.apache.camel
artifactId: camel-castor
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1930,7 +1930,7 @@ artifacts:
camel-csv:
groupId: org.apache.camel
artifactId: camel-csv
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1938,7 +1938,7 @@ artifacts:
camel-fhir:
groupId: org.apache.camel
artifactId: camel-fhir
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1947,7 +1947,7 @@ artifacts:
camel-hessian:
groupId: org.apache.camel
artifactId: camel-hessian
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1955,7 +1955,7 @@ artifacts:
camel-ical:
groupId: org.apache.camel
artifactId: camel-ical
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1963,7 +1963,7 @@ artifacts:
camel-jacksonxml:
groupId: org.apache.camel
artifactId: camel-jacksonxml
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1971,7 +1971,7 @@ artifacts:
camel-jaxb:
groupId: org.apache.camel
artifactId: camel-jaxb
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1979,7 +1979,7 @@ artifacts:
camel-jibx:
groupId: org.apache.camel
artifactId: camel-jibx
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1987,7 +1987,7 @@ artifacts:
camel-fastjson:
groupId: org.apache.camel
artifactId: camel-fastjson
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -1995,7 +1995,7 @@ artifacts:
camel-gson:
groupId: org.apache.camel
artifactId: camel-gson
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2003,7 +2003,7 @@ artifacts:
camel-jackson:
groupId: org.apache.camel
artifactId: camel-jackson
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2011,7 +2011,7 @@ artifacts:
camel-johnzon:
groupId: org.apache.camel
artifactId: camel-johnzon
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2019,7 +2019,7 @@ artifacts:
camel-xstream:
groupId: org.apache.camel
artifactId: camel-xstream
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2028,7 +2028,7 @@ artifacts:
camel-lzf:
groupId: org.apache.camel
artifactId: camel-lzf
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2036,7 +2036,7 @@ artifacts:
camel-protobuf:
groupId: org.apache.camel
artifactId: camel-protobuf
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2044,7 +2044,7 @@ artifacts:
camel-soap:
groupId: org.apache.camel
artifactId: camel-soap
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2052,7 +2052,7 @@ artifacts:
camel-syslog:
groupId: org.apache.camel
artifactId: camel-syslog
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2060,7 +2060,7 @@ artifacts:
camel-tarfile:
groupId: org.apache.camel
artifactId: camel-tarfile
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2068,7 +2068,7 @@ artifacts:
camel-tagsoup:
groupId: org.apache.camel
artifactId: camel-tagsoup
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2076,7 +2076,7 @@ artifacts:
camel-univocity-parsers:
groupId: org.apache.camel
artifactId: camel-univocity-parsers
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2086,7 +2086,7 @@ artifacts:
camel-xmlbeans:
groupId: org.apache.camel
artifactId: camel-xmlbeans
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2094,7 +2094,7 @@ artifacts:
camel-xmljson:
groupId: org.apache.camel
artifactId: camel-xmljson
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2102,7 +2102,7 @@ artifacts:
camel-snakeyaml:
groupId: org.apache.camel
artifactId: camel-snakeyaml
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
@@ -2110,12 +2110,12 @@ artifacts:
camel-zipfile:
groupId: org.apache.camel
artifactId: camel-zipfile
- version: 2.22.1
+ version: 2.22.2
components: []
languages: []
dataformats:
- zipfile
-version: 2.22.1
+version: 2.22.2
`
Resources["crd-integration-context.yaml"] =
diff --git a/pkg/apis/camel/v1alpha1/types.go b/pkg/apis/camel/v1alpha1/types.go
index 11d95f5..f61c555 100644
--- a/pkg/apis/camel/v1alpha1/types.go
+++ b/pkg/apis/camel/v1alpha1/types.go
@@ -270,3 +270,9 @@ const (
// IntegrationPlatformPhaseDuplicate --
IntegrationPlatformPhaseDuplicate IntegrationPlatformPhase = "Duplicate"
)
+
+// Artifact --
+type Artifact struct {
+ ID string `json:"id" yaml:"id"`
+ Location string `json:"location,omitempty" yaml:"location,omitempty"`
+}
diff --git a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
index af2406c..202fd25 100644
--- a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
@@ -26,6 +26,22 @@ import (
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Artifact) DeepCopyInto(out *Artifact) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Artifact.
+func (in *Artifact) DeepCopy() *Artifact {
+ if in == nil {
+ return nil
+ }
+ out := new(Artifact)
+ 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/build/assemble/maven_assembler.go b/pkg/build/assemble/maven_assembler.go
deleted file mode 100644
index c19f576..0000000
--- a/pkg/build/assemble/maven_assembler.go
+++ /dev/null
@@ -1,173 +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 assemble
-
-import (
- "context"
- "encoding/xml"
- "fmt"
- "strings"
- "time"
-
- "github.com/apache/camel-k/pkg/build"
- "github.com/apache/camel-k/pkg/util/maven"
- "github.com/sirupsen/logrus"
-
- "github.com/apache/camel-k/version"
-)
-
-type mavenAssembler struct {
- buffer chan assembleOperation
-}
-
-type assembleOperation struct {
- request build.Request
- output chan build.AssembledOutput
-}
-
-// NewMavenAssembler create a new builder
-func NewMavenAssembler(ctx context.Context) build.Assembler {
- assembler := mavenAssembler{
- buffer: make(chan assembleOperation, 100),
- }
- go assembler.assembleCycle(ctx)
- return &assembler
-}
-
-func (b *mavenAssembler) Assemble(request build.Request) <-chan build.AssembledOutput {
- res := make(chan build.AssembledOutput, 1)
- op := assembleOperation{
- request: request,
- output: res,
- }
- b.buffer <- op
- return res
-}
-
-func (b *mavenAssembler) assembleCycle(ctx context.Context) {
- for {
- select {
- case <-ctx.Done():
- b.buffer = nil
- return
- case op := <-b.buffer:
- now := time.Now()
- logrus.Info("Starting new Maven build")
- res := b.execute(&op.request)
- elapsed := time.Now().Sub(now)
-
- if res.Error != nil {
- logrus.Error("Error during Maven build (total time ", elapsed.Seconds(), " seconds): ", res.Error)
- } else {
- logrus.Info("Maven build completed in ", elapsed.Seconds(), " seconds")
- }
-
- op.output <- res
- }
- }
-}
-
-func (b *mavenAssembler) execute(request *build.Request) build.AssembledOutput {
- project, err := generateProject(request)
- if err != nil {
- return build.AssembledOutput{
- Error: err,
- }
- }
-
- res, err := maven.Process(project)
- if err != nil {
- return build.AssembledOutput{
- Error: err,
- }
- }
-
- output := build.AssembledOutput{
- Classpath: make([]build.ClasspathEntry, 0, len(res.Classpath)),
- }
- for _, e := range res.Classpath {
- output.Classpath = append(output.Classpath, build.ClasspathEntry{
- ID: e.ID,
- Location: e.Location,
- })
- }
-
- return output
-}
-
-func generateProject(source *build.Request) (maven.Project, error) {
- project := maven.Project{
- XMLName: xml.Name{Local: "project"},
- XMLNs: "http://maven.apache.org/POM/4.0.0",
- XMLNsXsi: "http://www.w3.org/2001/XMLSchema-instance",
- XsiSchemaLocation: "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd",
- ModelVersion: "4.0.0",
- GroupID: "org.apache.camel.k.integration",
- ArtifactID: "camel-k-integration",
- Version: version.Version,
- DependencyManagement: maven.DependencyManagement{
- Dependencies: maven.Dependencies{
- Dependencies: []maven.Dependency{
- {
- //TODO: camel version should be retrieved from an external request or provided as static version
- GroupID: "org.apache.camel",
- ArtifactID: "camel-bom",
- Version: "2.22.1",
- Type: "pom",
- Scope: "import",
- },
- },
- },
- },
- Dependencies: maven.Dependencies{
- Dependencies: make([]maven.Dependency, 0),
- },
- }
-
- //
- // set-up dependencies
- //
-
- deps := &project.Dependencies
- deps.AddGAV("org.apache.camel.k", "camel-k-runtime-jvm", version.Version)
-
- for _, d := range source.Dependencies {
- if strings.HasPrefix(d, "camel:") {
- artifactID := strings.TrimPrefix(d, "camel:")
-
- if !strings.HasPrefix(artifactID, "camel-") {
- artifactID = "camel-" + artifactID
- }
-
- deps.AddGAV("org.apache.camel", artifactID, "")
- } else if strings.HasPrefix(d, "mvn:") {
- mid := strings.TrimPrefix(d, "mvn:")
- gav := strings.Replace(mid, "/", ":", -1)
-
- deps.AddEncodedGAV(gav)
- } else if strings.HasPrefix(d, "runtime:") {
- artifactID := strings.Replace(d, "runtime:", "camel-k-runtime-", 1)
-
- deps.AddGAV("org.apache.camel.k", artifactID, version.Version)
- } else {
- return maven.Project{}, fmt.Errorf("unknown dependency type: %s", d)
- }
- }
-
- return project, nil
-}
diff --git a/pkg/build/assemble/maven_assembler_test.go b/pkg/build/assemble/maven_assembler_test.go
deleted file mode 100644
index 20de3d8..0000000
--- a/pkg/build/assemble/maven_assembler_test.go
+++ /dev/null
@@ -1,82 +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 assemble
-
-import (
- "testing"
-
- "github.com/apache/camel-k/pkg/build"
- "github.com/stretchr/testify/assert"
-)
-
-func TestProjectGeneration(t *testing.T) {
- request := build.Request{
- Identifier: build.Identifier{
- Name: "my-integration",
- Qualifier: "",
- },
- Code: build.Source{
- Name: "my-code.js",
- Content: `from("timer:start").to("log:end")`,
- Language: "",
- },
- Dependencies: []string{
- "camel:mail",
- "camel:camel-netty4",
- "mvn:org.apache.camel/camel-servicenow/2.21.1",
- "mvn:org.apache.camel/camel-salesforce",
- },
- }
-
- prj, err := generateProject(&request)
-
- assert.Nil(t, err)
- assert.NotNil(t, prj)
- assert.Equal(t, len(prj.Dependencies.Dependencies), 5)
- assert.Equal(t, prj.Dependencies.Dependencies[0].ArtifactID, "camel-k-runtime-jvm")
- assert.Equal(t, prj.Dependencies.Dependencies[1].ArtifactID, "camel-mail")
- assert.Equal(t, prj.Dependencies.Dependencies[2].ArtifactID, "camel-netty4")
- assert.Equal(t, prj.Dependencies.Dependencies[3].ArtifactID, "camel-servicenow")
- assert.Equal(t, prj.Dependencies.Dependencies[3].Version, "2.21.1")
- assert.Equal(t, prj.Dependencies.Dependencies[4].ArtifactID, "camel-salesforce")
- assert.Equal(t, prj.Dependencies.Dependencies[4].Version, "")
-}
-
-func TestProjectGenerationWithFailure(t *testing.T) {
- request := build.Request{
- Identifier: build.Identifier{
- Name: "my-integration",
- Qualifier: "",
- },
- Code: build.Source{
- Name: "my-code.js",
- Content: `from("timer:start").to("log:end")`,
- Language: "",
- },
- Dependencies: []string{
- "other:mail",
- "camel:camel-netty4",
- "mvn:org.apache.camel/camel-servicenow/2.21.1",
- "mvn:org.apache.camel/camel-salesforce",
- },
- }
-
- _, err := generateProject(&request)
-
- assert.NotNil(t, err)
-}
diff --git a/pkg/build/build_manager.go b/pkg/build/build_manager.go
deleted file mode 100644
index 83c0f8a..0000000
--- a/pkg/build/build_manager.go
+++ /dev/null
@@ -1,156 +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 build
-
-import (
- "context"
- "errors"
- "sync"
-)
-
-// Manager represent the main facade to the image build system
-type Manager struct {
- ctx context.Context
- builds sync.Map
- assembler Assembler
- packager Packager
- publisher Publisher
-}
-
-// NewManager creates an instance of the build manager using the given assembler, packager and publisher
-func NewManager(ctx context.Context, assembler Assembler, packager Packager, publisher Publisher) *Manager {
- return &Manager{
- ctx: ctx,
- assembler: assembler,
- packager: packager,
- publisher: publisher,
- }
-}
-
-// Get retrieve the build result associated to the given build identifier
-func (m *Manager) Get(identifier Identifier) Result {
- info, present := m.builds.Load(identifier)
- if !present || info == nil {
- return noBuildInfo()
- }
-
- return info.(Result)
-}
-
-// Start starts a new build
-func (m *Manager) Start(request Request) {
- m.builds.Store(request.Identifier, initialBuildInfo(request))
-
- assembleChannel := m.assembler.Assemble(request)
- go func() {
- var assembled AssembledOutput
- select {
- case <-m.ctx.Done():
- m.builds.Store(request.Identifier, canceledBuildInfo(request))
- return
- case assembled = <-assembleChannel:
- if assembled.Error != nil {
- m.builds.Store(request.Identifier, failedAssembleBuildInfo(request, assembled))
- return
- }
- }
-
- packageChannel := m.packager.Package(request, assembled)
- var packaged PackagedOutput
- select {
- case <-m.ctx.Done():
- m.builds.Store(request.Identifier, canceledBuildInfo(request))
- return
- case packaged = <-packageChannel:
- if packaged.Error != nil {
- m.builds.Store(request.Identifier, failedPackageBuildInfo(request, packaged))
- return
- }
- }
- defer m.packager.Cleanup(packaged)
-
- publishChannel := m.publisher.Publish(request, assembled, packaged)
- var published PublishedOutput
- select {
- case <-m.ctx.Done():
- m.builds.Store(request.Identifier, canceledBuildInfo(request))
- return
- case published = <-publishChannel:
- if published.Error != nil {
- m.builds.Store(request.Identifier, failedPublishBuildInfo(request, published))
- return
- }
- }
-
- m.builds.Store(request.Identifier, completeResult(request, assembled, published))
- }()
-}
-
-func noBuildInfo() Result {
- return Result{
- Status: StatusNotRequested,
- }
-}
-
-func initialBuildInfo(request Request) Result {
- return Result{
- Request: request,
- Status: StatusStarted,
- }
-}
-
-func canceledBuildInfo(request Request) Result {
- return Result{
- Request: request,
- Error: errors.New("build canceled"),
- Status: StatusError,
- }
-}
-
-func failedAssembleBuildInfo(request Request, output AssembledOutput) Result {
- return Result{
- Request: request,
- Error: output.Error,
- Status: StatusError,
- }
-}
-
-func failedPackageBuildInfo(request Request, output PackagedOutput) Result {
- return Result{
- Request: request,
- Error: output.Error,
- Status: StatusError,
- }
-}
-
-func failedPublishBuildInfo(request Request, output PublishedOutput) Result {
- return Result{
- Request: request,
- Error: output.Error,
- Status: StatusError,
- }
-}
-
-func completeResult(request Request, a AssembledOutput, p PublishedOutput) Result {
- return Result{
- Request: request,
- Status: StatusCompleted,
- Classpath: a.Classpath,
- Image: p.Image,
- }
-}
diff --git a/pkg/build/build_types.go b/pkg/build/build_types.go
deleted file mode 100644
index bf83245..0000000
--- a/pkg/build/build_types.go
+++ /dev/null
@@ -1,105 +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 build
-
-// Request represent a request to build a specific code
-type Request struct {
- Identifier Identifier
- Code Source
- Dependencies []string
-}
-
-// Identifier identifies a build
-type Identifier struct {
- Name string
- Qualifier string
-}
-
-// Source represent the integration code
-type Source struct {
- Name string
- Content string
- Language string
-}
-
-// Result represents the result of a build
-type Result struct {
- Request Request
- Status Status
- Image string
- Error error
- Classpath []ClasspathEntry
-}
-
-// ClasspathEntry --
-type ClasspathEntry struct {
- ID string `json:"id" yaml:"id"`
- Location string `json:"location,omitempty" yaml:"location,omitempty"`
-}
-
-// AssembledOutput represents the output of the assemble phase
-type AssembledOutput struct {
- Error error
- Classpath []ClasspathEntry
-}
-
-// A Assembler can be used to compute the classpath of a integration context
-type Assembler interface {
- Assemble(Request) <-chan AssembledOutput
-}
-
-// PackagedOutput is the new image layer that needs to be pushed
-type PackagedOutput struct {
- Error error
- BaseImage string
- TarFile string
-}
-
-// A Packager produces the image layer that needs to be pushed
-type Packager interface {
- Package(Request, AssembledOutput) <-chan PackagedOutput
- Cleanup(PackagedOutput)
-}
-
-// PublishedOutput is the output of the publish phase
-type PublishedOutput struct {
- Error error
- Image string
-}
-
-// A Publisher publishes a docker image of a build request
-type Publisher interface {
- Publish(Request, AssembledOutput, PackagedOutput) <-chan PublishedOutput
-}
-
-// Status --
-type Status int
-
-const (
- // StatusNotRequested --
- StatusNotRequested Status = iota
-
- // StatusStarted --
- StatusStarted
-
- // StatusCompleted --
- StatusCompleted
-
- // StatusError --
- StatusError
-)
diff --git a/pkg/build/packager/base.go b/pkg/build/packager/base.go
deleted file mode 100644
index a13da83..0000000
--- a/pkg/build/packager/base.go
+++ /dev/null
@@ -1,177 +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 packager
-
-import (
- "context"
- "io/ioutil"
- "os"
- "path"
- "time"
-
- "github.com/apache/camel-k/pkg/build"
- "github.com/apache/camel-k/pkg/util/maven"
- "github.com/apache/camel-k/pkg/util/tar"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-const (
- sharedDir = "/workspace"
- artifactDirPrefix = "layer-"
-)
-
-type commonPackager struct {
- buffer chan packageOperation
- uploadedArtifactsSelector
-}
-
-type packageOperation struct {
- request build.Request
- assembled build.AssembledOutput
- output chan build.PackagedOutput
-}
-
-type uploadedArtifactsSelector func([]build.ClasspathEntry) (string, []build.ClasspathEntry, error)
-
-func newBasePackager(ctx context.Context, rootImage string) build.Packager {
- identitySelector := func(entries []build.ClasspathEntry) (string, []build.ClasspathEntry, error) {
- return rootImage, entries, nil
- }
- return newBasePackagerWithSelector(ctx, identitySelector)
-}
-
-func newBasePackagerWithSelector(ctx context.Context, uploadedArtifactsSelector uploadedArtifactsSelector) *commonPackager {
- pack := commonPackager{
- buffer: make(chan packageOperation, 100),
- uploadedArtifactsSelector: uploadedArtifactsSelector,
- }
- go pack.packageCycle(ctx)
- return &pack
-}
-
-func (b *commonPackager) Package(request build.Request, assembled build.AssembledOutput) <-chan build.PackagedOutput {
- res := make(chan build.PackagedOutput, 1)
- op := packageOperation{
- request: request,
- assembled: assembled,
- output: res,
- }
- b.buffer <- op
- return res
-}
-
-func (b *commonPackager) Cleanup(output build.PackagedOutput) {
- parentDir, _ := path.Split(output.TarFile)
- err := os.RemoveAll(parentDir)
- if err != nil {
- logrus.Warn("Could not remove temporary directory ", parentDir)
- }
-}
-
-func (b *commonPackager) packageCycle(ctx context.Context) {
- for {
- select {
- case <-ctx.Done():
- b.buffer = nil
- return
- case op := <-b.buffer:
- now := time.Now()
- logrus.Info("Starting a new image packaging")
- res := b.execute(op.request, op.assembled)
- elapsed := time.Now().Sub(now)
-
- if res.Error != nil {
- logrus.Error("Error during packaging (total time ", elapsed.Seconds(), " seconds): ", res.Error)
- } else {
- logrus.Info("Packaging completed in ", elapsed.Seconds(), " seconds")
- }
-
- op.output <- res
- }
- }
-}
-
-func (b *commonPackager) execute(request build.Request, assembled build.AssembledOutput) build.PackagedOutput {
- baseImageName, selectedArtifacts, err := b.uploadedArtifactsSelector(assembled.Classpath)
- if err != nil {
- return build.PackagedOutput{Error: err}
- }
-
- tarFile, err := b.createTar(assembled, selectedArtifacts)
- if err != nil {
- return build.PackagedOutput{Error: err}
- }
-
- return build.PackagedOutput{
- BaseImage: baseImageName,
- TarFile: tarFile,
- }
-}
-
-func (b *commonPackager) createTar(assembled build.AssembledOutput, selectedArtifacts []build.ClasspathEntry) (string, error) {
- buildBaseDir := sharedDir
- if _, err := os.Stat(buildBaseDir); os.IsNotExist(err) {
- // use default OS temp dir if a shared dir is not present
- buildBaseDir = ""
- }
- artifactDir, err := ioutil.TempDir(buildBaseDir, artifactDirPrefix)
- if err != nil {
- return "", errors.Wrap(err, "could not create temporary dir for packaged artifacts")
- }
-
- tarFileName := path.Join(artifactDir, "occi.tar")
- tarAppender, err := tar.NewAppender(tarFileName)
- if err != nil {
- return "", err
- }
- defer tarAppender.Close()
-
- tarDir := "dependencies/"
- for _, entry := range selectedArtifacts {
- gav, err := maven.ParseGAV(entry.ID)
- if err != nil {
- return "", nil
- }
-
- tarPath := path.Join(tarDir, gav.GroupID)
- _, err = tarAppender.AddFile(entry.Location, tarPath)
- if err != nil {
- return "", err
- }
- }
-
- cp := ""
- for _, entry := range assembled.Classpath {
- gav, err := maven.ParseGAV(entry.ID)
- if err != nil {
- return "", nil
- }
- tarPath := path.Join(tarDir, gav.GroupID)
- _, fileName := path.Split(entry.Location)
- fileName = path.Join(tarPath, fileName)
- cp += fileName + "\n"
- }
-
- err = tarAppender.AppendData([]byte(cp), "classpath")
- if err != nil {
- return "", err
- }
-
- return tarFileName, nil
-}
diff --git a/pkg/build/packager/factory.go b/pkg/build/packager/factory.go
deleted file mode 100644
index 48ad665..0000000
--- a/pkg/build/packager/factory.go
+++ /dev/null
@@ -1,49 +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 packager
-
-import (
- "context"
- "github.com/apache/camel-k/pkg/build"
-)
-
-const (
- s2iRootImage = "fabric8/s2i-java:2.3"
- //javaRootImage = "fabric8/java-jboss-openjdk8-jdk:1.5.1"
- javaRootImage = "fabric8/java-alpine-openjdk8-jdk:1.5.1"
-)
-
-// NewS2IStandardPackager creates a standard packager for S2I builds
-func NewS2IStandardPackager(ctx context.Context) build.Packager {
- return newBasePackager(ctx, s2iRootImage)
-}
-
-// NewS2IIncrementalPackager creates a incremental packager for S2I builds
-func NewS2IIncrementalPackager(ctx context.Context, lister PublishedImagesLister) build.Packager {
- return newIncrementalPackager(ctx, lister, s2iRootImage)
-}
-
-// NewJavaStandardPackager creates a standard packager for Java Docker builds
-func NewJavaStandardPackager(ctx context.Context) build.Packager {
- return newBasePackager(ctx, javaRootImage)
-}
-
-// NewJavaIncrementalPackager creates a incremental packager for Java Docker builds
-func NewJavaIncrementalPackager(ctx context.Context, lister PublishedImagesLister) build.Packager {
- return newIncrementalPackager(ctx, lister, javaRootImage)
-}
diff --git a/pkg/build/packager/incremental.go b/pkg/build/packager/incremental.go
deleted file mode 100644
index cb9334b..0000000
--- a/pkg/build/packager/incremental.go
+++ /dev/null
@@ -1,106 +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 packager
-
-import (
- "context"
-
- "github.com/apache/camel-k/pkg/build"
-)
-
-type incrementalPackager struct {
- commonPackager *commonPackager
- lister PublishedImagesLister
- rootImage string
-}
-
-// newIncrementalPackager creates a new packager that is able to create a layer on top of a existing image
-func newIncrementalPackager(ctx context.Context, lister PublishedImagesLister, rootImage string) build.Packager {
- layeredPackager := incrementalPackager{
- lister: lister,
- rootImage: rootImage,
- }
- layeredPackager.commonPackager = newBasePackagerWithSelector(ctx, layeredPackager.selectArtifactsToUpload)
- return &layeredPackager
-}
-
-func (p *incrementalPackager) Package(req build.Request, assembled build.AssembledOutput) <-chan build.PackagedOutput {
- return p.commonPackager.Package(req, assembled)
-}
-
-func (p *incrementalPackager) Cleanup(output build.PackagedOutput) {
- p.commonPackager.Cleanup(output)
-}
-
-func (p *incrementalPackager) selectArtifactsToUpload(entries []build.ClasspathEntry) (string, []build.ClasspathEntry, error) {
- images, err := p.lister.ListPublishedImages()
- if err != nil {
- return "", nil, err
- }
-
- bestImage, commonLibs := p.findBestImage(images, entries)
- if bestImage != nil {
- selectedClasspath := make([]build.ClasspathEntry, 0)
- for _, entry := range entries {
- if _, isCommon := commonLibs[entry.ID]; !isCommon {
- selectedClasspath = append(selectedClasspath, entry)
- }
- }
-
- return bestImage.Image, selectedClasspath, nil
- }
-
- // return default selection
- return p.rootImage, entries, nil
-}
-
-func (p *incrementalPackager) findBestImage(images []PublishedImage, entries []build.ClasspathEntry) (*PublishedImage, map[string]bool) {
- if len(images) == 0 {
- return nil, nil
- }
- requiredLibs := make(map[string]bool, len(entries))
- for _, entry := range entries {
- requiredLibs[entry.ID] = true
- }
-
- var bestImage PublishedImage
- bestImageCommonLibs := make(map[string]bool, 0)
- bestImageSurplusLibs := 0
- for _, image := range images {
- common := make(map[string]bool)
- for _, id := range image.Classpath {
- if _, ok := requiredLibs[id]; ok {
- common[id] = true
- }
- }
- numCommonLibs := len(common)
- surplus := len(image.Classpath) - numCommonLibs
- if surplus >= numCommonLibs/3 {
- // Heuristic approach: if there are too many unrelated libraries, just use the base image
- continue
- }
-
- if numCommonLibs > len(bestImageCommonLibs) || (numCommonLibs == len(bestImageCommonLibs) && surplus < bestImageSurplusLibs) {
- bestImage = image
- bestImageCommonLibs = common
- bestImageSurplusLibs = surplus
- }
- }
-
- return &bestImage, bestImageCommonLibs
-}
diff --git a/pkg/build/publish/kaniko_publisher.go b/pkg/build/publish/kaniko_publisher.go
deleted file mode 100644
index ac356eb..0000000
--- a/pkg/build/publish/kaniko_publisher.go
+++ /dev/null
@@ -1,225 +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 publish
-
-import (
- tarutils "archive/tar"
- "context"
- "github.com/apache/camel-k/pkg/util/kubernetes"
- "io"
- "io/ioutil"
- "os"
- "path"
- "time"
-
- "github.com/apache/camel-k/pkg/build"
- "github.com/operator-framework/operator-sdk/pkg/sdk"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
- "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-type kanikoPublisher struct {
- buffer chan kanikoPublishOperation
- namespace string
- registry string
-}
-
-type kanikoPublishOperation struct {
- request build.Request
- assembled build.AssembledOutput
- packaged build.PackagedOutput
- output chan build.PublishedOutput
-}
-
-// NewKanikoPublisher creates a new publisher doing a Kaniko image push
-func NewKanikoPublisher(ctx context.Context, namespace string, registry string) build.Publisher {
- publisher := kanikoPublisher{
- buffer: make(chan kanikoPublishOperation, 100),
- namespace: namespace,
- registry: registry,
- }
- go publisher.publishCycle(ctx)
- return &publisher
-}
-
-func (b *kanikoPublisher) Publish(request build.Request, assembled build.AssembledOutput, packaged build.PackagedOutput) <-chan build.PublishedOutput {
- res := make(chan build.PublishedOutput, 1)
- op := kanikoPublishOperation{
- request: request,
- assembled: assembled,
- packaged: packaged,
- output: res,
- }
- b.buffer <- op
- return res
-}
-
-func (b *kanikoPublisher) publishCycle(ctx context.Context) {
- for {
- select {
- case <-ctx.Done():
- b.buffer = nil
- return
- case op := <-b.buffer:
- now := time.Now()
- logrus.Info("Starting a new image publication")
- res := b.execute(op.request, op.assembled, op.packaged)
- elapsed := time.Now().Sub(now)
-
- if res.Error != nil {
- logrus.Error("Error during publication (total time ", elapsed.Seconds(), " seconds): ", res.Error)
- } else {
- logrus.Info("Publication completed in ", elapsed.Seconds(), " seconds")
- }
-
- op.output <- res
- }
- }
-}
-
-func (b *kanikoPublisher) execute(request build.Request, assembled build.AssembledOutput, packaged build.PackagedOutput) build.PublishedOutput {
- image, err := b.publish(packaged.TarFile, packaged.BaseImage, request)
- if err != nil {
- return build.PublishedOutput{Error: err}
- }
-
- return build.PublishedOutput{Image: image}
-}
-
-func (b *kanikoPublisher) publish(tarFile string, baseImageName string, source build.Request) (string, error) {
- image := b.registry + "/" + b.namespace + "/camel-k-" + source.Identifier.Name + ":" + source.Identifier.Qualifier
- contextDir, err := b.prepareContext(tarFile, baseImageName)
- if err != nil {
- return "", err
- }
- pod := v1.Pod{
- TypeMeta: metav1.TypeMeta{
- APIVersion: v1.SchemeGroupVersion.String(),
- Kind: "Pod",
- },
- ObjectMeta: metav1.ObjectMeta{
- Namespace: b.namespace,
- Name: "camel-k-" + source.Identifier.Name,
- },
- Spec: v1.PodSpec{
- Containers: []v1.Container{
- {
- Name: "kaniko",
- Image: "gcr.io/kaniko-project/executor@sha256:f29393d9c8d40296e1692417089aa2023494bce9afd632acac7dd0aea763e5bc",
- Args: []string{
- "--dockerfile=Dockerfile",
- "--context=" + contextDir,
- "--destination=" + image,
- "--insecure",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "camel-k-builder",
- MountPath: "/workspace",
- },
- },
- },
- },
- RestartPolicy: v1.RestartPolicyNever,
- Volumes: []v1.Volume{
- {
- Name: "camel-k-builder",
- VolumeSource: v1.VolumeSource{
- PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{
- ClaimName: "camel-k-builder",
- ReadOnly: true,
- },
- },
- },
- },
- },
- }
-
- sdk.Delete(&pod)
- err = sdk.Create(&pod)
- if err != nil {
- return "", errors.Wrap(err, "cannot create kaniko builder pod")
- }
-
- err = kubernetes.WaitCondition(&pod, func(obj interface{}) (bool, error) {
- if val, ok := obj.(*v1.Pod); ok {
- if val.Status.Phase == v1.PodSucceeded {
- return true, nil
- } else if val.Status.Phase == v1.PodFailed {
- return false, errors.New("build failed")
- }
- }
- return false, nil
- }, 10*time.Minute)
-
- if err != nil {
- return "", err
- }
-
- return image, nil
-}
-
-func (b *kanikoPublisher) prepareContext(tarName string, baseImage string) (string, error) {
- baseDir, _ := path.Split(tarName)
- contextDir := path.Join(baseDir, "context")
- if err := b.unTar(tarName, contextDir); err != nil {
- return "", err
- }
-
- dockerFileContent := []byte(`
- FROM ` + baseImage + `
- ADD . /deployments
- `)
- if err := ioutil.WriteFile(path.Join(contextDir, "Dockerfile"), dockerFileContent, 0777); err != nil {
- return "", err
- }
- return contextDir, nil
-}
-
-func (b *kanikoPublisher) unTar(tarName string, dir string) error {
- file, err := os.Open(tarName)
- if err != nil {
- return err
- }
- defer file.Close()
- reader := tarutils.NewReader(file)
- for {
- header, err := reader.Next()
- if err == io.EOF {
- break
- }
- if err != nil {
- return err
- }
- targetName := path.Join(dir, header.Name)
- targetDir, _ := path.Split(targetName)
- if err := os.MkdirAll(targetDir, 0777); err != nil {
- return err
- }
- buffer, err := ioutil.ReadAll(reader)
- if err != nil {
- return err
- }
- if err := ioutil.WriteFile(targetName, buffer, os.FileMode(header.Mode)); err != nil {
- return err
- }
- }
- return nil
-}
diff --git a/pkg/builder/builder.go b/pkg/builder/builder.go
new file mode 100644
index 0000000..45da05f
--- /dev/null
+++ b/pkg/builder/builder.go
@@ -0,0 +1,202 @@
+/*
+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 builder
+
+import (
+ "context"
+ "errors"
+ "io/ioutil"
+ "os"
+ "sort"
+ "sync"
+ "sync/atomic"
+ "time"
+
+ "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+
+ "github.com/sirupsen/logrus"
+)
+
+// ********************************
+//
+// Default builder
+//
+// ********************************
+
+type defaultBuilder struct {
+ log *logrus.Entry
+ ctx context.Context
+ requests chan Request
+ interrupt chan bool
+ request sync.Map
+ running int32
+ namespace string
+}
+
+// New --
+func New(ctx context.Context, namespace string) Builder {
+ m := defaultBuilder{
+ log: logrus.WithField("logger", "builder"),
+ ctx: ctx,
+ requests: make(chan Request),
+ interrupt: make(chan bool, 1),
+ running: 0,
+ namespace: namespace,
+ }
+
+ return &m
+}
+
+// Submit --
+func (b *defaultBuilder) Submit(request Request) Result {
+ if atomic.CompareAndSwapInt32(&b.running, 0, 1) {
+ go b.loop()
+ }
+
+ result, present := b.request.Load(request.Identifier)
+ if !present || result == nil {
+ result = Result{
+ Request: request,
+ Status: StatusSubmitted,
+ }
+
+ b.log.Infof("submitting request: %+v", request)
+
+ b.request.Store(request.Identifier, result)
+ b.requests <- request
+ }
+
+ return result.(Result)
+}
+
+// Purge --
+func (b *defaultBuilder) Purge(request Request) {
+ b.request.Delete(request.Identifier)
+}
+
+// ********************************
+//
+// Helpers
+//
+// ********************************
+
+func (b *defaultBuilder) loop() {
+ for atomic.LoadInt32(&b.running) == 1 {
+ select {
+ case <-b.ctx.Done():
+ b.interrupt <- true
+
+ close(b.interrupt)
+ close(b.requests)
+
+ atomic.StoreInt32(&b.running, 0)
+ case r, ok := <-b.requests:
+ if ok {
+ b.log.Infof("executing request: %+v", r)
+ b.submit(r)
+ }
+ }
+ }
+}
+
+func (b *defaultBuilder) submit(request Request) {
+ result, present := b.request.Load(request.Identifier)
+ if !present || result == nil {
+ b.log.Panicf("no info found for: %+v", request.Identifier)
+ }
+
+ // update the status
+ r := result.(Result)
+ r.Status = StatusStarted
+ r.ProcessStartedAt = time.Now()
+
+ // create tmp path
+ tmp, err := ioutil.TempDir(os.TempDir(), "builder-")
+ if err != nil {
+ r.Status = StatusError
+ r.Error = err
+ }
+
+ os.RemoveAll(tmp)
+
+ // update the cache
+ b.request.Store(request.Identifier, r)
+
+ c := Context{
+ C: b.ctx,
+ Values: make(map[string]interface{}),
+ Path: tmp,
+ Libraries: make([]v1alpha1.Artifact, 0),
+ StepsDone: make([]string, 0),
+ Namespace: b.namespace,
+ Request: request,
+ }
+
+ // Sort steps by phase
+ sort.SliceStable(request.Steps, func(i, j int) bool {
+ return request.Steps[i].Phase() < request.Steps[j].Phase()
+ })
+
+ for _, step := range request.Steps {
+ if c.Error != nil {
+ break
+ }
+
+ select {
+ case <-b.interrupt:
+ c.Error = errors.New("build canceled")
+ default:
+ l := b.log.WithFields(logrus.Fields{
+ "step": step.ID(),
+ "phase": step.Phase(),
+ "request": request.Identifier.String(),
+ })
+
+ l.Infof("executing step")
+
+ now := time.Now()
+ c.Error = step.Execute(&c)
+
+ if c.Error == nil {
+ c.StepsDone = append(c.StepsDone, step.ID())
+ l.Infof("step done in %f seconds", time.Now().Sub(now).Seconds())
+ } else {
+ l.Infof("step failed with error: %s", c.Error)
+ }
+ }
+ }
+
+ r.Status = StatusCompleted
+ r.Image = c.Image
+ r.ProcessCompletedAt = time.Now()
+ r.Error = c.Error
+
+ if r.Error != nil {
+ r.Status = StatusError
+ }
+
+ r.Classpath = make([]string, 0, len(c.Libraries))
+ for _, l := range c.Libraries {
+ r.Classpath = append(r.Classpath, l.ID)
+ }
+
+ // update the cache
+ b.request.Store(request.Identifier, r)
+
+ b.log.Infof("request %s:%s executed in %f seconds", r.Request.Identifier.Name, r.Request.Identifier.Qualifier, r.ProcessCompletedAt.Sub(r.ProcessStartedAt).Seconds())
+}
diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
new file mode 100644
index 0000000..98c83ee
--- /dev/null
+++ b/pkg/builder/builder_steps.go
@@ -0,0 +1,296 @@
+/*
+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 builder
+
+import (
+ "encoding/xml"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "path"
+ "strings"
+
+ "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+ "github.com/operator-framework/operator-sdk/pkg/sdk"
+
+ "github.com/apache/camel-k/pkg/util/tar"
+
+ yaml "gopkg.in/yaml.v2"
+
+ "github.com/pkg/errors"
+
+ "github.com/apache/camel-k/pkg/util/maven"
+ "github.com/apache/camel-k/version"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// GenerateProject --
+func GenerateProject(ctx *Context) error {
+ ctx.Project = maven.Project{
+ XMLName: xml.Name{Local: "project"},
+ XMLNs: "http://maven.apache.org/POM/4.0.0",
+ XMLNsXsi: "http://www.w3.org/2001/XMLSchema-instance",
+ XsiSchemaLocation: "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd",
+ ModelVersion: "4.0.0",
+ GroupID: "org.apache.camel.k.integration",
+ ArtifactID: "camel-k-integration",
+ Version: version.Version,
+ DependencyManagement: maven.DependencyManagement{
+ Dependencies: maven.Dependencies{
+ Dependencies: []maven.Dependency{
+ {
+ //TODO: camel version should be retrieved from an external request or provided as static version
+ GroupID: "org.apache.camel",
+ ArtifactID: "camel-bom",
+ Version: "2.22.2",
+ Type: "pom",
+ Scope: "import",
+ },
+ },
+ },
+ },
+ Dependencies: maven.Dependencies{
+ Dependencies: make([]maven.Dependency, 0),
+ },
+ }
+
+ //
+ // set-up dependencies
+ //
+
+ deps := &ctx.Project.Dependencies
+ deps.AddGAV("org.apache.camel.k", "camel-k-runtime-jvm", version.Version)
+
+ for _, d := range ctx.Request.Dependencies {
+ if strings.HasPrefix(d, "camel:") {
+ artifactID := strings.TrimPrefix(d, "camel:")
+
+ if !strings.HasPrefix(artifactID, "camel-") {
+ artifactID = "camel-" + artifactID
+ }
+
+ deps.AddGAV("org.apache.camel", artifactID, "")
+ } else if strings.HasPrefix(d, "mvn:") {
+ mid := strings.TrimPrefix(d, "mvn:")
+ gav := strings.Replace(mid, "/", ":", -1)
+
+ deps.AddEncodedGAV(gav)
+ } else if strings.HasPrefix(d, "runtime:") {
+ artifactID := strings.Replace(d, "runtime:", "camel-k-runtime-", 1)
+
+ deps.AddGAV("org.apache.camel.k", artifactID, version.Version)
+ } else {
+ return fmt.Errorf("unknown dependency type: %s", d)
+ }
+ }
+
+ return nil
+}
+
+// ComputeDependencies --
+func ComputeDependencies(ctx *Context) error {
+ p := path.Join(ctx.Path, "maven")
+
+ err := maven.CreateStructure(p, ctx.Project)
+ if err != nil {
+ return err
+ }
+
+ goal := fmt.Sprintf("org.apache.camel.k:camel-k-runtime-dependency-lister:%s:generate-dependency-list", version.Version)
+
+ err = maven.Run(p, MavenExtraOptions(), goal)
+ if err != nil {
+ return errors.Wrap(err, "failure while determining classpath")
+ }
+
+ dependencies := path.Join(p, "target", "dependencies.yaml")
+ content, err := ioutil.ReadFile(dependencies)
+ if err != nil {
+ return err
+ }
+
+ cp := make(map[string][]v1alpha1.Artifact)
+ err = yaml.Unmarshal(content, &cp)
+ if err != nil {
+ return err
+ }
+
+ for _, e := range cp["dependencies"] {
+ ctx.Libraries = append(ctx.Libraries, v1alpha1.Artifact{
+ ID: e.ID,
+ Location: e.Location,
+ })
+ }
+
+ return nil
+}
+
+// ArtifactsSelector --
+type ArtifactsSelector func([]v1alpha1.Artifact) (string, []v1alpha1.Artifact, error)
+
+// StandardPackager --
+func StandardPackager(ctx *Context) error {
+ return packager(ctx, func(libraries []v1alpha1.Artifact) (string, []v1alpha1.Artifact, error) {
+ return "fabric8/s2i-java:2.3", libraries, nil
+ })
+}
+
+// IncrementalPackager --
+func IncrementalPackager(ctx *Context) error {
+ images, err := ListPublishedImages(ctx.Namespace)
+ if err != nil {
+ return err
+ }
+
+ return packager(ctx, func(libraries []v1alpha1.Artifact) (string, []v1alpha1.Artifact, error) {
+ bestImage, commonLibs := FindBestImage(images, libraries)
+ if bestImage != nil {
+ selectedClasspath := make([]v1alpha1.Artifact, 0)
+ for _, entry := range libraries {
+ if _, isCommon := commonLibs[entry.ID]; !isCommon {
+ selectedClasspath = append(selectedClasspath, entry)
+ }
+ }
+
+ return bestImage.Image, selectedClasspath, nil
+ }
+
+ // return default selection
+ return "fabric8/s2i-java:2.3", libraries, nil
+ })
+}
+
+func packager(ctx *Context, selector ArtifactsSelector) error {
+ imageName, selectedArtifacts, err := selector(ctx.Libraries)
+ if err != nil {
+ return err
+ }
+
+ tarFileName := path.Join(ctx.Path, "package", "occi.tar")
+ tarFileDir := path.Dir(tarFileName)
+
+ err = os.MkdirAll(tarFileDir, 0777)
+ if err != nil {
+ return err
+ }
+
+ tarAppender, err := tar.NewAppender(tarFileName)
+ if err != nil {
+ return err
+ }
+ defer tarAppender.Close()
+
+ tarDir := "dependencies/"
+ for _, entry := range selectedArtifacts {
+ gav, err := maven.ParseGAV(entry.ID)
+ if err != nil {
+ return err
+ }
+
+ tarPath := path.Join(tarDir, gav.GroupID)
+ _, err = tarAppender.AddFile(entry.Location, tarPath)
+ if err != nil {
+ return err
+ }
+ }
+
+ cp := ""
+ for _, entry := range ctx.Libraries {
+ gav, err := maven.ParseGAV(entry.ID)
+ if err != nil {
+ return nil
+ }
+ tarPath := path.Join(tarDir, gav.GroupID)
+ _, fileName := path.Split(entry.Location)
+ fileName = path.Join(tarPath, fileName)
+ cp += fileName + "\n"
+ }
+
+ err = tarAppender.AppendData([]byte(cp), "classpath")
+ if err != nil {
+ return err
+ }
+
+ ctx.Image = imageName //"fabric8/s2i-java:2.3"
+ ctx.Archive = tarFileName
+
+ return nil
+}
+
+// ListPublishedImages --
+func ListPublishedImages(namespace string) ([]PublishedImage, error) {
+ list := v1alpha1.NewIntegrationContextList()
+
+ err := sdk.List(namespace, &list, sdk.WithListOptions(&metav1.ListOptions{}))
+ if err != nil {
+ return nil, err
+ }
+ images := make([]PublishedImage, 0)
+ for _, ctx := range list.Items {
+ if ctx.Status.Phase != v1alpha1.IntegrationContextPhaseReady || ctx.Labels == nil {
+ continue
+ }
+ if ctxType, present := ctx.Labels["camel.apache.org/context.type"]; !present || ctxType != "platform" {
+ continue
+ }
+
+ images = append(images, PublishedImage{
+ Image: ctx.Status.Image,
+ Classpath: ctx.Status.Classpath,
+ })
+ }
+ return images, nil
+}
+
+// FindBestImage --
+func FindBestImage(images []PublishedImage, entries []v1alpha1.Artifact) (*PublishedImage, map[string]bool) {
+ if len(images) == 0 {
+ return nil, nil
+ }
+ requiredLibs := make(map[string]bool, len(entries))
+ for _, entry := range entries {
+ requiredLibs[entry.ID] = true
+ }
+
+ var bestImage PublishedImage
+ bestImageCommonLibs := make(map[string]bool, 0)
+ bestImageSurplusLibs := 0
+ for _, image := range images {
+ common := make(map[string]bool)
+ for _, id := range image.Classpath {
+ if _, ok := requiredLibs[id]; ok {
+ common[id] = true
+ }
+ }
+ numCommonLibs := len(common)
+ surplus := len(image.Classpath) - numCommonLibs
+ if surplus >= numCommonLibs/3 {
+ // Heuristic approach: if there are too many unrelated libraries, just use the base image
+ continue
+ }
+
+ if numCommonLibs > len(bestImageCommonLibs) || (numCommonLibs == len(bestImageCommonLibs) && surplus < bestImageSurplusLibs) {
+ bestImage = image
+ bestImageCommonLibs = common
+ bestImageSurplusLibs = surplus
+ }
+ }
+
+ return &bestImage, bestImageCommonLibs
+}
diff --git a/pkg/builder/builder_types.go b/pkg/builder/builder_types.go
new file mode 100644
index 0000000..7476b00
--- /dev/null
+++ b/pkg/builder/builder_types.go
@@ -0,0 +1,137 @@
+/*
+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 builder
+
+import (
+ "context"
+ "time"
+
+ "github.com/apache/camel-k/pkg/util/maven"
+
+ "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+)
+
+// Builder --
+type Builder interface {
+ Submit(request Request) Result
+ Purge(request Request)
+}
+
+// Step --
+type Step interface {
+ ID() string
+ Phase() int
+ Execute(*Context) error
+}
+
+type stepWrapper struct {
+ id string
+ phase int
+ task func(*Context) error
+}
+
+func (s *stepWrapper) ID() string {
+ return s.id
+}
+
+func (s *stepWrapper) Phase() int {
+ return s.phase
+}
+
+func (s *stepWrapper) Execute(ctx *Context) error {
+ return s.task(ctx)
+}
+
+// NewStep --
+func NewStep(ID string, phase int, task func(*Context) error) Step {
+ s := stepWrapper{
+ id: ID,
+ phase: phase,
+ task: task,
+ }
+
+ return &s
+}
+
+// Identifier --
+type Identifier struct {
+ Name string
+ Qualifier string
+}
+
+func (r *Identifier) String() string {
+ return r.Name + ":" + r.Qualifier
+}
+
+// Request --
+type Request struct {
+ Identifier Identifier
+ Platform v1alpha1.IntegrationPlatformSpec
+ Code v1alpha1.SourceSpec
+ Dependencies []string
+ Steps []Step
+}
+
+// Result represents the result of a build
+type Result struct {
+ Request Request
+ Status Status
+ Image string
+ Error error
+ Classpath []string
+ ProcessStartedAt time.Time
+ ProcessCompletedAt time.Time
+}
+
+// Context --
+type Context struct {
+ C context.Context
+ Namespace string
+ Values map[string]interface{}
+ Request Request
+ Project maven.Project
+ Path string
+ Libraries []v1alpha1.Artifact
+ Image string
+ Error error
+ StepsDone []string
+ Archive string
+}
+
+// PublishedImage --
+type PublishedImage struct {
+ Image string
+ Classpath []string
+}
+
+// Status --
+type Status int
+
+const (
+ // StatusSubmitted --
+ StatusSubmitted Status = iota
+
+ // StatusStarted --
+ StatusStarted
+
+ // StatusCompleted --
+ StatusCompleted
+
+ // StatusError --
+ StatusError
+)
diff --git a/pkg/build/packager/doc.go b/pkg/builder/builder_utils.go
similarity index 77%
rename from pkg/build/packager/doc.go
rename to pkg/builder/builder_utils.go
index cfa21c6..1a9fb62 100644
--- a/pkg/build/packager/doc.go
+++ b/pkg/builder/builder_utils.go
@@ -15,5 +15,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// Package packager contains strategies for building layers of a Docker image
-package packager
+package builder
+
+import "os"
+
+// MavenExtraOptions --
+func MavenExtraOptions() string {
+ if _, err := os.Stat("/tmp/artifacts/m2"); err == nil {
+ return "-Dmaven.repo.local=/tmp/artifacts/m2"
+ }
+ return "-Dcamel.noop=true"
+}
diff --git a/pkg/build/publish/doc.go b/pkg/builder/kaniko/kaniko.go
similarity index 68%
rename from pkg/build/publish/doc.go
rename to pkg/builder/kaniko/kaniko.go
index 19343a8..318958f 100644
--- a/pkg/build/publish/doc.go
+++ b/pkg/builder/kaniko/kaniko.go
@@ -15,5 +15,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// Package publish contains strategies for publishing integrations into a Docker registries
-package publish
+package kaniko
+
+import (
+ "github.com/apache/camel-k/pkg/builder"
+)
+
+// DefaultSteps --
+var DefaultSteps = []builder.Step{
+ builder.NewStep("generate", 10, builder.GenerateProject),
+ builder.NewStep("dependencies", 20, builder.ComputeDependencies),
+ builder.NewStep("packager", 30, builder.StandardPackager),
+ builder.NewStep("publisher", 40, Publisher),
+}
diff --git a/pkg/builder/kaniko/publisher.go b/pkg/builder/kaniko/publisher.go
new file mode 100644
index 0000000..3cc976b
--- /dev/null
+++ b/pkg/builder/kaniko/publisher.go
@@ -0,0 +1,120 @@
+/*
+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 kaniko
+
+import (
+ "io/ioutil"
+ "path"
+ "time"
+
+ "github.com/apache/camel-k/pkg/builder"
+ "github.com/apache/camel-k/pkg/util/tar"
+
+ "github.com/apache/camel-k/pkg/util/kubernetes"
+ "github.com/operator-framework/operator-sdk/pkg/sdk"
+ "github.com/pkg/errors"
+ "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// Publisher --
+func Publisher(ctx *builder.Context) error {
+ image := ctx.Request.Platform.Build.Registry + "/" + ctx.Namespace + "/camel-k-" + ctx.Request.Identifier.Name + ":" + ctx.Request.Identifier.Qualifier
+ baseDir, _ := path.Split(ctx.Archive)
+ contextDir := path.Join(baseDir, "context")
+ if err := tar.Extract(ctx.Archive, contextDir); err != nil {
+ return err
+ }
+
+ dockerFileContent := []byte(`
+ FROM ` + ctx.Image + `
+ ADD . /deployments
+ `)
+
+ err := ioutil.WriteFile(path.Join(contextDir, "Dockerfile"), dockerFileContent, 0777)
+ if err != nil {
+ return err
+ }
+
+ pod := v1.Pod{
+ TypeMeta: metav1.TypeMeta{
+ APIVersion: v1.SchemeGroupVersion.String(),
+ Kind: "Pod",
+ },
+ ObjectMeta: metav1.ObjectMeta{
+ Namespace: ctx.Namespace,
+ Name: "camel-k-" + ctx.Request.Identifier.Name,
+ },
+ Spec: v1.PodSpec{
+ Containers: []v1.Container{
+ {
+ Name: "kaniko",
+ Image: "gcr.io/kaniko-project/executor@sha256:f29393d9c8d40296e1692417089aa2023494bce9afd632acac7dd0aea763e5bc",
+ Args: []string{
+ "--dockerfile=Dockerfile",
+ "--context=" + contextDir,
+ "--destination=" + image,
+ "--insecure",
+ },
+ VolumeMounts: []v1.VolumeMount{
+ {
+ Name: "camel-k-builder",
+ MountPath: "/workspace",
+ },
+ },
+ },
+ },
+ RestartPolicy: v1.RestartPolicyNever,
+ Volumes: []v1.Volume{
+ {
+ Name: "camel-k-builder",
+ VolumeSource: v1.VolumeSource{
+ PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{
+ ClaimName: "camel-k-builder",
+ ReadOnly: true,
+ },
+ },
+ },
+ },
+ },
+ }
+
+ sdk.Delete(&pod)
+ err = sdk.Create(&pod)
+ if err != nil {
+ return errors.Wrap(err, "cannot create kaniko builder pod")
+ }
+
+ err = kubernetes.WaitCondition(&pod, func(obj interface{}) (bool, error) {
+ if val, ok := obj.(*v1.Pod); ok {
+ if val.Status.Phase == v1.PodSucceeded {
+ return true, nil
+ } else if val.Status.Phase == v1.PodFailed {
+ return false, errors.New("build failed")
+ }
+ }
+ return false, nil
+ }, 10*time.Minute)
+
+ if err != nil {
+ return err
+ }
+
+ ctx.Image = image
+ return nil
+}
diff --git a/pkg/build/publish/s2i_publisher.go b/pkg/builder/s2i/publisher.go
similarity index 52%
rename from pkg/build/publish/s2i_publisher.go
rename to pkg/builder/s2i/publisher.go
index 09a0105..e6b0d92 100644
--- a/pkg/build/publish/s2i_publisher.go
+++ b/pkg/builder/s2i/publisher.go
@@ -15,103 +15,38 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package publish
+package s2i
import (
- "context"
"io/ioutil"
"time"
- "github.com/apache/camel-k/pkg/build"
+ "github.com/apache/camel-k/pkg/builder"
+
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/kubernetes/customclient"
- buildv1 "github.com/openshift/api/build/v1"
- imagev1 "github.com/openshift/api/image/v1"
"github.com/operator-framework/operator-sdk/pkg/sdk"
"github.com/operator-framework/operator-sdk/pkg/util/k8sutil"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
-)
-
-type s2iPublisher struct {
- buffer chan s2iPublishOperation
- namespace string
-}
-type s2iPublishOperation struct {
- request build.Request
- assembled build.AssembledOutput
- packaged build.PackagedOutput
- output chan build.PublishedOutput
-}
-
-// NewS2IPublisher creates a new publisher doing a Openshift S2I binary build
-func NewS2IPublisher(ctx context.Context, namespace string) build.Publisher {
- publisher := s2iPublisher{
- buffer: make(chan s2iPublishOperation, 100),
- namespace: namespace,
- }
- go publisher.publishCycle(ctx)
- return &publisher
-}
-
-func (b *s2iPublisher) Publish(request build.Request, assembled build.AssembledOutput, packaged build.PackagedOutput) <-chan build.PublishedOutput {
- res := make(chan build.PublishedOutput, 1)
- op := s2iPublishOperation{
- request: request,
- assembled: assembled,
- packaged: packaged,
- output: res,
- }
- b.buffer <- op
- return res
-}
-
-func (b *s2iPublisher) publishCycle(ctx context.Context) {
- for {
- select {
- case <-ctx.Done():
- b.buffer = nil
- return
- case op := <-b.buffer:
- now := time.Now()
- logrus.Info("Starting a new image publication")
- res := b.execute(op.request, op.assembled, op.packaged)
- elapsed := time.Now().Sub(now)
-
- if res.Error != nil {
- logrus.Error("Error during publication (total time ", elapsed.Seconds(), " seconds): ", res.Error)
- } else {
- logrus.Info("Publication completed in ", elapsed.Seconds(), " seconds")
- }
-
- op.output <- res
- }
- }
-}
-
-func (b *s2iPublisher) execute(request build.Request, assembled build.AssembledOutput, packaged build.PackagedOutput) build.PublishedOutput {
- image, err := b.publish(packaged.TarFile, packaged.BaseImage, request)
- if err != nil {
- return build.PublishedOutput{Error: err}
- }
-
- return build.PublishedOutput{Image: image}
-}
+ buildv1 "github.com/openshift/api/build/v1"
+ imagev1 "github.com/openshift/api/image/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-func (b *s2iPublisher) publish(tarFile string, imageName string, source build.Request) (string, error) {
+ "github.com/pkg/errors"
+)
+// Publisher --
+func Publisher(ctx *builder.Context) error {
bc := buildv1.BuildConfig{
TypeMeta: metav1.TypeMeta{
APIVersion: buildv1.SchemeGroupVersion.String(),
Kind: "BuildConfig",
},
ObjectMeta: metav1.ObjectMeta{
- Name: "camel-k-" + source.Identifier.Name,
- Namespace: b.namespace,
+ Name: "camel-k-" + ctx.Request.Identifier.Name,
+ Namespace: ctx.Namespace,
},
Spec: buildv1.BuildConfigSpec{
CommonSpec: buildv1.CommonSpec{
@@ -122,14 +57,14 @@ func (b *s2iPublisher) publish(tarFile string, imageName string, source build.Re
SourceStrategy: &buildv1.SourceBuildStrategy{
From: v1.ObjectReference{
Kind: "DockerImage",
- Name: imageName,
+ Name: ctx.Image,
},
},
},
Output: buildv1.BuildOutput{
To: &v1.ObjectReference{
Kind: "ImageStreamTag",
- Name: "camel-k-" + source.Identifier.Name + ":" + source.Identifier.Qualifier,
+ Name: "camel-k-" + ctx.Request.Identifier.Name + ":" + ctx.Request.Identifier.Qualifier,
},
},
},
@@ -139,7 +74,7 @@ func (b *s2iPublisher) publish(tarFile string, imageName string, source build.Re
sdk.Delete(&bc)
err := sdk.Create(&bc)
if err != nil {
- return "", errors.Wrap(err, "cannot create build config")
+ return errors.Wrap(err, "cannot create build config")
}
is := imagev1.ImageStream{
@@ -148,8 +83,8 @@ func (b *s2iPublisher) publish(tarFile string, imageName string, source build.Re
Kind: "ImageStream",
},
ObjectMeta: metav1.ObjectMeta{
- Name: "camel-k-" + source.Identifier.Name,
- Namespace: b.namespace,
+ Name: "camel-k-" + ctx.Request.Identifier.Name,
+ Namespace: ctx.Namespace,
},
Spec: imagev1.ImageStreamSpec{
LookupPolicy: imagev1.ImageLookupPolicy{
@@ -161,45 +96,45 @@ func (b *s2iPublisher) publish(tarFile string, imageName string, source build.Re
sdk.Delete(&is)
err = sdk.Create(&is)
if err != nil {
- return "", errors.Wrap(err, "cannot create image stream")
+ return errors.Wrap(err, "cannot create image stream")
}
- resource, err := ioutil.ReadFile(tarFile)
+ resource, err := ioutil.ReadFile(ctx.Archive)
if err != nil {
- return "", errors.Wrap(err, "cannot fully read tar file "+tarFile)
+ return errors.Wrap(err, "cannot fully read tar file "+ctx.Archive)
}
restClient, err := customclient.GetClientFor("build.openshift.io", "v1")
if err != nil {
- return "", err
+ return err
}
result := restClient.Post().
- Namespace(b.namespace).
+ Namespace(ctx.Namespace).
Body(resource).
Resource("buildconfigs").
- Name("camel-k-" + source.Identifier.Name).
+ Name("camel-k-" + ctx.Request.Identifier.Name).
SubResource("instantiatebinary").
Do()
if result.Error() != nil {
- return "", errors.Wrap(result.Error(), "cannot instantiate binary")
+ return errors.Wrap(result.Error(), "cannot instantiate binary")
}
data, err := result.Raw()
if err != nil {
- return "", errors.Wrap(err, "no raw data retrieved")
+ return errors.Wrap(err, "no raw data retrieved")
}
u := unstructured.Unstructured{}
err = u.UnmarshalJSON(data)
if err != nil {
- return "", errors.Wrap(err, "cannot unmarshal instantiate binary response")
+ return errors.Wrap(err, "cannot unmarshal instantiate binary response")
}
ocbuild, err := k8sutil.RuntimeObjectFromUnstructured(&u)
if err != nil {
- return "", err
+ return err
}
err = kubernetes.WaitCondition(ocbuild, func(obj interface{}) (bool, error) {
@@ -217,11 +152,14 @@ func (b *s2iPublisher) publish(tarFile string, imageName string, source build.Re
err = sdk.Get(&is)
if err != nil {
- return "", err
+ return err
}
if is.Status.DockerImageRepository == "" {
- return "", errors.New("dockerImageRepository not available in ImageStream")
+ return errors.New("dockerImageRepository not available in ImageStream")
}
- return is.Status.DockerImageRepository + ":" + source.Identifier.Qualifier, nil
+
+ ctx.Image = is.Status.DockerImageRepository + ":" + ctx.Request.Identifier.Qualifier
+
+ return nil
}
diff --git a/pkg/build/packager/types.go b/pkg/builder/s2i/s2i.go
similarity index 68%
rename from pkg/build/packager/types.go
rename to pkg/builder/s2i/s2i.go
index d424457..3dd6d5e 100644
--- a/pkg/build/packager/types.go
+++ b/pkg/builder/s2i/s2i.go
@@ -15,15 +15,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package packager
+package s2i
-// PublishedImage represent a base image that can be used as starting point
-type PublishedImage struct {
- Image string
- Classpath []string
-}
+import "github.com/apache/camel-k/pkg/builder"
-// PublishedImagesLister allows to list all images already published
-type PublishedImagesLister interface {
- ListPublishedImages() ([]PublishedImage, error)
+// DefaultSteps --
+var DefaultSteps = []builder.Step{
+ builder.NewStep("generate", 10, builder.GenerateProject),
+ builder.NewStep("dependencies", 20, builder.ComputeDependencies),
+ builder.NewStep("packager", 30, builder.IncrementalPackager),
+ builder.NewStep("publisher", 40, Publisher),
}
diff --git a/pkg/platform/build.go b/pkg/platform/build.go
index 6e75ad2..7b6332a 100644
--- a/pkg/platform/build.go
+++ b/pkg/platform/build.go
@@ -20,78 +20,53 @@ package platform
import (
"context"
"errors"
+
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
- "github.com/apache/camel-k/pkg/build"
- "github.com/apache/camel-k/pkg/build/assemble"
- "github.com/apache/camel-k/pkg/build/packager"
- "github.com/apache/camel-k/pkg/build/publish"
- "github.com/operator-framework/operator-sdk/pkg/sdk"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "github.com/apache/camel-k/pkg/builder"
+ "github.com/apache/camel-k/pkg/builder/kaniko"
+ "github.com/apache/camel-k/pkg/builder/s2i"
)
-// buildManager is the current build manager
+// gBuilder is the current builder
// Note: it cannot be changed at runtime, needs a operator restart
-var buildManager *build.Manager
-
-// GetPlatformBuildManager returns a suitable build manager for the current platform
-func GetPlatformBuildManager(ctx context.Context, namespace string) (*build.Manager, error) {
- if buildManager != nil {
- return buildManager, nil
- }
- pl, err := GetCurrentPlatform(namespace)
- if err != nil {
- return nil, err
- }
-
- assembler := assemble.NewMavenAssembler(ctx)
- if pl.Spec.Build.PublishStrategy == v1alpha1.IntegrationPlatformBuildPublishStrategyS2I {
- packaging := packager.NewS2IIncrementalPackager(ctx, newContextLister(namespace))
- publisher := publish.NewS2IPublisher(ctx, namespace)
- buildManager = build.NewManager(ctx, assembler, packaging, publisher)
- } else if pl.Spec.Build.PublishStrategy == v1alpha1.IntegrationPlatformBuildPublishStrategyKaniko && pl.Spec.Build.Registry != "" {
- packaging := packager.NewJavaStandardPackager(ctx)
- publisher := publish.NewKanikoPublisher(ctx, namespace, pl.Spec.Build.Registry)
- buildManager = build.NewManager(ctx, assembler, packaging, publisher)
- }
+var gBuilder builder.Builder
- if buildManager == nil {
- return nil, errors.New("unsupported platform configuration")
+// GetPlatformBuilder --
+func GetPlatformBuilder(ctx context.Context, namespace string) (builder.Builder, error) {
+ if gBuilder != nil {
+ return gBuilder, nil
}
- return buildManager, nil
-}
-// =================================================================
+ gBuilder = builder.New(ctx, namespace)
-type contextLister struct {
- namespace string
+ return gBuilder, nil
}
-func newContextLister(namespace string) contextLister {
- return contextLister{
- namespace: namespace,
+// NewBuildRequest --
+func NewBuildRequest(ctx context.Context, context *v1alpha1.IntegrationContext) (builder.Request, error) {
+ req := builder.Request{
+ Identifier: builder.Identifier{
+ Name: "context-" + context.Name,
+ Qualifier: context.ResourceVersion,
+ },
+ Dependencies: context.Spec.Dependencies,
+ Steps: kaniko.DefaultSteps,
}
-}
-func (l contextLister) ListPublishedImages() ([]packager.PublishedImage, error) {
- list := v1alpha1.NewIntegrationContextList()
-
- err := sdk.List(l.namespace, &list, sdk.WithListOptions(&metav1.ListOptions{}))
+ p, err := GetCurrentPlatform(context.Namespace)
if err != nil {
- return nil, err
+ return req, err
}
- images := make([]packager.PublishedImage, 0)
- for _, ctx := range list.Items {
- if ctx.Status.Phase != v1alpha1.IntegrationContextPhaseReady || ctx.Labels == nil {
- continue
- }
- if ctxType, present := ctx.Labels["camel.apache.org/context.type"]; !present || ctxType != "platform" {
- continue
- }
- images = append(images, packager.PublishedImage{
- Image: ctx.Status.Image,
- Classpath: ctx.Status.Classpath,
- })
+ req.Platform = p.Spec
+
+ if SupportsS2iPublishStrategy(p) {
+ req.Steps = s2i.DefaultSteps
+ } else if SupportsKanikoPublishStrategy(p) {
+ req.Steps = kaniko.DefaultSteps
+ } else {
+ return req, errors.New("unsupported platform configuration")
}
- return images, nil
+
+ return req, nil
}
diff --git a/pkg/platform/get.go b/pkg/platform/get.go
index c894818..afc9268 100644
--- a/pkg/platform/get.go
+++ b/pkg/platform/get.go
@@ -19,6 +19,7 @@ package platform
import (
"errors"
+
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/operator-framework/operator-sdk/pkg/sdk"
)
@@ -64,4 +65,14 @@ func GetProfile(p *v1alpha1.IntegrationPlatform) v1alpha1.TraitProfile {
return v1alpha1.TraitProfileOpenShift
}
return ""
-}
\ No newline at end of file
+}
+
+// SupportsS2iPublishStrategy --
+func SupportsS2iPublishStrategy(p *v1alpha1.IntegrationPlatform) bool {
+ return p.Spec.Build.PublishStrategy == v1alpha1.IntegrationPlatformBuildPublishStrategyS2I
+}
+
+// SupportsKanikoPublishStrategy --
+func SupportsKanikoPublishStrategy(p *v1alpha1.IntegrationPlatform) bool {
+ return p.Spec.Build.PublishStrategy == v1alpha1.IntegrationPlatformBuildPublishStrategyKaniko && p.Spec.Build.Registry != ""
+}
diff --git a/pkg/stub/action/context/build.go b/pkg/stub/action/context/build.go
index 831218f..cc34101 100644
--- a/pkg/stub/action/context/build.go
+++ b/pkg/stub/action/context/build.go
@@ -20,15 +20,14 @@ package context
import (
"context"
+ "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+ "github.com/apache/camel-k/pkg/builder"
"github.com/apache/camel-k/pkg/platform"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/operator-framework/operator-sdk/pkg/sdk"
"github.com/sirupsen/logrus"
-
- "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
- "github.com/apache/camel-k/pkg/build"
)
// NewBuildAction creates a new build handling action for the context
@@ -51,38 +50,37 @@ func (action *buildAction) CanHandle(context *v1alpha1.IntegrationContext) bool
}
func (action *buildAction) Handle(context *v1alpha1.IntegrationContext) error {
- buildManager, err := platform.GetPlatformBuildManager(action.Context, context.Namespace)
+ b, err := platform.GetPlatformBuilder(action.Context, context.Namespace)
if err != nil {
return err
}
-
- buildIdentifier := build.Identifier{
- Name: "context-" + context.Name,
- Qualifier: context.ResourceVersion,
+ r, err := platform.NewBuildRequest(action.Context, context)
+ if err != nil {
+ return err
}
- buildResult := buildManager.Get(buildIdentifier)
- if buildResult.Status == build.StatusNotRequested {
- buildManager.Start(build.Request{
- Identifier: buildIdentifier,
- Dependencies: context.Spec.Dependencies,
- })
+ res := b.Submit(r)
+ if res.Status == builder.StatusSubmitted {
+ logrus.Info("Build submitted")
+ } else if res.Status == builder.StatusStarted {
logrus.Info("Build started")
- } else if buildResult.Status == build.StatusError {
+ } else if res.Status == builder.StatusError {
target := context.DeepCopy()
- logrus.Info("Context ", target.Name, " transitioning to state ", v1alpha1.IntegrationContextPhaseError)
target.Status.Phase = v1alpha1.IntegrationContextPhaseError
+
+ logrus.Info("Context ", target.Name, " transitioning to state ", v1alpha1.IntegrationContextPhaseError)
+
+ // remove the build from cache
+ b.Purge(r)
+
return sdk.Update(target)
- } else if buildResult.Status == build.StatusCompleted {
+ } else if res.Status == builder.StatusCompleted {
target := context.DeepCopy()
- target.Status.Image = buildResult.Image
- logrus.Info("Context ", target.Name, " transitioning to state ", v1alpha1.IntegrationContextPhaseReady)
+ target.Status.Image = res.Image
target.Status.Phase = v1alpha1.IntegrationContextPhaseReady
+ target.Status.Classpath = res.Classpath
- target.Status.Classpath = make([]string, len(buildResult.Classpath))
- for i, entry := range buildResult.Classpath {
- target.Status.Classpath[i] = entry.ID
- }
+ logrus.Info("Context ", target.Name, " transitioning to state ", v1alpha1.IntegrationContextPhaseReady)
if err := sdk.Update(target); err != nil {
return err
@@ -90,6 +88,9 @@ func (action *buildAction) Handle(context *v1alpha1.IntegrationContext) error {
if err := action.informIntegrations(target); err != nil {
return err
}
+
+ // remove the build from cache
+ b.Purge(r)
}
return nil
diff --git a/pkg/util/maven/maven.go b/pkg/util/maven/maven.go
index 5550122..019723b 100644
--- a/pkg/util/maven/maven.go
+++ b/pkg/util/maven/maven.go
@@ -20,19 +20,14 @@ package maven
import (
"bytes"
"encoding/xml"
- "fmt"
- "io/ioutil"
"os"
"os/exec"
- "path"
"regexp"
"strings"
- "github.com/apache/camel-k/version"
+ "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+ "github.com/apache/camel-k/pkg/util"
- "gopkg.in/yaml.v2"
-
- "github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -42,76 +37,35 @@ const (
// BuildResult --
type BuildResult struct {
- Classpath []ClasspathLibrary
-}
-
-// ClasspathLibrary --
-type ClasspathLibrary struct {
- ID string `json:"id" yaml:"id"`
- Location string `json:"location,omitempty" yaml:"location,omitempty"`
+ Classpath []v1alpha1.Artifact
}
-// Process takes a project description and returns a binary tar with the built artifacts
-func Process(project Project) (BuildResult, error) {
- res := BuildResult{}
- buildDir, err := ioutil.TempDir("", buildDirPrefix)
- if err != nil {
- return res, errors.Wrap(err, "could not create temporary dir for maven source files")
- }
-
- defer os.RemoveAll(buildDir)
-
- err = createMavenStructure(buildDir, project)
- if err != nil {
- return res, errors.Wrap(err, "could not write maven source files")
- }
- err = runMavenBuild(buildDir, &res)
- return res, err
-}
-
-func runMavenBuild(buildDir string, result *BuildResult) error {
- goal := fmt.Sprintf("org.apache.camel.k:camel-k-runtime-dependency-lister:%s:generate-dependency-list", version.Version)
- cmd := exec.Command("mvn", mavenExtraOptions(), goal)
- cmd.Dir = buildDir
- cmd.Stdout = os.Stdout
- cmd.Stderr = os.Stderr
+// GeneratePomContent generate a pom.xml file from the given project definition
+func GeneratePomContent(project Project) (string, error) {
+ w := &bytes.Buffer{}
+ w.WriteString(xml.Header)
- logrus.Infof("determine classpath: %v", cmd.Args)
- if err := cmd.Run(); err != nil {
- return errors.Wrap(err, "failure while determining classpath")
- }
+ e := xml.NewEncoder(w)
+ e.Indent("", " ")
- dependencies := path.Join(buildDir, "target", "dependencies.yaml")
- content, err := ioutil.ReadFile(dependencies)
+ err := e.Encode(project)
if err != nil {
- return err
- }
-
- cp := make(map[string][]ClasspathLibrary)
- if err := yaml.Unmarshal(content, &cp); err != nil {
- return err
+ return "", err
}
- result.Classpath = cp["dependencies"]
-
- logrus.Info("Maven build completed successfully")
- return nil
+ return w.String(), nil
}
-func mavenExtraOptions() string {
- if _, err := os.Stat("/tmp/artifacts/m2"); err == nil {
- return "-Dmaven.repo.local=/tmp/artifacts/m2"
- }
- return "-Dcamel.noop=true"
-}
+// CreateStructure --
+func CreateStructure(buildDir string, project Project) error {
+ logrus.Infof("write project: %+v", project)
-func createMavenStructure(buildDir string, project Project) error {
- pom, err := GeneratePomFileContent(project)
+ pom, err := GeneratePomContent(project)
if err != nil {
return err
}
- err = writeFile(buildDir, "pom.xml", pom)
+ err = util.WriteFileWithContent(buildDir, "pom.xml", pom)
if err != nil {
return err
}
@@ -119,42 +73,25 @@ func createMavenStructure(buildDir string, project Project) error {
return nil
}
-func writeFile(buildDir string, relativePath string, content string) error {
- filePath := path.Join(buildDir, relativePath)
- fileDir := path.Dir(filePath)
- // Create dir if not present
- err := os.MkdirAll(fileDir, 0777)
- if err != nil {
- return errors.Wrap(err, "could not create dir for file "+relativePath)
+// Run --
+func Run(buildDir string, args ...string) error {
+ mvnCmd := "mvn"
+ if c, ok := os.LookupEnv("MAVEN_CMD"); ok {
+ mvnCmd = c
}
- // Create file
- file, err := os.Create(filePath)
- if err != nil {
- return errors.Wrap(err, "could not create file "+relativePath)
- }
- defer file.Close()
- _, err = file.WriteString(content)
- if err != nil {
- errors.Wrap(err, "could not write to file "+relativePath)
- }
- return nil
-}
+ l := logrus.WithFields(logrus.Fields{
+ "logger": "maven",
+ })
-// GeneratePomFileContent generate a pom.xml file from the given project definition
-func GeneratePomFileContent(project Project) (string, error) {
- w := &bytes.Buffer{}
- w.WriteString(xml.Header)
-
- e := xml.NewEncoder(w)
- e.Indent("", " ")
+ cmd := exec.Command(mvnCmd, args...)
+ cmd.Dir = buildDir
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
- err := e.Encode(project)
- if err != nil {
- return "", err
- }
+ l.Infof("execute: %s", strings.Join(cmd.Args, " "))
- return w.String(), nil
+ return cmd.Run()
}
// ParseGAV decode a maven artifact id to a dependency definition.
diff --git a/pkg/util/maven/maven_test.go b/pkg/util/maven/maven_test.go
index d21109c..e7f5685 100644
--- a/pkg/util/maven/maven_test.go
+++ b/pkg/util/maven/maven_test.go
@@ -146,7 +146,7 @@ func TestPomGeneration(t *testing.T) {
},
}
- pom, err := GeneratePomFileContent(project)
+ pom, err := GeneratePomContent(project)
assert.Nil(t, err)
assert.NotNil(t, pom)
diff --git a/pkg/build/assemble/doc.go b/pkg/util/tar/extract.go
similarity index 50%
rename from pkg/build/assemble/doc.go
rename to pkg/util/tar/extract.go
index 20b1d42..4592a6e 100644
--- a/pkg/build/assemble/doc.go
+++ b/pkg/util/tar/extract.go
@@ -15,5 +15,45 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// Package assemble contains tools that convert source files and dependencies into the integration classpath
-package assemble
+package tar
+
+import (
+ "io"
+ "io/ioutil"
+ "os"
+ "path"
+
+ tarutils "archive/tar"
+)
+
+// Extract --
+func Extract(source string, destinationBase string) error {
+ file, err := os.Open(source)
+ if err != nil {
+ return err
+ }
+ defer file.Close()
+ reader := tarutils.NewReader(file)
+ for {
+ header, err := reader.Next()
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ return err
+ }
+ targetName := path.Join(destinationBase, header.Name)
+ targetDir, _ := path.Split(targetName)
+ if err := os.MkdirAll(targetDir, 0777); err != nil {
+ return err
+ }
+ buffer, err := ioutil.ReadAll(reader)
+ if err != nil {
+ return err
+ }
+ if err := ioutil.WriteFile(targetName, buffer, os.FileMode(header.Mode)); err != nil {
+ return err
+ }
+ }
+ return nil
+}
diff --git a/pkg/util/util.go b/pkg/util/util.go
index dcfbd36..fba0619 100644
--- a/pkg/util/util.go
+++ b/pkg/util/util.go
@@ -20,7 +20,10 @@ package util
import (
"os"
"os/signal"
+ "path"
"syscall"
+
+ "github.com/pkg/errors"
)
// StringSliceContains --
@@ -72,3 +75,26 @@ func WaitForSignal(sig chan os.Signal, exit func(int)) {
exit(1)
}()
}
+
+// WriteFileWithContent --
+func WriteFileWithContent(buildDir string, relativePath string, content string) error {
+ filePath := path.Join(buildDir, relativePath)
+ fileDir := path.Dir(filePath)
+ // Create dir if not present
+ err := os.MkdirAll(fileDir, 0777)
+ if err != nil {
+ return errors.Wrap(err, "could not create dir for file "+relativePath)
+ }
+ // Create file
+ file, err := os.Create(filePath)
+ if err != nil {
+ return errors.Wrap(err, "could not create file "+relativePath)
+ }
+ defer file.Close()
+
+ _, err = file.WriteString(content)
+ if err != nil {
+ errors.Wrap(err, "could not write to file "+relativePath)
+ }
+ return nil
+}
diff --git a/test/build_manager_integration_test.go b/test/build_manager_integration_test.go
index b7124f2..63fcc12 100644
--- a/test/build_manager_integration_test.go
+++ b/test/build_manager_integration_test.go
@@ -23,87 +23,87 @@ package test
import (
"context"
- "github.com/apache/camel-k/pkg/build/assemble"
- "github.com/apache/camel-k/pkg/build/packager"
- "github.com/apache/camel-k/pkg/build/publish"
"testing"
"time"
- "github.com/apache/camel-k/pkg/build"
+ "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+ "github.com/apache/camel-k/pkg/builder"
+ "github.com/apache/camel-k/pkg/builder/s2i"
"github.com/apache/camel-k/pkg/util/digest"
+
"github.com/stretchr/testify/assert"
)
func TestBuildManagerBuild(t *testing.T) {
ctx := context.TODO()
namespace := getTargetNamespace()
- assembler := assemble.NewMavenAssembler(ctx)
- pack := packager.NewJavaStandardPackager(ctx)
- publisher := publish.NewS2IPublisher(ctx, namespace)
- buildManager := build.NewManager(ctx, assembler, pack, publisher)
- identifier := build.Identifier{
- Name: "man-test",
- Qualifier: digest.Random(),
- }
- buildManager.Start(build.Request{
- Identifier: identifier,
- Code: build.Source{
+ b := builder.New(ctx, namespace)
+
+ r := builder.Request{
+ Identifier: builder.Identifier{
+ Name: "man-test",
+ Qualifier: digest.Random(),
+ },
+ Code: v1alpha1.SourceSpec{
Content: createTimerToLogIntegrationCode(),
},
Dependencies: []string{
"mvn:org.apache.camel/camel-core",
"camel:telegram",
},
- })
+ Steps: s2i.DefaultSteps,
+ }
+
+ b.Submit(r)
deadline := time.Now().Add(5 * time.Minute)
- var result build.Result
+ var result builder.Result
+
for time.Now().Before(deadline) {
- result = buildManager.Get(identifier)
- if result.Status == build.StatusCompleted || result.Status == build.StatusError {
+ result = b.Submit(r)
+ if result.Status == builder.StatusCompleted || result.Status == builder.StatusError {
break
}
time.Sleep(2 * time.Second)
}
- assert.NotEqual(t, build.StatusError, result.Status)
- assert.Equal(t, build.StatusCompleted, result.Status)
+ assert.NotEqual(t, builder.StatusError, result.Status)
+ assert.Equal(t, builder.StatusCompleted, result.Status)
assert.Regexp(t, ".*/.*/.*:.*", result.Image)
}
func TestBuildManagerFailedBuild(t *testing.T) {
-
ctx := context.TODO()
namespace := getTargetNamespace()
- assembler := assemble.NewMavenAssembler(ctx)
- pack := packager.NewJavaStandardPackager(ctx)
- publisher := publish.NewS2IPublisher(ctx, namespace)
- buildManager := build.NewManager(ctx, assembler, pack, publisher)
- identifier := build.Identifier{
- Name: "man-test-2",
- Qualifier: digest.Random(),
- }
- buildManager.Start(build.Request{
- Identifier: identifier,
- Code: build.Source{
+ b := builder.New(ctx, namespace)
+
+ r := builder.Request{
+ Identifier: builder.Identifier{
+ Name: "man-test",
+ Qualifier: digest.Random(),
+ },
+ Code: v1alpha1.SourceSpec{
Content: createTimerToLogIntegrationCode(),
},
Dependencies: []string{
"mvn:org.apache.camel/camel-cippalippa",
},
- })
+ Steps: s2i.DefaultSteps,
+ }
+
+ b.Submit(r)
deadline := time.Now().Add(5 * time.Minute)
- var result build.Result
+ var result builder.Result
for time.Now().Before(deadline) {
- result = buildManager.Get(identifier)
- if result.Status == build.StatusCompleted || result.Status == build.StatusError {
+ result = b.Submit(r)
+ if result.Status == builder.StatusCompleted || result.Status == builder.StatusError {
break
}
time.Sleep(2 * time.Second)
}
- assert.Equal(t, build.StatusError, result.Status)
- assert.NotEqual(t, build.StatusCompleted, result.Status)
+ assert.Equal(t, builder.StatusError, result.Status)
+ assert.NotEqual(t, builder.StatusCompleted, result.Status)
assert.Empty(t, result.Image)
}