Update roles/build_fastapi/tasks/main.yml
This commit is contained in:
@@ -20,30 +20,3 @@
|
|||||||
command:
|
command:
|
||||||
cmd: source "{{ build_root_abspath }}/venv/bin/activate"
|
cmd: source "{{ build_root_abspath }}/venv/bin/activate"
|
||||||
cmd: pip install "fastapi[all]"
|
cmd: pip install "fastapi[all]"
|
||||||
- name: hello-world
|
|
||||||
community.docker.docker_image:
|
|
||||||
name: helloworld-fastapi
|
|
||||||
source: build
|
|
||||||
build:
|
|
||||||
path: "{{ build_root_abspath }}"
|
|
||||||
pull: false
|
|
||||||
tag: "{{ demobackend_version }}"
|
|
||||||
- name: run docker
|
|
||||||
community.docker.docker_image:
|
|
||||||
name: demobackend
|
|
||||||
state: started
|
|
||||||
recreate: yes
|
|
||||||
image: "helloworld-fastapi:{{ demobackend_version }}"
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
- name: wait for the api ready
|
|
||||||
wait_for:
|
|
||||||
host: 0.0.0.0
|
|
||||||
port: 8080
|
|
||||||
delay: 10
|
|
||||||
- name: testing api locally
|
|
||||||
shell: "curl -k localhost:8080"
|
|
||||||
register: reg_curl_result
|
|
||||||
- name: show curl result
|
|
||||||
debug:
|
|
||||||
msg: "{{ reg_curl_result.stdout }}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user