The code below is some step that is part of a MakeFile which is executed when a certain stage is run in ci/cd.
.PHONY:deploy_endpoint_configuration
deploy_endpoint_configuration:
@echo Deploying endpoint configuration
gcloud endpoints services deploy ocr/model_adapter/predict_contracts.yaml --project $(project) &> $(project_dir)/deploy_contract.txt
cat $(project_dir)/deploy_contract.txt | grep -Eo '\d*-\d*-\w*' | tail -n1 > $(project_dir)/config_id.txt
What I'm experiencing is that the content of deploy_contract.txt etc is always empty when this piece of code is executed in the pipeline (e.g. GitLab). I don't understand why? Has this to do w/ the fact that MakeFile executes a new shell for every command? Not entirely sure though, and yet this is hard to debug. I do confirm this issue when I run it as followed: gitlab-runner exec docker -here the stage- (for local debug purpose). But when I run it locally on macOS (i.e. only execute make deploy_endpoint_configuration), thus it's not wrapped in a container as before, it runs and functions like it should (read as the content of config_id and deploy_contract is not empty but contains the stdout + errorout)
for reference: image used in the ci/cd stage = image: dsl.company.com:5000/python:3.7-buster on top of that gcloud cli is installed to make use of gcloud commands.
Anyone an idea to why no content is written to my files? (it's for sure deploying though - so there must be something)