Add Zuul job to build Docker image
The job runs in gate pipeline. It creates a new image and pushes it into performa/shaker repo on Dockerhub. Change-Id: I85d26a03c812657138b2ceb2a0496ceb7d015577
This commit is contained in:
parent
abe9fbd877
commit
4b041b2b38
38
.zuul.yaml
38
.zuul.yaml
@ -17,6 +17,7 @@
|
||||
- openstack-tox-docs
|
||||
- shaker-integration-py27
|
||||
- shaker-integration-py35
|
||||
- shaker-docker-build
|
||||
|
||||
- job:
|
||||
name: shaker-integration-py27
|
||||
@ -39,3 +40,40 @@
|
||||
To run tests manually use ``tox -e integration-py35`` command.
|
||||
vars:
|
||||
tox_envlist: integration-py35
|
||||
|
||||
- secret:
|
||||
name: shaker_dockerhub_creds
|
||||
data:
|
||||
user: !encrypted/pkcs1-oaep
|
||||
- a4sMxynvpW3Mm+dDCQSF273Hf3nG4Wtsbt5kFWnKzOs9gT+TNV2QxDLpr+b1v/83BTv+0
|
||||
YT1F5YM6xCRC8ZG8Kr7jBUrpEoWbSBvgQ6/nwqAmyP7BHMxmDSbUKA+BXusABFN/VKKwC
|
||||
IfMnVPP+FRZZJorEZNLGV9AtNwTM9mcwQB56we26V34pkctAIOpRL6UwNIGjMBeMo65lV
|
||||
EFbMdbwA7DLzWZEh1CIIcgpflPk4GTqPljOGgrGoi4LzB6oPFobNP71lH7BHrCyZ28TWs
|
||||
ShdydVAVBx/w7OYJ2rlpIAheS7+d0kvtccHmSXSTH0auRl54hMIuuKdWzYaLRE1CH1biG
|
||||
tAC9Sua3SBVqTJvOcMM7EPk3lbPumj6pKoe2/njQJ2RQXeIibyWxtyPXJVxLKdWsUHOaP
|
||||
588ASe6qzxHUC96axDyh4TxlfFGe8nyAFJKcNvqnEs6P3vRzHQnGctY/6lWBtfAdczH7j
|
||||
39NGQXz4ZmFNrU0SNNV/nqQpZWeVzAYC+nvPR0xCC31lePzK2oCcIy6Y4QjboofM/VvO1
|
||||
mIMIDf/9tOfOYkifZlDJ/bmqSNiQUcM3hMRwaQ+z6LXKpn/dycPnz8uYockl/aFUgnF/u
|
||||
BpdPq3gNzwarssjgVY6LYsQTVcVYX5etUePetObYg7kC2A42uKGp/2Js051LsI=
|
||||
password: !encrypted/pkcs1-oaep
|
||||
- 9i6D/3pIAzQbGTkXoKV4Fn8Cl4huDd+pD38zxGU+JEFY4fE+2+WgW8cTEbXQ1gA30L2GY
|
||||
M92coVTDSDJbmC6ntZwL3TwQ0KW7GRUoqtxtxMutKo3QDdnKhHLpY03w1indD9Bzzr+Ml
|
||||
yqhSnqiQLKR1ZSuD1eEZWxVZcNPw+I62ItPTbGVSPrfkgo1dTKIvmX7URD/a3TeEHga0o
|
||||
96kQM68W/sBY2GvA9EWMjRiZ8zXUcTQ+PZToiiyJPNCuKx6BJ4qt2Cau9YXhzktrqEccO
|
||||
QoTmqT4M+T1g5oFcKr1pBazWQ+bWcWPPfG/Yu5fwYPlmZgzUARkxssw2baZQ1+ebNQvIY
|
||||
nnwcdJVV8PNoxeejGJNZQIiU/jHhESw+aQz/YztBZJuaPAVCNVQLG5BfSGa7Dit6zc8Sc
|
||||
fJ/nB21xDOyQ7tId/EiIYaKzOKDCr51AZEXG55eLTk4OfbrVBZIlJYfmEms1bEtRuD6Mn
|
||||
CmNpFas1Mwmzk0GZYNG3UiGNbO1Kyjqgec0tB5+2PkZ6QkRuLRgaW2/FZNVbyc9J35M3b
|
||||
XkOAyW1YuYBsdaufM1adGrJ+R+5+Slq2QkF6nSXrykl7ok6cX3bnZh42MM0av8Pi6w+jj
|
||||
9PZXU8qiG7f/OYt0xFMWtBK0rfb5J+K7dVIjFI+Zrj6fpa2OjNjE31rlcB+/RM=
|
||||
|
||||
- job:
|
||||
name: shaker-docker-build
|
||||
parent: base
|
||||
nodeset: ubuntu-bionic
|
||||
description: |
|
||||
Build Docker image for Shaker
|
||||
run: tools/playbooks/dockerhub_publish.yml
|
||||
secrets:
|
||||
- shaker_dockerhub_creds
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
FROM python:3.5
|
||||
LABEL maintainer "Ilya Shakhat <shakhat@gmail.com>"
|
||||
LABEL maintainer="Ilya Shakhat <shakhat@gmail.com>"
|
||||
|
||||
RUN echo "deb http://httpredir.debian.org/debian jessie non-free" >> /etc/apt/sources.list \
|
||||
&& apt-get update \
|
||||
|
@ -45,11 +45,11 @@ Shaker in Container
|
||||
-------------------
|
||||
|
||||
Shaker is available as container at Docker Hub at
|
||||
`shakhat/shaker <https://hub.docker.com/r/shakhat/shaker/>`_
|
||||
`performa/shaker <https://hub.docker.com/r/performa/shaker/>`_
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ docker run -p <port>:<port> -v <artifacts-dir>:/artifacts shakhat/shaker --scenario <scenario> --server-endpoint <host:port>
|
||||
$ docker run -p <port>:<port> -v <artifacts-dir>:/artifacts performa/shaker --scenario <scenario> --server-endpoint <host:port>
|
||||
--os-auth-url <os-auth-url> --os-username <os-username> --os-password <os-password> --os-project-name <os-project-name>
|
||||
|
||||
where:
|
||||
@ -63,6 +63,7 @@ where:
|
||||
Links
|
||||
-----
|
||||
* PyPi - https://pypi.org/project/pyshaker/
|
||||
* Docker - https://hub.docker.com/r/shakhat/shaker/
|
||||
* Docker - https://hub.docker.com/r/performa/shaker/
|
||||
* Docs - http://pyshaker.readthedocs.io/
|
||||
* Bugtracker - https://launchpad.net/shaker/
|
||||
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
value: openstack/perf_l2
|
||||
- name: SHAKER_SERVER_ENDPOINT
|
||||
value: 172.20.9.7:31999
|
||||
image: shakhat/shaker
|
||||
image: performa/shaker
|
||||
imagePullPolicy: Always
|
||||
name: shaker
|
||||
securityContext:
|
||||
|
24
tools/playbooks/dockerhub_publish.yml
Normal file
24
tools/playbooks/dockerhub_publish.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Install Docker
|
||||
apt:
|
||||
name: docker.io
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: changing permission of Docker socket to 666
|
||||
file:
|
||||
path: /run/docker.sock
|
||||
mode: 666
|
||||
become: true
|
||||
|
||||
- name: Build a container
|
||||
command: "docker build -t performa/shaker:latest {{ zuul.project.src_dir }}"
|
||||
|
||||
- name: Login to Dockerhub
|
||||
command: "docker login -u {{ shaker_dockerhub_creds.user }} -p {{ shaker_dockerhub_creds.password }}"
|
||||
no_log: true
|
||||
|
||||
- name: Push images to Dockerhub
|
||||
shell: "for img in $(docker images --format '{% raw %}{{ .Repository }}:{{ .Tag }}{% endraw %}' | grep shaker ); do docker push $img; done"
|
Loading…
Reference in New Issue
Block a user