-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PoC build system for Juniper/contrail
Change-Id: If7ed8d221d1b9b926995bfb792b28643a1637f99 Partial-Bug: 1752726
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
- project: | ||
name: Juniper/contrail | ||
check: | ||
jobs: | ||
- contrail-go-docker | ||
|
||
- job: | ||
name: contrail-go-docker | ||
description: | | ||
Job that builds and tests Juniper/contrail project. | ||
voting: False | ||
parent: contrail-src-base | ||
required-projects: | ||
- Juniper/contrail | ||
run: playbooks/contrail-go-docker/run.yaml | ||
#post-run: playbooks/contrail-go-docker/post.yaml | ||
nodeset: | ||
nodes: | ||
- name: contrail-go | ||
label: centos-7-4-builder | ||
vars: | ||
docker: | ||
- image: circleci/golang:1.9.2 | ||
# - image: circleci/mysql:5.7 | ||
# environment: | ||
# MYSQL_ROOT_PASSWORD: contrail123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- name: "Install docker-py" | ||
yum: | ||
name: python-docker-py | ||
state: present | ||
become: yes | ||
become_user: root | ||
|
||
- name: Disable selinux for the build | ||
selinux: | ||
state: disabled | ||
become: yes | ||
become_user: root | ||
|
||
- name: Pretend we're using github | ||
file: | ||
src: "review.opencontrail.org" | ||
path: "{{ ansible_env.HOME}}/src/github.com" | ||
state: link | ||
|
||
- name: "Start runner docker container in background" | ||
docker_container: | ||
name: "{{ docker.0.name|default('runner') }}" | ||
image: "{{ docker.0.image }}" | ||
state: started | ||
env: "{{ docker.0.environment|default(omit) }}" | ||
network_mode: host | ||
command: sleep infinity | ||
volumes: | ||
- "{{ ansible_env.HOME }}:/go" | ||
become: yes | ||
become_user: root | ||
|
||
- name: "Run required additional docker containers in background" | ||
docker_container: | ||
name: "{{ item.name|default(item.image.split('/')[-1].split(':')[0]) }}" | ||
image: "{{ item.image }}" | ||
state: started | ||
env: "{{ item.environment|default(omit) }}" | ||
network_mode: host | ||
with_items: "{{ docker[1:] }}" | ||
become: yes | ||
become_user: root | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: "{{ item.name|default(item.command) }}" | ||
shell: > | ||
docker exec --user=$(id -u) {{ docker.0.name|default('runner') }} bash -ec | ||
"cd {{ workdir }}; {{ item.command }}" | ||
become: yes | ||
become_user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
- hosts: all | ||
name: Build and test Juniper/contrail | ||
roles: | ||
- install-docker-daemon | ||
vars: | ||
workdir: /go/src/github.com/Juniper/contrail | ||
tasks: | ||
- include: build-setup.yaml | ||
|
||
- name: run | ||
include: build-step.yaml | ||
loop_control: | ||
label: "{{ item.name }}" | ||
with_items: # Insert tasks here | ||
- name: Install deps | ||
command: make deps | ||
- name: Install packaging tools | ||
command: | | ||
sudo apt-get install -y zip build-essential rpm rubygems ruby-dev curl; | ||
sudo gem install --no-ri --no-rdoc fpm; | ||
- name: Make package | ||
command: make build binaries package | ||
|