summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Johnson <johnsomor@gmail.com>2017-10-17 15:39:00 -0700
committerMichael Johnson <johnsomor@gmail.com>2017-11-01 14:20:33 -0700
commit57f6f3c54d9dede1d6544a0be71fd84355198008 (patch)
treea11fc8a36db58c406469b7f25dc1e2feded41228
parent6895af770777c110ce165b86f820d5e4b1afe613 (diff)
Move neutron-lbaas-dashboard zuulv3 config in repo
This is the start of the transition to native Zuul v3 support for neutron-lbaas-dashboard. Change-Id: Ife75c717d4ffb74d6ccf4bfc4cf24b769924b6d7
Notes
Notes (review): Code-Review+2: Adam Harwell <flux.adam@gmail.com> Code-Review+2: Nir Magnezi <nmagnezi@redhat.com> Workflow+1: Nir Magnezi <nmagnezi@redhat.com> Code-Review+2: German Eichberger <German.eichberger@rackspace.com> Workflow+1: German Eichberger <German.eichberger@rackspace.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 07 Nov 2017 16:42:28 +0000 Reviewed-on: https://review.openstack.org/512894 Project: openstack/neutron-lbaas-dashboard Branch: refs/heads/master
-rw-r--r--playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/post.yaml54
-rw-r--r--playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/run.yaml149
-rw-r--r--playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/post.yaml54
-rw-r--r--playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/run.yaml149
-rwxr-xr-xtools/tox_install.sh6
-rw-r--r--zuul.d/jobs.yaml17
-rw-r--r--zuul.d/projects.yaml12
7 files changed, 440 insertions, 1 deletions
diff --git a/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/post.yaml b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/post.yaml
new file mode 100644
index 0000000..e38d86d
--- /dev/null
+++ b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/post.yaml
@@ -0,0 +1,54 @@
1- hosts: primary
2 tasks:
3
4 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
5 synchronize:
6 src: '{{ ansible_user_dir }}/workspace/'
7 dest: '{{ zuul.executor.log_root }}'
8 mode: pull
9 copy_links: true
10 verify_host: true
11 rsync_opts:
12 - --include=/cover/**
13 - --include=*/
14 - --exclude=*
15 - --prune-empty-dirs
16
17 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
18 synchronize:
19 src: '{{ ansible_user_dir }}/workspace/'
20 dest: '{{ zuul.executor.log_root }}'
21 mode: pull
22 copy_links: true
23 verify_host: true
24 rsync_opts:
25 - --include=/reports/**
26 - --include=*/
27 - --exclude=*
28 - --prune-empty-dirs
29
30 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
31 synchronize:
32 src: '{{ ansible_user_dir }}/workspace/'
33 dest: '{{ zuul.executor.log_root }}'
34 mode: pull
35 copy_links: true
36 verify_host: true
37 rsync_opts:
38 - --include=/npm-shrinkwrap.json
39 - --include=*/
40 - --exclude=*
41 - --prune-empty-dirs
42
43 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
44 synchronize:
45 src: '{{ ansible_user_dir }}/workspace/'
46 dest: '{{ zuul.executor.log_root }}'
47 mode: pull
48 copy_links: true
49 verify_host: true
50 rsync_opts:
51 - --include=/karma.subunit
52 - --include=*/
53 - --exclude=*
54 - --prune-empty-dirs
diff --git a/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/run.yaml b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/run.yaml
new file mode 100644
index 0000000..212b8bd
--- /dev/null
+++ b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/run.yaml
@@ -0,0 +1,149 @@
1- hosts: all
2 name: Autoconverted job legacy-neutron-lbaas-dashboard-nodejs4-npm-run-lint from
3 old job gate-neutron-lbaas-dashboard-nodejs4-npm-run-lint
4 tasks:
5
6 - name: Ensure legacy workspace directory
7 file:
8 path: '{{ ansible_user_dir }}/workspace'
9 state: directory
10
11 - shell:
12 cmd: |
13 set -e
14 set -x
15 CLONEMAP=`mktemp`
16 function cleanup {
17 # In cases where zuul-cloner is aborted during a git
18 # clone operation, git will remove the git work tree in
19 # its cleanup. The work tree in these jobs is the
20 # workspace directory, which means that subsequent
21 # jenkins post-build actions can not run because the
22 # workspace has been removed.
23 # To reduce the likelihood of this having an impact,
24 # recreate the workspace directory if needed
25 mkdir -p $WORKSPACE
26 rm -f $CLONEMAP
27 }
28 trap cleanup EXIT
29 cat > $CLONEMAP << EOF
30 clonemap:
31 - name: $ZUUL_PROJECT
32 dest: .
33 EOF
34 /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
35 git://git.openstack.org $ZUUL_PROJECT
36 executable: /bin/bash
37 chdir: '{{ ansible_user_dir }}/workspace'
38 environment: '{{ zuul | zuul_legacy_vars }}'
39
40 - shell:
41 cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
42 chdir: '{{ ansible_user_dir }}/workspace'
43 environment: '{{ zuul | zuul_legacy_vars }}'
44
45 - shell:
46 cmd: |
47 set -u
48 set -e
49 set -x
50 # Prerequisites
51 sudo apt-get update
52 sudo apt-get install -y apt-transport-https lsb-release curl
53
54 DISTRO=$(lsb_release -c -s)
55
56 # Install via nodesource
57 curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
58
59 echo "deb https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
60 echo "deb-src https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
61
62 sudo apt-get update
63 sudo apt-get install -y nodejs
64
65 # Output to the log for debugging sake.
66 node --version
67 npm --version
68 executable: /bin/bash
69 chdir: '{{ ansible_user_dir }}/workspace'
70 environment: '{{ zuul | zuul_legacy_vars }}'
71
72 - shell:
73 cmd: |
74 sudo apt-get update
75 sudo apt-get install -y xvfb
76 chdir: '{{ ansible_user_dir }}/workspace'
77 environment: '{{ zuul | zuul_legacy_vars }}'
78
79 - shell:
80 cmd: |
81 sudo apt-get update
82 sudo apt-get install -y chromium-browser
83 chdir: '{{ ansible_user_dir }}/workspace'
84 environment: '{{ zuul | zuul_legacy_vars }}'
85
86 - shell:
87 cmd: |
88 sudo apt-get update
89 sudo apt-get install -y firefox dbus
90 chdir: '{{ ansible_user_dir }}/workspace'
91 environment: '{{ zuul | zuul_legacy_vars }}'
92
93 - shell:
94 cmd: |
95 set -x
96 sudo rm -f /etc/sudoers.d/zuul
97 # Prove that general sudo access is actually revoked
98 ! sudo -n true
99 executable: /bin/bash
100 chdir: '{{ ansible_user_dir }}/workspace'
101 environment: '{{ zuul | zuul_legacy_vars }}'
102
103 - shell:
104 cmd: |
105 DIMENSIONS='1280x1024x24'
106 /usr/bin/Xvfb :99 -screen 0 ${DIMENSIONS} -ac +extension GLX +render -noreset 2>&1 > /dev/null &
107 chdir: '{{ ansible_user_dir }}/workspace'
108 environment: '{{ zuul | zuul_legacy_vars }}'
109
110 - shell:
111 cmd: |
112 set -u
113 set -e
114 set -x
115 export DISPLAY=:99
116 npm install --verbose
117
118 # Try running as a standard lifecycle script, otherwise try custom.
119 npm_lifecycle_phases="publish install version test stop start restart pack"
120
121 if [[ $npm_lifecycle_phases =~ (^| )lint($| ) ]]; then
122 npm lint --verbose
123 else
124 npm run lint --verbose
125 fi
126
127 # If no shrinkwrap exists, generate it.
128 if [ ! -f ./npm-shrinkwrap.json ]; then
129 npm prune # https://github.com/npm/npm/issues/6298
130 npm shrinkwrap
131 fi
132 executable: /bin/bash
133 chdir: '{{ ansible_user_dir }}/workspace'
134 environment: '{{ zuul | zuul_legacy_vars }}'
135
136 - shell:
137 cmd: |
138 OUT=`git ls-files --other --exclude-standard --directory`
139 if [ -z "$OUT" ]; then
140 echo "No extra files created during test."
141 exit 0
142 else
143 echo "The following un-ignored files were created during the test:"
144 echo "$OUT"
145 exit 0 # TODO: change to 1 to fail tests.
146 fi
147 executable: /bin/bash
148 chdir: '{{ ansible_user_dir }}/workspace'
149 environment: '{{ zuul | zuul_legacy_vars }}'
diff --git a/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/post.yaml b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/post.yaml
new file mode 100644
index 0000000..e38d86d
--- /dev/null
+++ b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/post.yaml
@@ -0,0 +1,54 @@
1- hosts: primary
2 tasks:
3
4 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
5 synchronize:
6 src: '{{ ansible_user_dir }}/workspace/'
7 dest: '{{ zuul.executor.log_root }}'
8 mode: pull
9 copy_links: true
10 verify_host: true
11 rsync_opts:
12 - --include=/cover/**
13 - --include=*/
14 - --exclude=*
15 - --prune-empty-dirs
16
17 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
18 synchronize:
19 src: '{{ ansible_user_dir }}/workspace/'
20 dest: '{{ zuul.executor.log_root }}'
21 mode: pull
22 copy_links: true
23 verify_host: true
24 rsync_opts:
25 - --include=/reports/**
26 - --include=*/
27 - --exclude=*
28 - --prune-empty-dirs
29
30 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
31 synchronize:
32 src: '{{ ansible_user_dir }}/workspace/'
33 dest: '{{ zuul.executor.log_root }}'
34 mode: pull
35 copy_links: true
36 verify_host: true
37 rsync_opts:
38 - --include=/npm-shrinkwrap.json
39 - --include=*/
40 - --exclude=*
41 - --prune-empty-dirs
42
43 - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
44 synchronize:
45 src: '{{ ansible_user_dir }}/workspace/'
46 dest: '{{ zuul.executor.log_root }}'
47 mode: pull
48 copy_links: true
49 verify_host: true
50 rsync_opts:
51 - --include=/karma.subunit
52 - --include=*/
53 - --exclude=*
54 - --prune-empty-dirs
diff --git a/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/run.yaml b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/run.yaml
new file mode 100644
index 0000000..3fb659f
--- /dev/null
+++ b/playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/run.yaml
@@ -0,0 +1,149 @@
1- hosts: all
2 name: Autoconverted job legacy-neutron-lbaas-dashboard-nodejs4-npm-run-test from
3 old job gate-neutron-lbaas-dashboard-nodejs4-npm-run-test
4 tasks:
5
6 - name: Ensure legacy workspace directory
7 file:
8 path: '{{ ansible_user_dir }}/workspace'
9 state: directory
10
11 - shell:
12 cmd: |
13 set -e
14 set -x
15 CLONEMAP=`mktemp`
16 function cleanup {
17 # In cases where zuul-cloner is aborted during a git
18 # clone operation, git will remove the git work tree in
19 # its cleanup. The work tree in these jobs is the
20 # workspace directory, which means that subsequent
21 # jenkins post-build actions can not run because the
22 # workspace has been removed.
23 # To reduce the likelihood of this having an impact,
24 # recreate the workspace directory if needed
25 mkdir -p $WORKSPACE
26 rm -f $CLONEMAP
27 }
28 trap cleanup EXIT
29 cat > $CLONEMAP << EOF
30 clonemap:
31 - name: $ZUUL_PROJECT
32 dest: .
33 EOF
34 /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
35 git://git.openstack.org $ZUUL_PROJECT
36 executable: /bin/bash
37 chdir: '{{ ansible_user_dir }}/workspace'
38 environment: '{{ zuul | zuul_legacy_vars }}'
39
40 - shell:
41 cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
42 chdir: '{{ ansible_user_dir }}/workspace'
43 environment: '{{ zuul | zuul_legacy_vars }}'
44
45 - shell:
46 cmd: |
47 set -u
48 set -e
49 set -x
50 # Prerequisites
51 sudo apt-get update
52 sudo apt-get install -y apt-transport-https lsb-release curl
53
54 DISTRO=$(lsb_release -c -s)
55
56 # Install via nodesource
57 curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
58
59 echo "deb https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
60 echo "deb-src https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
61
62 sudo apt-get update
63 sudo apt-get install -y nodejs
64
65 # Output to the log for debugging sake.
66 node --version
67 npm --version
68 executable: /bin/bash
69 chdir: '{{ ansible_user_dir }}/workspace'
70 environment: '{{ zuul | zuul_legacy_vars }}'
71
72 - shell:
73 cmd: |
74 sudo apt-get update
75 sudo apt-get install -y xvfb
76 chdir: '{{ ansible_user_dir }}/workspace'
77 environment: '{{ zuul | zuul_legacy_vars }}'
78
79 - shell:
80 cmd: |
81 sudo apt-get update
82 sudo apt-get install -y chromium-browser
83 chdir: '{{ ansible_user_dir }}/workspace'
84 environment: '{{ zuul | zuul_legacy_vars }}'
85
86 - shell:
87 cmd: |
88 sudo apt-get update
89 sudo apt-get install -y firefox dbus
90 chdir: '{{ ansible_user_dir }}/workspace'
91 environment: '{{ zuul | zuul_legacy_vars }}'
92
93 - shell:
94 cmd: |
95 set -x
96 sudo rm -f /etc/sudoers.d/zuul
97 # Prove that general sudo access is actually revoked
98 ! sudo -n true
99 executable: /bin/bash
100 chdir: '{{ ansible_user_dir }}/workspace'
101 environment: '{{ zuul | zuul_legacy_vars }}'
102
103 - shell:
104 cmd: |
105 DIMENSIONS='1280x1024x24'
106 /usr/bin/Xvfb :99 -screen 0 ${DIMENSIONS} -ac +extension GLX +render -noreset 2>&1 > /dev/null &
107 chdir: '{{ ansible_user_dir }}/workspace'
108 environment: '{{ zuul | zuul_legacy_vars }}'
109
110 - shell:
111 cmd: |
112 set -u
113 set -e
114 set -x
115 export DISPLAY=:99
116 npm install --verbose
117
118 # Try running as a standard lifecycle script, otherwise try custom.
119 npm_lifecycle_phases="publish install version test stop start restart pack"
120
121 if [[ $npm_lifecycle_phases =~ (^| )test($| ) ]]; then
122 npm test --verbose
123 else
124 npm run test --verbose
125 fi
126
127 # If no shrinkwrap exists, generate it.
128 if [ ! -f ./npm-shrinkwrap.json ]; then
129 npm prune # https://github.com/npm/npm/issues/6298
130 npm shrinkwrap
131 fi
132 executable: /bin/bash
133 chdir: '{{ ansible_user_dir }}/workspace'
134 environment: '{{ zuul | zuul_legacy_vars }}'
135
136 - shell:
137 cmd: |
138 OUT=`git ls-files --other --exclude-standard --directory`
139 if [ -z "$OUT" ]; then
140 echo "No extra files created during test."
141 exit 0
142 else
143 echo "The following un-ignored files were created during the test:"
144 echo "$OUT"
145 exit 0 # TODO: change to 1 to fail tests.
146 fi
147 executable: /bin/bash
148 chdir: '{{ ansible_user_dir }}/workspace'
149 environment: '{{ zuul | zuul_legacy_vars }}'
diff --git a/tools/tox_install.sh b/tools/tox_install.sh
index 6cb6e15..9c10d94 100755
--- a/tools/tox_install.sh
+++ b/tools/tox_install.sh
@@ -20,6 +20,7 @@ install_project() {
20 local project=$1 20 local project=$1
21 local branch=${2:-$BRANCH_NAME} 21 local branch=${2:-$BRANCH_NAME}
22 local PROJECT_DIR=$HOME/$project 22 local PROJECT_DIR=$HOME/$project
23 local ZUULV3_PROJECT_DIR=$HOME/src/git.openstack.org/openstack/$project
23 24
24 set +e 25 set +e
25 project_installed=$(echo "import $project" | python 2>/dev/null ; echo $?) 26 project_installed=$(echo "import $project" | python 2>/dev/null ; echo $?)
@@ -32,7 +33,10 @@ install_project() {
32 # Note that the functional tests use sudo to run tox and thus 33 # Note that the functional tests use sudo to run tox and thus
33 # variables used for zuul-cloner to check out the correct version are 34 # variables used for zuul-cloner to check out the correct version are
34 # lost. 35 # lost.
35 if [ -d "$PROJECT_DIR" ]; then 36 if [ -d "$ZUULV3_PROJECT_DIR" ]; then
37 echo "FOUND $project code at $ZUULV3_PROJECT_DIR - using"
38 $install_cmd -U $ZUULV3_PROJECT_DIR
39 elif [ -d "$PROJECT_DIR" ]; then
36 echo "FOUND $project code at $PROJECT_DIR - using" 40 echo "FOUND $project code at $PROJECT_DIR - using"
37 $install_cmd -U $PROJECT_DIR 41 $install_cmd -U $PROJECT_DIR
38 elif [ $project_installed -eq 0 ]; then 42 elif [ $project_installed -eq 0 ]; then
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
new file mode 100644
index 0000000..ff722da
--- /dev/null
+++ b/zuul.d/jobs.yaml
@@ -0,0 +1,17 @@
1- job:
2 name: neutron-lbaas-dashboard-nodejs4-npm-run-lint
3 parent: legacy-base
4 run: playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/run.yaml
5 post-run: playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-lint/post.yaml
6 timeout: 2400
7 required-projects:
8 - openstack/horizon
9
10- job:
11 name: neutron-lbaas-dashboard-nodejs4-npm-run-test
12 parent: legacy-base
13 run: playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/run.yaml
14 post-run: playbooks/legacy/neutron-lbaas-dashboard-nodejs4-npm-run-test/post.yaml
15 timeout: 2400
16 required-projects:
17 - openstack/horizon
diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml
new file mode 100644
index 0000000..7ce0eb4
--- /dev/null
+++ b/zuul.d/projects.yaml
@@ -0,0 +1,12 @@
1# Note: Some official OpenStack wide jobs are still defined in the
2# project-config repository
3- project:
4 name: openstack/neutron-lbaas-dashboard
5 check:
6 jobs:
7 - neutron-lbaas-dashboard-nodejs4-npm-run-lint
8 - neutron-lbaas-dashboard-nodejs4-npm-run-test
9 gate:
10 jobs:
11 - neutron-lbaas-dashboard-nodejs4-npm-run-lint
12 - neutron-lbaas-dashboard-nodejs4-npm-run-test