blob: 2e0c63d94a02649c7d0cf3bb1ad309dc9482f104 [file] [log] [blame]
# 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.
variables:
IMAGE_NAME: $REGISTRY_HOST/$CI_PROJECT_PATH
DOCKER_HUB_IMAGE_NAME: streampipes
MAVEN_CLI_OPTS: -DskipTests --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true
HARBOR_IMAGE_NAME: $HARBOR_REGISTRY_HOST/$CI_PROJECT_PATH
GIT_REPO_ORIGIN: $GIT_REPO_ORIGIN
GIT_STRATEGY: clone
stages:
- github
- build
- docker
pull github:
image: maven:3-jdk-8
stage: github
script:
- git remote set-url origin $GIT_REPO_ORIGIN/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME.git
- git remote add github https://github.com/apache/incubator-streampipes-extensions.git
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH")
- mkdir ~/.ssh
- touch ~/.ssh/known_hosts
- ssh-keyscan -p 2222 -t rsa $GITLAB_HOST > ~/.ssh/known_hosts
- git config --global user.email '$USER_EMAIL'
- git config --global user.name '$USER_NAME'
- git checkout dev
- git pull github dev --allow-unrelated-histories
- git push origin --all
build:
image: maven:3.6.1-jdk-8
stage: build
script:
- echo "$GPG_PRIVATE_KEY" | gpg --batch --import --passphrase "$GPG_PASSPHRASE"
- echo "$MAVEN_CREDENTIALS" > /root/.m2/settings.xml
- mvn clean package javadoc:aggregate -U -DskipTests -Denforcer.skip
- export MVN_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)
- echo $MVN_VERSION >> ./target/mvn_version
artifacts:
paths:
- ./*/target/*.jar
- ./streampipes-connect-adapters/streampipes-connect-adapter/target/*.jar
- ./target/mvn_version
expire_in: 1 hour
except:
- /release-.*$/
docker-connect-container:
image: docker:17.06.0-ce
stage: docker
dependencies:
- build
script:
- export MVN_VERSION=$(cat ./target/mvn_version)
- cd streampipes-connect-adapters/streampipes-connect-adapter
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $REGISTRY_HOST
- docker login -u $USER_EMAIL -p $HARBOR_PASSWORD $HARBOR_REGISTRY_HOST
- docker build --pull -t $IMAGE_NAME/streampipes-connect-worker:latest -t $IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION -t $HARBOR_IMAGE_NAME/streampipes-connect-worker:latest -t $HARBOR_IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION .
- docker push $IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION
- docker push $IMAGE_NAME/streampipes-connect-worker:latest
- docker push $HARBOR_IMAGE_NAME/streampipes-connect-worker:$MVN_VERSION
- docker push $HARBOR_IMAGE_NAME/streampipes-connect-worker:latest
only:
- dev
.docker_script: &docker_script
image: docker:17.06.0-ce
stage: docker
dependencies:
- build
script:
- export MVN_VERSION=$(cat ./target/mvn_version)
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $REGISTRY_HOST
- docker login -u $USER_EMAIL -p $HARBOR_PASSWORD $HARBOR_REGISTRY_HOST
- docker build --no-cache --pull -t $IMAGE_NAME/$CONTAINER_NAME:latest -t $IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION -t $HARBOR_IMAGE_NAME/$CONTAINER_NAME:latest -t $HARBOR_IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION ./streampipes-$CONTAINER_NAME
- docker push $IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION
- docker push $IMAGE_NAME/$CONTAINER_NAME:latest
- docker push $HARBOR_IMAGE_NAME/$CONTAINER_NAME:$MVN_VERSION
- docker push $HARBOR_IMAGE_NAME/$CONTAINER_NAME:latest
only:
- dev
docker-pe-all-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "pipeline-elements-all-jvm"
docker-processors-aggregation-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-aggregation-flink"
docker-processors-enricher-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-enricher-flink"
docker-processors-enricher-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-enricher-jvm"
docker-processors-filters-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-filters-jvm"
docker-processors-geo-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-geo-jvm"
docker-processors-image-processing-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-image-processing-jvm"
docker-processors-pattern-detection-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-pattern-detection-flink"
docker-processors-filters-siddhi:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-filters-siddhi"
docker-processors-statistics-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-statistics-flink"
docker-processors-geo-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-geo-flink"
docker-processors-transformation-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-transformation-flink"
docker-processors-transformation-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-transformation-jvm"
docker-processors-text-mining-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "processors-text-mining-jvm"
docker-sinks-brokers-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-brokers-jvm"
docker-sinks-databases-flink:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-databases-flink"
docker-sinks-databases-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-databases-jvm"
docker-sinks-notifications-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-notifications-jvm"
docker-sinks-internal-jvm:
<<: *docker_script
variables:
CONTAINER_NAME: "sinks-internal-jvm"
docker-sources-vehicle-simulator:
<<: *docker_script
variables:
CONTAINER_NAME: "sources-vehicle-simulator"
docker-sources-watertank-simulator:
<<: *docker_script
variables:
CONTAINER_NAME: "sources-watertank-simulator"