Merge "New JJB files for sample_vnf project"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 27 Jul 2018 15:52:56 +0000 (15:52 +0000)
committerGerrit Code Review <gerrit@akraino.org>
Fri, 27 Jul 2018 15:52:56 +0000 (15:52 +0000)
jjb/airshipinabottle_deploy/airshipinabottle_deploy.yaml [new file with mode: 0644]
jjb/akraino-templates/akraino-jjb-docker.yaml [new file with mode: 0644]
jjb/shell/build-docker.sh [new file with mode: 0644]

diff --git a/jjb/airshipinabottle_deploy/airshipinabottle_deploy.yaml b/jjb/airshipinabottle_deploy/airshipinabottle_deploy.yaml
new file mode 100644 (file)
index 0000000..1aac7cd
--- /dev/null
@@ -0,0 +1,42 @@
+---
+#
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+- project:
+    name: airshipinabottle_deploy
+    project-name: airshipinabottle_deploy
+    project: airshipinabottle_deploy
+    global-settings-file: global-settings
+    build-node: centos7-builder-2c-1g
+    stream: master
+    maven-repo-url: 'https://nexus.akraino.org'
+    java-version: openjdk8
+    mvn-version: mvn35
+    mvn-opts: ''
+    mvn-params: ''
+    mvn-settings: airshipinabottle_deploy-settings
+    nexus-shapshot-repo: snapshots
+    build-timeout: 60
+    submodule-recursive: true
+    group-id: org.akraino.airshipinabottle_deploy
+    repo-id: snapshots
+    refspec: refs/heads/master
+    branch: master
+    upload-files-dir: '/tmp/tardir'
+    jobs:
+      - akraino-project-stream-release-config
+    views:
+      - common-view
+    cron: 'H H * * 0'  # push fresh snapshot weekly
diff --git a/jjb/akraino-templates/akraino-jjb-docker.yaml b/jjb/akraino-templates/akraino-jjb-docker.yaml
new file mode 100644 (file)
index 0000000..da5eb11
--- /dev/null
@@ -0,0 +1,52 @@
+---
+#
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+#
+# Licensed 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.
+#
+- job-template:
+    id: 'akraino-project-stream-docker'
+    name: '{project}-{stream}-docker'
+    project-type: freestyle
+    node: '{build-node}'
+
+    parameters:
+      - lf-infra-parameters:
+          project: '{project}'
+          branch: '{branch}'
+          stream: '{stream}'
+          lftools-version: '{lftools-version}'
+
+    scm:
+      - lf-infra-gerrit-scm:
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+          git-url: '{git-url}/{project}.git'
+          refspec: ''
+          branch: '{branch}'
+          submodule-recursive: '{submodule-recursive}'
+          choosing-strategy: default
+
+    builders:
+      - lf-update-java-alternatives:
+          java-version: '{java-version}'
+      - lf-infra-docker-login:
+          global-settings-file: '{global-settings-file}'
+          settings-file: '{mvn-settings}'
+      - inject:
+          properties-content: |
+              PROJECT={project}
+      - shell: !include-raw-escape:
+          - ../shell/build-docker.sh
+
+    triggers:
+      - timed: '@daily'
diff --git a/jjb/shell/build-docker.sh b/jjb/shell/build-docker.sh
new file mode 100644 (file)
index 0000000..5bada0a
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+#
+# Licensed 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.
+
+DOCKER_REPO='nexus3.akraino.org:10003'
+
+set -e -u -x -o pipefail
+
+echo '---> Starting build-docker'
+
+case "$PROJECT" in
+portal_user_interface)
+    CON_NAME='akraino-portal'
+    VERSION=`xmlstarlet sel -N "x=http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" AECPortalMgmt/pom.xml`
+    WARFILE="https://nexus.akraino.org/repository/maven-snapshots/org/akraino/portal/portal/${VERSION}/portal-${VERSION}.war"
+    curl -O ${WARFILE}
+    ln $(basename ${WARFILE}) AECPortalMgmt.war
+
+    (
+        echo 'FROM tomcat:8.5.31'
+        echo 'COPY AECPortalMgmt.war /usr/local/tomcat/webapps'
+    ) > Dockerfile
+    ;;
+
+camunda_workflow)
+    CON_NAME='akraino-camunda-workflow-engine'
+    VERSION=`xmlstarlet sel -N "x=http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" akraino/pom.xml`
+    JARFILE="https://nexus.akraino.org/repository/maven-snapshots/org/akraino/camunda_workflow/${VERSION}/camunda_workflow-${VERSION}.jar"
+    curl -O ${JARFILE}
+    ;;
+
+postgres_db_schema)
+    CON_NAME='akraino_schema_db'
+    source $WORKSPACE/version.properties
+    TARFILE="https://nexus.akraino.org/repository/maven-snapshots/org/akraino/camunda_workflow/${VERSION}/camunda_workflow-${VERSION}.tgz"
+    curl -O ${TARFILE}
+    (mkdir yaml_builds; cd yaml_builds; tar xfv ../$(basename ${TARFILE}))
+    mv yaml_builds/templates akraino-j2templates
+    ;;
+
+*)
+    echo unknown project "$PROJECT"
+    exit 1
+    ;;
+esac
+
+# Build and push the Docker container
+docker build -f Dockerfile -t ${CON_NAME}:${VERSION} .
+docker tag ${CON_NAME}:${VERSION} ${DOCKER_REPO}/${CON_NAME}:${VERSION}
+docker push ${DOCKER_REPO}/${CON_NAME}:${VERSION}
+
+set +u +x