@@ -27,36 +27,58 @@ jobs:
2727 run : |
2828 echo "Showing content of current AgentBootstrap"
2929 cat instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
30+
31+ # Clean up any existing temp files
3032 rm -f /tmp/com.instana.agent.bootstrap.AgentBootstrap.cfg
31- echo "Create temporary copy of the configuration file"
33+ rm -f /tmp/values.yaml
34+ rm -f /tmp/instana-agent.customresource.yaml
35+
36+ # Copy all relevant files to temp directory
37+ echo "Create temporary copies of the configuration files"
3238 cp instana/com.instana.agent.bootstrap.AgentBootstrap.cfg /tmp/
39+ cp kubernetes/instana/helm-chart/dynamic-agent/values.yaml /tmp/values.yaml
40+ cp kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml /tmp/instana-agent.customresource.yaml
41+
3342 echo "Checking out main branch"
3443 git fetch origin main
3544 git checkout main
3645 echo "Creating new branch from main"
3746 git checkout -b promote-test-to-main
38- echo "Replace config file on main"
47+
48+ echo "Replace config files on main"
3949 rm -f instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
50+ rm -f kubernetes/instana/helm-chart/dynamic-agent/values.yaml
51+ rm -f kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml
52+
4053 cp -f /tmp/com.instana.agent.bootstrap.AgentBootstrap.cfg instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
41- echo "Check if file was changed"
54+ cp -f /tmp/values.yaml kubernetes/instana/helm-chart/dynamic-agent/values.yaml
55+ cp -f /tmp/instana-agent.customresource.yaml kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml
56+
57+ echo "Check if files were changed"
4258 if [[ `git status --porcelain` ]]; then
43- echo "The file has changed, continue to commit and push"
59+ echo "Files have changed, continue to commit and push"
4460 else
45- echo "The file is unchanged, main is already in sync with test branch, no further action needed"
61+ echo "Files are unchanged, main is already in sync with test branch, no further action needed"
4662 exit 0
4763 fi
4864
4965 echo "Setting git author"
5066 git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
5167 git config --global user.name "${GITHUB_ACTOR}"
52- echo "Commiting change "
68+ echo "Commiting changes "
5369 git add instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
54- git commit -m "chore: Sync AgentBootstrap from current test branch"
70+ git add kubernetes/instana/helm-chart/dynamic-agent/values.yaml
71+ git add kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml
72+ git commit -m "chore: Sync Instana agent configurations from current test branch"
5573 echo "Push change to feature branch"
5674 git push origin -f promote-test-to-main
5775 UPDATED_VERSION=$(cat instana/com.instana.agent.bootstrap.AgentBootstrap.cfg | grep "version = " | grep -v "#" | cut -c11-)
5876 PR_TITLE="chore(deps): Update Instana Agent Production to v${UPDATED_VERSION}"
59- echo "Automated sync of instana/com.instana.agent.bootstrap.AgentBootstrap.cfg from branch \"test\" to \"main\"." > body-file.txt
77+ echo "Automated sync of Instana agent configurations from branch \"test\" to \"main\"." > body-file.txt
78+ echo "Files updated:" >> body-file.txt
79+ echo "- instana/com.instana.agent.bootstrap.AgentBootstrap.cfg" >> body-file.txt
80+ echo "- kubernetes/instana/helm-chart/dynamic-agent/values.yaml" >> body-file.txt
81+ echo "- kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml" >> body-file.txt
6082 echo "Make sure that the test environment works as expected before approving and merging the change." >> body-file.txt
6183 echo "Merging will **trigger an production update including an agent restart**." >> body-file.txt
6284 echo "" >> body-file.txt
0 commit comments