github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/pkg/cloud-hypervisor/Makefile (about)

     1  #
     2  # Copyright (c) 2019 Intel Corporation
     3  #
     4  # SPDX-License-Identifier: Apache-2.0
     5  #
     6  
     7  all: | update-yaml generate-client-code
     8  MK_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
     9  YQ_INSTALLER := "$(MK_DIR)/../../../.ci/install-yq.sh"
    10  VERSIONS_FILE := "$(MK_DIR)/../../../versions.yaml"
    11  YQ := $(shell command -v yq 2> /dev/null)
    12  
    13  generate-client-code: clean-generated-code
    14  	docker run --rm \
    15  		--user $$(id -u):$$(id -g) \
    16  		-v $${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate \
    17  		-i /local/cloud-hypervisor.yaml \
    18  		-g go \
    19  		-o /local/client
    20  
    21  
    22  
    23  update-yaml:
    24  ifndef YQ
    25  	$(MK_DIR)/../../../.ci/install-yq.sh
    26  endif
    27  	clh_version=$(shell yq r $(VERSIONS_FILE) assets.hypervisor.cloud_hypervisor.version); \
    28  	curl -OL https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/$$clh_version/vmm/src/api/openapi/cloud-hypervisor.yaml
    29  
    30  clean-generated-code:
    31  	rm "./client" -rf