1 # Copyright (c) 2017 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 yardstick_image_name: "yardstick_python{{ python_version }}_{{ target_os }}"
20 - debug: var=docker_build_dir
22 - file: dest="{{ docker_build_dir }}" state=directory
26 - template: "src={{ target_os }}/Dockerfile dest={{ docker_build_dir }}/Dockerfile"
30 - name: bootstrap repos
31 template: "src=Ubuntu-repos.j2 dest={{ docker_build_dir}}/sources.list"
32 when: use_ext == "intr"
34 - name: Create apt.conf.d/ proxy config
37 dest: "{{ docker_build_dir }}/20proxy"
38 when: "'http_proxy' in proxy_env"
40 - name: set pip mirror
41 template: "src=pip.conf.j2 dest={{ docker_build_dir }}/pip.conf"
42 when: pip_mirror_url is defined and pip_mirror_url
44 - name: easy_utils mirror
45 template: "src=pydistutils.cfg.j2 dest={{ docker_build_dir }}/pydistutils.cfg"
46 when: pip_mirror_url is defined and pip_mirror_url
49 yardstick_base: "{{ docker_registry ~ '/' if docker_registry|default('') else '' }}{{ yardstick_image_name}}"
53 yardstick_base_tag: "{{ docker_image_tag|default('v1') }}"
55 - debug: var=yardstick_base
57 #- command: "docker build {{ docker_build_dir }}"
58 #- fail: msg="don't build"
61 name: "{{ yardstick_base }}"
62 tag: "{{ yardstick_base_tag }}"
63 path: "{{ docker_build_dir }}"
67 # push is broken, manually push
70 register: docker_image_results
72 - debug: var=docker_image_results
74 - name: manual push image
75 command: docker push {{ yardstick_base }}
76 when: not release and docker_image_results|changed
77 register: docker_image_push
81 - debug: var=docker_image_push