# -*- mode: bash -*-


CYCLOS_CONFIG="/usr/local/cyclos/WEB-INF/classes/cyclos.properties"
HOST_CYCLOS_CONFIG="$SERVICE_CONFIGSTORE$CYCLOS_CONFIG"

cyclos:build() {
    docker pull "$DOCKER_BASE_IMAGE" || return 1
    mkdir -p "$(dirname "$HOST_CYCLOS_CONFIG")"
    container_id=$(docker run -d --entrypoint true "$DOCKER_BASE_IMAGE") || return 1
    mkdir -p "$(dirname "$HOST_CYCLOS_CODE")" &&
        docker cp "$container_id":"$CYCLOS_CONFIG" "$HOST_CYCLOS_CONFIG" &&
        docker rm "$container_id"
}