deckhand/tools/gate/roles/deploy-deckhand/tasks/deploy-deckhand.yaml

44 lines
1.3 KiB
YAML

# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Deploy Deckhand using Docker
shell: |-
set -ex;
echo "Running Deckhand via Docker."
# Do database migrations.
docker run \
--rm \
--net=host \
-v "{{ deckhand_conf_dir.stdout }}":/etc/deckhand \
"{{ airship_deckhand_image_id.stdout }}" alembic upgrade head &
# Allow migrations to complete.
sleep 5
# Start Deckhand container.
docker run \
--rm \
--net=host \
-p 9000:9000 \
-v "{{ deckhand_conf_dir.stdout }}":/etc/deckhand \
"{{ airship_deckhand_image_id.stdout }}" server &
# Give the server a chance to come up. Better to poll a health check.
sleep 5
args:
chdir: "{{ airship_deckhand_path.stdout }}"
become: yes