Skip to content

Commit

Permalink
Fix templates files copied in CI script
Browse files Browse the repository at this point in the history
Signed-off-by: gabriel-farache <[email protected]>
  • Loading branch information
gabriel-farache committed Oct 11, 2024
1 parent 279ee2d commit 48759c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/m2k-func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ on:
required: false
type: boolean
default: false
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'move2kube/m2k-func/**'
- 'pipeline/**'
- .github/workflows/m2k-func.yaml

env:
WORKDIR: move2kube/m2k-func
Expand Down Expand Up @@ -85,6 +78,7 @@ jobs:
- name: Send PRs to config repo
if: ${{ ! inputs.it_mode }}
run: |
WORKDIR=${{ runner.temp }}/serverless-workflows
# determine pr or commit url
if [ ${{ fromJSON(steps.get_pr_data.outputs.result)}} != "" ]; then
PR_OR_COMMIT_URL="${{ fromJSON(steps.get_pr_data.outputs.result).html_url }}"
Expand All @@ -102,7 +96,7 @@ jobs:
yq --inplace '.kfunction.image="quay.io/orchestrator/serverless-workflow-m2k-kfunc:${{ github.sha }}"' charts/move2kube/values.yaml
cd ..
echo "Running create_or_update_automated_pr script"
sh scripts/create_or_update_automated_pr.sh $WF_CONFIG_REPO \
${{ inputs.workflow_id }} \
${PR_OR_COMMIT_URL} \
Expand Down
7 changes: 0 additions & 7 deletions scripts/create_automated_m2k_kfunc_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@ WORKFLOW_ID=$4
PR_OR_COMMIT_URL=$5
GH_TOKEN=$6
WF_CONFIG_REPO=$7
INPUT_VALUES_FILEPATH=$8

git config --global user.email "${USER_EMAIL}"
git config --global user.name "${USER_NAME}"
gh repo clone "${WF_CONFIG_REPO}" config-repo
cd config-repo || exit
git switch -c "${WORKFLOW_ID}"-autopr-"${RANDOM}"

./../hack/bump_chart_version.sh "${WORKFLOW_ID}" --bump-tag-version

cp "${INPUT_VALUES_FILEPATH}" charts/move2kube/values.yaml

mkdir -p charts/"${WORKFLOW_ID}"/templates
cp "${WORKDIR}"/"${WORKFLOW_ID}"/manifests/* charts/"${WORKFLOW_ID}"/templates
Expand Down
4 changes: 2 additions & 2 deletions scripts/create_or_update_automated_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ for pr in $prs; do
git checkout "$pr_branch"

# Create the new file
cp -r "${WORKDIR}/${WORKFLOW_ID}/manifests/" "charts/${WORKFLOW_ID}/templates/" || exit 1
cp "${WORKDIR}"/"${WORKFLOW_ID}"/manifests/* charts/"${WORKFLOW_ID}"/templates || exit 1
if [ "${INPUT_VALUES_FILEPATH}" != "" ]; then
cp "${INPUT_VALUES_FILEPATH}" "charts/${WORKFLOW_ID}/values.yaml" || exit 1
fi
Expand All @@ -72,4 +72,4 @@ sh "${CREATE_PR_SCRIPT}" "${USER_EMAIL}" \
"${WORKFLOW_ID}" \
"${PR_OR_COMMIT_URL}" \
"${GH_TOKEN}" \
"${WF_CONFIG_REPO}"
"${WF_CONFIG_REPO}"

0 comments on commit 48759c9

Please sign in to comment.