3 remote_user: "{{ user }}"
9 update_path: "/tmp/testapi"
10 image: "opnfv/testapi"
12 mongodb_url: "mongodb://172.17.0.1:27017"
13 swagger_url: "http://{{ host }}:{{ port }}"
15 - name: create temporary update directory
17 path: "{{ update_path }}"
19 - name: transfer files in templates
22 dest: "{{ update_path }}"
23 - name: transfer Dockerfile
25 src: ../docker/Dockerfile
26 dest: "{{ update_path }}"
28 - name: backup mongodb database
29 command: "python {{ update_path }}/backup_mongodb.py -u {{ mongodb_url }} -o {{ update_path }}"
30 - name: stop and remove old versions
31 command: bash "{{ update_path }}/rm_olds.sh"
33 - debug: msg="{{ rm_result.stderr }}"
34 - name: delete old docker images
35 command: bash "{{ update_path }}/rm_images.sh"
37 - name: update mongodb
38 command: "python {{ update_path }}/update_mongodb.py -u {{ mongodb_url }}"
39 - name: docker build image
40 command: "docker build -t {{ image }} {{ update_path }}"
42 - name: docker start testapi server
43 command: docker run -dti -p "{{ port }}:8000"
44 -e "mongodb_url={{ mongodb_url }}"
45 -e "swagger_url={{ swagger_url }}"
47 - name: remove temporary update directory
49 path: "{{ update_path }}"