Merge lp:~ricardokirkner/locolander/a-tree-full-of-scripts into lp:locolander

Proposed by Loco Lander
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: 16
Merged at revision: 7
Proposed branch: lp:~ricardokirkner/locolander/a-tree-full-of-scripts
Merge into: lp:locolander
Diff against target: 158 lines (+109/-0)
9 files modified
.bzrignore (+1/-0)
docker/Dockerfile (+42/-0)
docker/files/95proxies (+3/-0)
docker/files/bazaar/authentication.conf (+4/-0)
docker/files/bazaar/bazaar.conf (+3/-0)
docker/files/environment (+10/-0)
docker/scripts/build.sh (+6/-0)
docker/scripts/run_project.sh (+9/-0)
docker/scripts/run_tests.sh (+31/-0)
To merge this branch: bzr merge lp:~ricardokirkner/locolander/a-tree-full-of-scripts
Reviewer Review Type Date Requested Status
Ricardo Kirkner (by nessita) Approve
Review via email: mp+170912@code.launchpad.net

Commit message

initial set of scripts to run tests and merge branches

Description of the change

This branch adds:

- set of scripts:
  - run_project.sh: runs a container using docker and calls run_tests.sh for the source and target branches inside of that container
  - run_tests.sh: merges source into target branch and runs tests before pushing
  - build.sh: builds an image for a project, using a project specific Dockerfile

- Dockerfile for building the locolander:base image

To post a comment you must log in.
14. By Ricardo Kirkner

added support for passing commit message to run_tests.sh

15. By Ricardo Kirkner

handle arguments with spaces

16. By Ricardo Kirkner

commit after running tests

Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

Looks good!

review: Approve ((by nessita))

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2013-06-21 20:26:50 +0000
+++ .bzrignore 2013-06-22 01:39:24 +0000
@@ -1,1 +1,2 @@
1docker/files/ssh
1locolander.db2locolander.db
23
=== added directory 'docker'
=== added file 'docker/Dockerfile'
--- docker/Dockerfile 1970-01-01 00:00:00 +0000
+++ docker/Dockerfile 2013-06-22 01:39:24 +0000
@@ -0,0 +1,42 @@
1from ubuntu:precise
2env http_proxy http://172.16.42.1:3128
3
4# enable universe repo
5run apt-get -y update
6run apt-get -y install python-software-properties
7run add-apt-repository "deb http://archive.ubuntu.com/ubuntu precise main universe"
8run apt-get -y update
9
10# install base tools
11run apt-get -y install python-pip
12run apt-get -y install bzr
13
14# upgrade system
15run apt-get -y upgrade
16
17# add pip cache
18run mkdir -p /var/cache/locolander/pip
19
20# configure proxy
21add ./files/environment /etc/environment
22add ./files/95proxies /etc/apt/apt.conf.d/95proxies
23
24# add locolander user
25run adduser locolander
26
27# install main locolander script
28add ./scripts/run_tests.sh /usr/local/bin/run_tests.sh
29run chown locolander.locolander /usr/local/bin/run_tests.sh
30
31# configure ssh
32run mkdir /home/locolander/.ssh
33add ./files/ssh/id_rsa /home/locolander/.ssh/id_rsa
34add ./files/ssh/id_rsa.pub /home/locolander/.ssh/id_rsa.pub
35
36# configure bazaar
37run mkdir /home/locolander/.bazaar
38add ./files/bazaar/bazaar.conf /home/locolander/.bazaar/bazaar.conf
39add ./files/bazaar/authentication.conf /home/locolander/.bazaar/authentication.conf
40
41# ensure proper ownership
42run chown -R locolander.locolander /home/locolander/
043
=== added directory 'docker/files'
=== added file 'docker/files/95proxies'
--- docker/files/95proxies 1970-01-01 00:00:00 +0000
+++ docker/files/95proxies 2013-06-22 01:39:24 +0000
@@ -0,0 +1,3 @@
1Acquire::http::proxy "http://172.16.42.1:3128/";
2Acquire::ftp::proxy "ftp://172.16.42.1:3128/";
3Acquire::https::proxy "https://172.16.42.1:3128/";
04
=== added directory 'docker/files/bazaar'
=== added file 'docker/files/bazaar/authentication.conf'
--- docker/files/bazaar/authentication.conf 1970-01-01 00:00:00 +0000
+++ docker/files/bazaar/authentication.conf 2013-06-22 01:39:24 +0000
@@ -0,0 +1,4 @@
1[Launchpad]
2host = .launchpad.net
3scheme = ssh
4user = locolander
05
=== added file 'docker/files/bazaar/bazaar.conf'
--- docker/files/bazaar/bazaar.conf 1970-01-01 00:00:00 +0000
+++ docker/files/bazaar/bazaar.conf 2013-06-22 01:39:24 +0000
@@ -0,0 +1,3 @@
1[DEFAULT]
2email = "Loco Lander"
3launchpad_username = locolander
04
=== added file 'docker/files/environment'
--- docker/files/environment 1970-01-01 00:00:00 +0000
+++ docker/files/environment 2013-06-22 01:39:24 +0000
@@ -0,0 +1,10 @@
1PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
2
3http_proxy=http://172.16.42.1:3128/
4https_proxy=http://172.16.42.1:3128/
5ftp_proxy=http://172.16.42.1:3128/
6no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
7HTTP_PROXY=http://172.16.42.1:3128/
8HTTPS_PROXY=http://172.16.42.1:3128/
9FTP_PROXY=http://172.16.42.1:3128/
10NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
011
=== added directory 'docker/scripts'
=== added file 'docker/scripts/build.sh'
--- docker/scripts/build.sh 1970-01-01 00:00:00 +0000
+++ docker/scripts/build.sh 2013-06-22 01:39:24 +0000
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3PROJECT=$1
4DOCKERFILE=$2
5
6docker build -t $PROJECT - < $DOCKERFILE
07
=== added file 'docker/scripts/run_project.sh'
--- docker/scripts/run_project.sh 1970-01-01 00:00:00 +0000
+++ docker/scripts/run_project.sh 2013-06-22 01:39:24 +0000
@@ -0,0 +1,9 @@
1#!/bin/bash
2
3PROJECT="$1"
4SOURCE="$2"
5TARGET="$3"
6CMD="$4"
7COMMIT_MSG="$5"
8
9OUTPUT=$(docker run -u locolander -e HOME=/home/locolander $PROJECT /usr/local/bin/run_tests.sh "$SOURCE" "$TARGET" "$CMD" "$COMMIT_MSG")
010
=== added file 'docker/scripts/run_tests.sh'
--- docker/scripts/run_tests.sh 1970-01-01 00:00:00 +0000
+++ docker/scripts/run_tests.sh 2013-06-22 01:39:24 +0000
@@ -0,0 +1,31 @@
1#!/bin/bash -e
2
3SOURCE="$1"
4TARGET="$2"
5CMD="$3"
6COMMIT_MSG="$4"
7
8TMPFOLDER=`mktemp -d`
9
10cd $TMPFOLDER
11echo "Getting target branch ($TARGET)..."
12bzr branch $TARGET target
13
14# merge
15echo "Merging source branch ($SOURCE) into target..."
16cd target
17bzr merge $SOURCE
18
19# run tests
20echo "Running tests..."
21$CMD
22
23# commit
24echo "Committing merge..."
25bzr commit -m "$COMMIT_MSG"
26
27# push merge
28echo "Pushing merge..."
29bzr push $TARGET
30
31echo "SUCCESS"

Subscribers

People subscribed via source and target branches

to all changes: