Browse Source

Ensure we can build docker images

Create a new job that will allow us to publish our dox images. This
will remove the need to manually publish them.

Change-Id: I1f817b9154bfebe87b5c66291e70bc8fc10f203a
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Paul Belanger 2 years ago
parent
commit
9bc1b0368e
No account linked to committer's email address
3 changed files with 57 additions and 0 deletions
  1. 1
    0
      bindep.txt
  2. 38
    0
      tools/tarball.sh
  3. 18
    0
      tools/test-setup.sh

+ 1
- 0
bindep.txt View File

@@ -1,5 +1,6 @@
1 1
 # This is a cross-platform list tracking distribution packages needed by tests;
2 2
 # see http://docs.openstack.org/infra/bindep/ for additional information.
3 3
 
4
+docker.io [platform:dpkg test]
4 5
 python-dev [platform:dpkg test]
5 6
 python-devel [platform:rpm test]

+ 38
- 0
tools/tarball.sh View File

@@ -0,0 +1,38 @@
1
+#!/bin/bash -ex
2
+# Copyright 2017 Red Hat, Inc.
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#    http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+# implied.
14
+# See the License for the specific language governing permissions and
15
+# limitations under the License.
16
+
17
+GROUP=docker
18
+if [ $(id -gn) != ${GROUP} ]; then
19
+  exec sg ${GROUP} "$0 $*"
20
+fi
21
+
22
+### Build image with docker
23
+IMAGES="infra/centos7 infra/trusty"
24
+for IMAGE in $IMAGES; do
25
+    docker build dockerfiles/$IMAGE -t $IMAGE
26
+done
27
+
28
+docker images
29
+
30
+# NOTE(pabelanger): Make sure we hash by ZUUL_COMMIT, so we know which tarball
31
+# to download from secure worker.
32
+DIST=$WORKSPACE/dist/$ZUUL_COMMIT
33
+mkdir -p $DIST
34
+
35
+### Save docker image for upload to tarballs.o.o
36
+FILENAME=images.tar.gz
37
+docker save $IMAGES | gzip -9 > $DIST/$FILENAME
38
+shasum $DIST/$FILENAME > $DIST/$FILENAME.sha256

+ 18
- 0
tools/test-setup.sh View File

@@ -0,0 +1,18 @@
1
+#!/bin/bash -ex
2
+# Copyright 2017 Red Hat, Inc.
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#    http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+# implied.
14
+# See the License for the specific language governing permissions and
15
+# limitations under the License.
16
+
17
+sudo gpasswd -a ${USER} docker
18
+sudo service docker restart

Loading…
Cancel
Save