diff --git a/.github/workflows/Build_Push_Image.yml b/.github/workflows/Build_Push_Image.yml index c5f99e164..0f7c6c9b0 100644 --- a/.github/workflows/Build_Push_Image.yml +++ b/.github/workflows/Build_Push_Image.yml @@ -57,6 +57,13 @@ jobs: - name: Remove the pre-cached Docker images run: docker image prune --all --force + - name: Generate pyproject.toml + env: + ANSIBLE_AI_PROJECT_ALIAS: ${{ vars.ANSIBLE_AI_PROJECT_ALIAS }} + ANSIBLE_AI_PROJECT_NAME: ${{ vars.ANSIBLE_AI_PROJECT_NAME }} + run: | + envsubst < pyproject.toml.tmpl > pyproject.toml + - name: Build Image id: build-image uses: redhat-actions/buildah-build@v2 diff --git a/.gitignore b/.gitignore index 7ec9fefdc..ef1862ad2 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,5 @@ grafana/* # Local LaunchDarkly data ./flagdata.json + +pyproject.toml \ No newline at end of file diff --git a/Makefile b/Makefile index 5861c0cd5..0a70d74c6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ ENVIRONMENT ?= development TAG ?= latest -ANSIBLE_AI_PROJECT_NAME ?= "Ansible AI Connect" +export ANSIBLE_AI_PROJECT_ALIAS ?= ansible-ai-connect +export ANSIBLE_AI_PROJECT_NAME ?= Ansible AI Connect # Choose between docker and podman based on what is available ifeq (, $(shell which podman)) @@ -45,8 +46,12 @@ DEPRECATED: # DEPRECATED: Please use build-wisdom-container instead ansible-wisdom-container: build-wisdom-container DEPRECATED +.PHONY: generate-pyproject +generate-pyproject: + envsubst < pyproject.toml.tmpl > pyproject.toml + .PHONY: build-wisdom-container -build-wisdom-container: +build-wisdom-container: generate-pyproject ${CONTAINER_RUNTIME} build -f wisdom-service.Containerfile -t ansible_wisdom . # DEPRECATED: Please use run-server instead diff --git a/pyproject.toml b/pyproject.toml.tmpl similarity index 96% rename from pyproject.toml rename to pyproject.toml.tmpl index fd8865ac7..d4342ea10 100644 --- a/pyproject.toml +++ b/pyproject.toml.tmpl @@ -3,8 +3,8 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] -name = "ansible-wisdom" -description = "Ansible Lightspeed with IBM watsonx Code Assistant." +name = "$ANSIBLE_AI_PROJECT_ALIAS" +description = "$ANSIBLE_AI_PROJECT_NAME" version = "0.1.0" dependencies = [ 'ansible~=8.5.0',