diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-06-16 13:44:28 -0700 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2017-06-16 13:44:28 -0700 |
commit | 213a8351fd266294e17a862b4d223c1968800a09 (patch) | |
tree | 0eaa87c3253da9f65fcbaf514c6b2baaf06fa162 /bootstrap | |
parent | 06a50674c025c198585a6de4e6bb035cde63832d (diff) |
Added vagrant setup for a Jenkins system for ONAP
Add a set of vagrant scripts that will set up a
local Jenkins environment with pre-defined jobs
to build all the ONAP java code and docker images.
Change-Id: I67ed254bcb38a7be989b7c2861fd3ea4ec9c66f2
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'bootstrap')
21 files changed, 822 insertions, 1 deletions
diff --git a/bootstrap/README.md b/bootstrap/README.md index 475aa9185..bad686157 100644 --- a/bootstrap/README.md +++ b/bootstrap/README.md @@ -3,5 +3,9 @@ ## Description -* A framework to automatically install and test a set of base infrastructure components for new developer +* A framework to automatically install and test a set of base infrastructure components and environments for new developers. + +## Sub-components + +* jenkins - A set of vagrant scripts that will set up a simple Jenkins environment with jobs configured to build all ONAP java code and docker images. diff --git a/bootstrap/jenkins/scripts/clone-all.sh b/bootstrap/jenkins/scripts/clone-all.sh new file mode 100755 index 000000000..6bdb68a09 --- /dev/null +++ b/bootstrap/jenkins/scripts/clone-all.sh @@ -0,0 +1,5 @@ +#!/bin/sh +while read p; do + echo $p + git clone ssh://gerrit.onap.org:29418/$p $p +done < projects.txt diff --git a/bootstrap/jenkins/scripts/gen-java-jobs.py b/bootstrap/jenkins/scripts/gen-java-jobs.py new file mode 100755 index 000000000..0da988083 --- /dev/null +++ b/bootstrap/jenkins/scripts/gen-java-jobs.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +import fileinput +import os +import subprocess + +print """- project: + name: onap-java + jobs: + - 'java-{project}' + project:""" + +for line in fileinput.input(): + repo = line.strip() + isGroupRepo = subprocess.call("grep -s 'Group repo' {}/README.md > /dev/null".format(repo), shell=True) == 0 + if not isGroupRepo: + pompaths = os.popen("./ls-top-poms.sh {}".format(repo)).readlines() + for pompath in pompaths: + pompath = pompath.strip() + project = repo.replace("/", "_") + if pompath: + project += "_" + pompath.replace("/", "_") + print " - '{}':".format(project) + print " repo: '{}'".format(repo) + if pompath: + print " pom: '{}/pom.xml'".format(pompath) + else: + print " pom: 'pom.xml'" diff --git a/bootstrap/jenkins/scripts/ls-projects.sh b/bootstrap/jenkins/scripts/ls-projects.sh new file mode 100755 index 000000000..17b8c7893 --- /dev/null +++ b/bootstrap/jenkins/scripts/ls-projects.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ssh -p 29418 gerrit.onap.org gerrit ls-projects | grep -v All diff --git a/bootstrap/jenkins/scripts/ls-top-poms.sh b/bootstrap/jenkins/scripts/ls-top-poms.sh new file mode 100755 index 000000000..e856ee977 --- /dev/null +++ b/bootstrap/jenkins/scripts/ls-top-poms.sh @@ -0,0 +1,2 @@ +#!/bin/sh +find $1 -mindepth 0 -type d -exec test -e "{}/pom.xml" ';' -prune -printf "%P\n" | sort diff --git a/bootstrap/jenkins/scripts/pull-all.sh b/bootstrap/jenkins/scripts/pull-all.sh new file mode 100755 index 000000000..cf6655ce7 --- /dev/null +++ b/bootstrap/jenkins/scripts/pull-all.sh @@ -0,0 +1,8 @@ +#!/bin/sh +while read p; do + echo $p + cd ~/Projects/onap/$p + git fetch + git reset --hard origin + git clean -f -d -x +done < projects.txt diff --git a/bootstrap/jenkins/vagrant/Vagrantfile b/bootstrap/jenkins/vagrant/Vagrantfile new file mode 100644 index 000000000..02b3ec18c --- /dev/null +++ b/bootstrap/jenkins/vagrant/Vagrantfile @@ -0,0 +1,75 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure(2) do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + config.vm.box = "ubuntu/xenial64" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + config.vm.network "forwarded_port", guest: 8080, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + vb.memory = "8192" + end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # sudo apt-get update + # sudo apt-get install -y apache2 + # SHELL + config.vm.provision :shell, path: "bootstrap.sh" + + # requires vagrant plugin install vagrant-disksize + config.disksize.size = '80GB' +end diff --git a/bootstrap/jenkins/vagrant/bootstrap.sh b/bootstrap/jenkins/vagrant/bootstrap.sh new file mode 100755 index 000000000..ab5c45f32 --- /dev/null +++ b/bootstrap/jenkins/vagrant/bootstrap.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +sed -i 's|archive\.ubuntu\.com|mirrors.ocf.berkeley.edu|g' /etc/apt/sources.list + +echo "192.168.33.1 nexus-proxy" >> /etc/hosts + + +cat >> /etc/inputrc <<EOF +set show-all-if-ambiguous on +set show-all-if-unmodified on +set match-hidden-files off +set mark-symlinked-directories on +EOF + + +apt-get update +apt-get -y install git +git config --global user.email "gary.i.wu@huawei.com" +git config --global user.name "Gary Wu" +apt-get -y install curl openjdk-8-jdk maven unzip + +# install Jenkins +wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - +sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' +apt-get update +apt-get -y install jenkins jenkins-job-builder python-pip + +apt-get -y install docker.io +sudo usermod -aG docker ubuntu +sudo usermod -aG docker jenkins + +su -l jenkins -c "/vagrant/jenkins-init-1.sh" + +sudo systemctl restart jenkins +sleep 5 + +su -l jenkins -c "/vagrant/jenkins-init-2.sh" + +sudo systemctl restart jenkins +sleep 5 + +su -l jenkins -c "/vagrant/jjb-init.sh" + diff --git a/bootstrap/jenkins/vagrant/build-all-docker.sh b/bootstrap/jenkins/vagrant/build-all-docker.sh new file mode 100755 index 000000000..081bb1246 --- /dev/null +++ b/bootstrap/jenkins/vagrant/build-all-docker.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# build all jobs +cd ~jenkins +for d in jobs/docker*; do + JOB=$(basename "$d") + echo build "$JOB" + java -jar jenkins-cli.jar -s http://localhost:8080/ -auth jenkins:jenkins build "$JOB" +done diff --git a/bootstrap/jenkins/vagrant/build-all-java.sh b/bootstrap/jenkins/vagrant/build-all-java.sh new file mode 100755 index 000000000..67333b76f --- /dev/null +++ b/bootstrap/jenkins/vagrant/build-all-java.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# build all jobs +cd ~jenkins +for d in jobs/java*; do + JOB=$(basename "$d") + echo build "$JOB" + java -jar jenkins-cli.jar -s http://localhost:8080/ -auth jenkins:jenkins build "$JOB" +done diff --git a/bootstrap/jenkins/vagrant/jenkins-init-1.sh b/bootstrap/jenkins/vagrant/jenkins-init-1.sh new file mode 100755 index 000000000..a5599a7e8 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jenkins-init-1.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +git config --global user.email "jenkins@localhost" +git config --global user.name "jenkins" + +cd ~/jenkins + +cp /etc/skel/.profile . +cat > .bashrc <<EOF +alias ls='ls --color -F' +EOF + +git init + +git add -A +git commit -m 'Initial installation config' + +mkdir -p ~/.m2 +cp /vagrant/settings.xml ~/.m2 +rm -f secrets/initialAdminPassword +rm -rf users/admin +rsync -avP /vagrant/jenkins/ . + +git add -A +git commit -m 'Set up jenkins user' + diff --git a/bootstrap/jenkins/vagrant/jenkins-init-2.sh b/bootstrap/jenkins/vagrant/jenkins-init-2.sh new file mode 100755 index 000000000..eb0efe6b9 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jenkins-init-2.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cd ~jenkins +ln -s /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar + +# Get the update center ourself +curl -L http://updates.jenkins-ci.org/update-center.json | sed '1d;$d' | curl -X POST -H 'Accept: application/json' -d @- http://localhost:8080/updateCenter/byId/default/postBack + +java -jar jenkins-cli.jar -s http://localhost:8080/ -auth jenkins:jenkins install-plugin git +java -jar jenkins-cli.jar -s http://localhost:8080/ -auth jenkins:jenkins install-plugin ws-cleanup +java -jar jenkins-cli.jar -s http://localhost:8080/ -auth jenkins:jenkins install-plugin envinject + +git add -A +git commit -m 'Install initial plugins' + diff --git a/bootstrap/jenkins/vagrant/jenkins/jenkins.install.InstallUtil.lastExecVersion b/bootstrap/jenkins/vagrant/jenkins/jenkins.install.InstallUtil.lastExecVersion new file mode 100644 index 000000000..00030eab6 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jenkins/jenkins.install.InstallUtil.lastExecVersion @@ -0,0 +1 @@ +2.46.3 diff --git a/bootstrap/jenkins/vagrant/jenkins/users/jenkins/config.xml b/bootstrap/jenkins/vagrant/jenkins/users/jenkins/config.xml new file mode 100644 index 000000000..be836f262 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jenkins/users/jenkins/config.xml @@ -0,0 +1,38 @@ +<?xml version='1.0' encoding='UTF-8'?> +<user> + <fullName>jenkins</fullName> + <properties> + <jenkins.security.ApiTokenProperty> + <apiToken>{AQAAABAAAAAwQAGpldGajxw//dhxd53gZGv4w0JnZYDETTLBQdpotQXt02s0lq13YrhyaytbLFMflb98hzWY9YBlDIThZt7u+Q==}</apiToken> + </jenkins.security.ApiTokenProperty> + <com.cloudbees.plugins.credentials.UserCredentialsProvider_-UserCredentialsProperty plugin="credentials@2.1.13"> + <domainCredentialsMap class="hudson.util.CopyOnWriteMap$Hash"/> + </com.cloudbees.plugins.credentials.UserCredentialsProvider_-UserCredentialsProperty> + <hudson.model.MyViewsProperty> + <views> + <hudson.model.AllView> + <owner class="hudson.model.MyViewsProperty" reference="../../.."/> + <name>all</name> + <filterExecutors>false</filterExecutors> + <filterQueue>false</filterQueue> + <properties class="hudson.model.View$PropertyList"/> + </hudson.model.AllView> + </views> + </hudson.model.MyViewsProperty> + <org.jenkinsci.plugins.displayurlapi.user.PreferredProviderUserProperty plugin="display-url-api@2.0"> + <providerId>default</providerId> + </org.jenkinsci.plugins.displayurlapi.user.PreferredProviderUserProperty> + <hudson.model.PaneStatusProperties> + <collapsed/> + </hudson.model.PaneStatusProperties> + <hudson.search.UserSearchProperty> + <insensitiveSearch>false</insensitiveSearch> + </hudson.search.UserSearchProperty> + <hudson.security.HudsonPrivateSecurityRealm_-Details> + <passwordHash>#jbcrypt:$2a$10$Esc9z/mnK/CQ8crgFbE3/eP1EI6pvzIHRBe3SSik7rrNt.DDftON2</passwordHash> + </hudson.security.HudsonPrivateSecurityRealm_-Details> + <hudson.tasks.Mailer_-UserProperty plugin="mailer@1.20"> + <emailAddress>jenkins@localhost</emailAddress> + </hudson.tasks.Mailer_-UserProperty> + </properties> +</user> diff --git a/bootstrap/jenkins/vagrant/jenkins_jobs.ini b/bootstrap/jenkins/vagrant/jenkins_jobs.ini new file mode 100644 index 000000000..5cc6dc9f3 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jenkins_jobs.ini @@ -0,0 +1,13 @@ +[job_builder] +ignore_cache=True +keep_descriptions=False +include_path=.:scripts:~/git/ +recursive=False +exclude=.*:manual:./development +allow_duplicates=False + +[jenkins] +user=jenkins +password=jenkins +url=http://localhost:8080 +query_plugins_info=False diff --git a/bootstrap/jenkins/vagrant/jjb-init.sh b/bootstrap/jenkins/vagrant/jjb-init.sh new file mode 100755 index 000000000..01cfcfada --- /dev/null +++ b/bootstrap/jenkins/vagrant/jjb-init.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +git add -A +git commit -m 'Installed plugins, restarted Jenkins' + + +mkdir -p ~/.config/jenkins_jobs +cp /vagrant/jenkins_jobs.ini ~/.config/jenkins_jobs + +pip install --user jenkins-job-builder + +jenkins-job-builder update -r /vagrant/jjb + +cat > .gitignore <<EOF +jobs/*/builds +jobs/*/last* +workspace/ +.m2/repository/ +logs/ +EOF + +git add -A +git commit -m 'Set up initial jobs' + + +# pull 3rd party docker images +docker pull ubuntu:14.04 +docker pull ubuntu:16.04 +docker pull openjdk:8-jre +docker pull tomcat:8.0-jre8 +docker pull jetty:9.3-jre8 +docker pull frolvlad/alpine-oraclejdk8:slim +docker pull java:openjdk-8-jre +docker pull node:4.6.0 diff --git a/bootstrap/jenkins/vagrant/jjb/docker-jobs.yaml b/bootstrap/jenkins/vagrant/jjb/docker-jobs.yaml new file mode 100644 index 000000000..5925b5d01 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jjb/docker-jobs.yaml @@ -0,0 +1,76 @@ +- project: + name: onap-docker-with-pom + jobs: + - 'docker-with-pom' + project: + - 'aai_aai-service_ajsc-aai': + repo: 'aai/aai-service' + pom: 'ajsc-aai/pom.xml' + mvn-options: 'docker:build' + - 'aai_data-router': + repo: 'aai/data-router' + pom: 'pom.xml' + mvn-options: 'docker:build' + - 'aai_model-loader': + repo: 'aai/model-loader' + pom: 'pom.xml' + mvn-options: 'docker:build' + - 'aai_resources_aai-resources': + repo: 'aai/resources' + pom: 'aai-resources/pom.xml' + mvn-options: 'docker:build' + - 'aai_search-data-service': + repo: 'aai/search-data-service' + mvn-options: 'docker:build' + - 'aai_sparky-be': + repo: 'aai/sparky-be' + mvn-options: 'docker:build' + - 'aai_traversal_aai-traversal': + repo: 'aai/traversal' + pom: 'aai-traversal/pom.xml' + mvn-options: 'docker:build' + - 'appc': + repo: 'appc/deployment' + mvn-options: '-P docker' + - 'dcae_dcae-controller': + repo: 'dcae/demo' + shell-cmd: 'bash dcae-demo-controller/src/main/docker-build/build.sh' + - 'dcae_dcae-dmaapbc': + repo: 'dcae/dmaapbc' + shell-cmd: 'docker build -f ./Dockerfile .' + - 'dcae_dcae-inventory': + repo: 'dcae/dcae-inventory' + mvn-options: 'docker:build' + - 'mso': + repo: 'mso' + pom: 'packages/docker/pom.xml' + mvn-options: '-P docker' + - 'policy': + repo: 'policy/docker' + shell-cmd: './docker_build.sh' + - 'portal_ecomp-portal-widget-ms': + repo: 'portal' + pom: 'ecomp-portal-widget-ms/pom.xml' + mvn-options: 'docker:build' + - 'sdc': + repo: 'sdc' + pom: 'pom.xml' + mvn-options: '-P docker' + - 'sdnc': + repo: 'sdnc/oam' + mvn-options: '-P docker' + - 'vid': + repo: 'vid' + mvn-options: '-P docker' + +- project: + name: onap-docker-without-pom + jobs: + - 'docker-without-pom' + project: + - 'dcae_dcae-orch-dispatcher': + repo: 'dcae/orch-dispatcher' + shell-cmd: 'docker build -f ./Dockerfile .' + - 'portal': + repo: 'portal' + shell-cmd: 'git -C ecompsdkos pull || git clone $GIT_NO_PROJECT/ecompsdkos; git -C dmaapbc pull || git clone $GIT_NO_PROJECT/ui/dmaapbc dmaapbc; cd deliveries; chmod +x *.sh; ./run.sh' diff --git a/bootstrap/jenkins/vagrant/jjb/include-docker-login.sh b/bootstrap/jenkins/vagrant/jjb/include-docker-login.sh new file mode 100644 index 000000000..561a91f5f --- /dev/null +++ b/bootstrap/jenkins/vagrant/jjb/include-docker-login.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# vim: ts=4 sw=4 sts=4 et : + +DOCKER_REPOSITORIES="nexus3.onap.org:10001 \ + nexus3.onap.org:10002 \ + nexus3.onap.org:10003 \ + nexus3.onap.org:10004" + +for DOCKER_REPOSITORY in $DOCKER_REPOSITORIES; +do + echo $DOCKER_REPOSITORY + docker login $DOCKER_REPOSITORY -u "anonymous" -p "anonymous" +done diff --git a/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml b/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml new file mode 100644 index 000000000..570802ee5 --- /dev/null +++ b/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml @@ -0,0 +1,167 @@ +- project: + name: onap-java + jobs: + - 'java-{project}' + project: + - 'aai_aai-common': + repo: 'aai/aai-common' + pom: 'pom.xml' + - 'aai_aai-service': + repo: 'aai/aai-service' + pom: 'pom.xml' + - 'aai_data-router': + repo: 'aai/data-router' + pom: 'pom.xml' + - 'aai_logging-service': + repo: 'aai/logging-service' + pom: 'pom.xml' + - 'aai_model-loader': + repo: 'aai/model-loader' + pom: 'pom.xml' + - 'aai_resources': + repo: 'aai/resources' + pom: 'pom.xml' + - 'aai_rest-client': + repo: 'aai/rest-client' + pom: 'pom.xml' + - 'aai_router-core': + repo: 'aai/router-core' + pom: 'pom.xml' + - 'aai_search-data-service': + repo: 'aai/search-data-service' + pom: 'pom.xml' + - 'aai_sparky-fe': + repo: 'aai/sparky-fe' + pom: 'pom.xml' + - 'aai_traversal': + repo: 'aai/traversal' + pom: 'pom.xml' + - 'appc': + repo: 'appc' + pom: 'pom.xml' + - 'appc_deployment': + repo: 'appc/deployment' + pom: 'pom.xml' + - 'dcae_apod_analytics': + repo: 'dcae/apod/analytics' + pom: 'pom.xml' + - 'dcae_collectors_ves': + repo: 'dcae/collectors/ves' + pom: 'pom.xml' + - 'dcae_controller': + repo: 'dcae/controller' + pom: 'pom.xml' + - 'dcae_controller_analytics': + repo: 'dcae/controller/analytics' + pom: 'pom.xml' + - 'dcae_dcae-inventory': + repo: 'dcae/dcae-inventory' + pom: 'pom.xml' + - 'dcae_demo': + repo: 'dcae/demo' + pom: 'pom.xml' + - 'dcae_dmaapbc': + repo: 'dcae/dmaapbc' + pom: 'pom.xml' + - 'dcae_operation_utils': + repo: 'dcae/operation/utils' + pom: 'pom.xml' + - 'dcae_pgaas_cdf_src_cdf-prop-value_cdf-prop-value': + repo: 'dcae/pgaas' + pom: 'cdf/src/cdf-prop-value/cdf-prop-value/pom.xml' + - 'dcae_pgaas_cdf_src_cdf-prop-value_cdf-util': + repo: 'dcae/pgaas' + pom: 'cdf/src/cdf-prop-value/cdf-util/pom.xml' + - 'demo': + repo: 'demo' + pom: 'pom.xml' + - 'ecompsdkos_ecomp-sdk': + repo: 'ecompsdkos' + pom: 'ecomp-sdk/pom.xml' + - 'mso': + repo: 'mso' + pom: 'pom.xml' + - 'mso_libs': + repo: 'mso/libs' + pom: 'pom.xml' + - 'ncomp_cdap': + repo: 'ncomp/cdap' + pom: 'pom.xml' + - 'ncomp_core': + repo: 'ncomp/core' + pom: 'pom.xml' + - 'ncomp_docker': + repo: 'ncomp/docker' + pom: 'pom.xml' + - 'ncomp_maven': + repo: 'ncomp/maven' + pom: 'pom.xml' + - 'ncomp_openstack': + repo: 'ncomp/openstack' + pom: 'pom.xml' + - 'ncomp_sirius_manager': + repo: 'ncomp/sirius/manager' + pom: 'pom.xml' + - 'ncomp_utils': + repo: 'ncomp/utils' + pom: 'pom.xml' + - 'policy_common': + repo: 'policy/common' + pom: 'pom.xml' + - 'policy_docker': + repo: 'policy/docker' + pom: 'pom.xml' + - 'policy_drools-applications': + repo: 'policy/drools-applications' + pom: 'pom.xml' + - 'policy_drools-pdp': + repo: 'policy/drools-pdp' + pom: 'pom.xml' + - 'policy_engine': + repo: 'policy/engine' + pom: 'pom.xml' + - 'portal': + repo: 'portal' + pom: 'pom.xml' + - 'sdc': + repo: 'sdc' + pom: 'pom.xml' + - 'sdc_jtosca': + repo: 'sdc/jtosca' + pom: 'pom.xml' + - 'sdc_sdc-distribution-client': + repo: 'sdc/sdc-distribution-client' + pom: 'pom.xml' + - 'sdc_sdc-titan-cassandra': + repo: 'sdc/sdc-titan-cassandra' + pom: 'pom.xml' + - 'sdc_sdc-tosca': + repo: 'sdc/sdc-tosca' + pom: 'pom.xml' + - 'sdc_sdc_common': + repo: 'sdc/sdc_common' + pom: 'pom.xml' + - 'sdnc_adaptors': + repo: 'sdnc/adaptors' + pom: 'pom.xml' + - 'sdnc_core': + repo: 'sdnc/core' + pom: 'pom.xml' + - 'sdnc_northbound': + repo: 'sdnc/northbound' + pom: 'pom.xml' + - 'sdnc_oam': + repo: 'sdnc/oam' + pom: 'pom.xml' + - 'sdnc_plugins': + repo: 'sdnc/plugins' + pom: 'pom.xml' + - 'ui_dmaapbc': + repo: 'ui/dmaapbc' + pom: 'pom.xml' + - 'vid': + repo: 'vid' + pom: 'pom.xml' + - 'vid_asdcclient': + repo: 'vid/asdcclient' + pom: 'pom.xml' diff --git a/bootstrap/jenkins/vagrant/jjb/template.yaml b/bootstrap/jenkins/vagrant/jjb/template.yaml new file mode 100644 index 000000000..e035583ed --- /dev/null +++ b/bootstrap/jenkins/vagrant/jjb/template.yaml @@ -0,0 +1,76 @@ +- builder: + name: docker-login + builders: + - shell: !include-raw: include-docker-login.sh + +- job-template: + name: 'java-{project}' + project-type: freestyle + scm: + - git: + url: 'http://gerrit.onap.org/r/{repo}' + branches: + - '*/master' + wipe-workspace: false + skip-tag: true + timeout: 30 + builders: + - maven-target: + goals: '-B clean install' + pom: '{pom}' + properties: + - skipTests=true + +- job-template: + id: docker-with-pom + name: 'docker-{project}' + project-type: freestyle + pom: 'pom.xml' + mvn-options: '' + shell-cmd: '' + scm: + - git: + url: 'http://gerrit.onap.org/r/{repo}' + branches: + - '*/master' + wipe-workspace: false + skip-tag: true + timeout: 30 + properties: + - inject: + properties-content: | + GIT_NO_PROJECT=http://gerrit.onap.org/r + builders: + - docker-login + - maven-target: + goals: '-B clean package {mvn-options}' + pom: '{pom}' + properties: + - skipTests=true + - docker.pull.registry=nexus3.onap.org:10001 + - docker.push.registry=nexus3.onap.org:10003 + - shell: "{shell-cmd}" + +- job-template: + id: docker-without-pom + name: 'docker-{project}' + project-type: freestyle + shell-cmd: '' + scm: + - git: + url: 'http://gerrit.onap.org/r/{repo}' + branches: + - '*/master' + wipe-workspace: false + skip-tag: true + timeout: 30 + properties: + - inject: + properties-content: | + GIT_NO_PROJECT=http://gerrit.onap.org/r + GLOBAL_SETTINGS_FILE=/var/lib/jenkins/.m2/settings.xml + SETTINGS_FILE=/var/lib/jenkins/.m2/settings.xml + MVN=mvn + builders: + - docker-login + - shell: "{shell-cmd}" diff --git a/bootstrap/jenkins/vagrant/settings.xml b/bootstrap/jenkins/vagrant/settings.xml new file mode 100644 index 000000000..41da9bec3 --- /dev/null +++ b/bootstrap/jenkins/vagrant/settings.xml @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2016 Huawei Technologies Co., Ltd. and others. 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. +--> +<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + + <profiles> + <profile> + <id>onap-snapshots</id> + <repositories> + <repository> + <id>onap-snapshots</id> + <name>onap-snapshots</name> + <url>https://nexus.onap.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>onap-snapshots</id> + <name>onap-snapshots</name> + <url>https://nexus.onap.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + <profile> + <id>onap-staging</id> + <repositories> + <repository> + <id>onap-staging</id> + <name>onap-staging</name> + <url>https://nexus.onap.org/content/repositories/staging/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>onap-staging</id> + <name>onap-staging</name> + <url>https://nexus.onap.org/content/repositories/staging/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + <profile> + <id>onap-releases</id> + <repositories> + <repository> + <id>onap-releases</id> + <name>onap-releases</name> + <url>https://nexus.onap.org/content/repositories/releases/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>onap-releases</id> + <name>onap-releases</name> + <url>https://nexus.onap.org/content/repositories/releases/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + <profile> + <id>onap-public</id> + <repositories> + <repository> + <id>onap-public</id> + <name>onap-public</name> + <url>https://nexus.onap.org/content/repositories/public/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>onap-public</id> + <name>onap-public</name> + <url>https://nexus.onap.org/content/repositories/public/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + <profile> + <id>local-public</id> + <repositories> + <repository> + <id>local-public</id> + <name>local-public</name> + <url>http://nexus-proxy:8081/nexus/content/repositories/public/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>local-public</id> + <name>local-public</name> + <url>http://nexus-proxy:8081/nexus/content/repositories/public/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> + + <activeProfiles> + <activeProfile>onap-snapshots</activeProfile> + <activeProfile>onap-staging</activeProfile> + <activeProfile>onap-releases</activeProfile> + <!-- <activeProfile>onap-public</activeProfile> --> + <activeProfile>local-public</activeProfile> + </activeProfiles> + +</settings> |