Skip to content

Commit

Permalink
[TD-876] Update sync-automation workflow. (TykTechnologies#3909)
Browse files Browse the repository at this point in the history
This will add the latest updates to the sync-automation workflow, that can copy over all of the ci related
changes(consolidated within ci/), and UI and API integration tests to the specified release branches.
  • Loading branch information
asutosh authored Mar 7, 2022
1 parent c098746 commit 455c089
Showing 1 changed file with 29 additions and 43 deletions.
72 changes: 29 additions & 43 deletions .github/workflows/sync-automation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Generated by: gromit policy
# Generated on: 2021-06-03 06:31:05.998191957 +0000 UTC

# This workflow should only exist in master
# Missing files are silently ignored. Most of the time this is what we want, older repos may not have some files
# If fwd or backport branches do not exist, they will be created

# Generated by: tyk-ci/wf-gen
# Generated on: Friday 04 March 2022 11:25:29 AM UTC

# Generation commands:
# ./meta.zsh -repos tyk -title Update sync automation -branch sync/td-876 -base sync/td-876
# m4 -E -DxSRC_BRANCH='master' -DxRELEASE_BRANCHES='release-4-lts, release-3.2.3, release-4' -DxAUTO_FILES='ci .github/workflows/release.yml .github/dependabot.yml .github/workflows/del-env.yml .github/workflows/api-tests.yml .github/workflows/ui-tests.yml'

# This workflow will silently ignore FILES that are missing in master
# Most of the time this is what we want, older repos may not have some files

name: Sync automation

Expand All @@ -12,56 +17,37 @@ on:
branches:
- master
paths:
- bin/unlock-agent.sh
- .goreleaser.yml
- Dockerfileg.std
- Dockerfile.slim
- aws/byol.pkr.hcl
- .github/workflows/release.yml
- .github/workflows/del-env.yml
- integration/terraform/outputs.tf
- install/before_install.sh
- install/post_install.sh
- install/post_remove.sh
- images/*

jobs:
- .github/workflows/api-tests.yml
- .github/workflows/ui-tests.yml
- ci/*

env:
FILES: ci .github/workflows/release.yml .github/dependabot.yml .github/workflows/del-env.yml .github/workflows/api-tests.yml .github/workflows/ui-tests.yml


fwdport:
jobs:
sync:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
branch:
- release-3.2
- release-3.2.0

branch: [ release-4-lts, release-3.2.3, release-4 ]

steps:
- uses: actions/checkout@v2
with:
ref: ${{matrix.branch}}
token: ${{ secrets.ORG_GH_TOKEN }}

- name: Forward port master → ${{matrix.branch}}
- name: sync ${{matrix.branch}} from master
run: |
git checkout ${{matrix.branch}} || git checkout -b ${{matrix.branch}}
git config --local user.email "policy@gromit"
git fetch origin master
git config --local user.email "wf-gen@tyk-ci"
git config --local user.name "Bender"
git checkout --theirs origin/master -- bin/unlock-agent.sh
git checkout --theirs origin/master -- .goreleaser.yml
git checkout --theirs origin/master -- Dockerfileg.std
git checkout --theirs origin/master -- Dockerfile.slim
git checkout --theirs origin/master -- aws/byol.pkr.hcl
git checkout --theirs origin/master -- .github/workflows/release.yml
git checkout --theirs origin/master -- .github/workflows/del-env.yml
git checkout --theirs origin/master -- integration/terraform/outputs.tf
git checkout --theirs origin/master -- install/before_install.sh
git checkout --theirs origin/master -- install/post_install.sh
git checkout --theirs origin/master -- install/post_remove.sh
git checkout --theirs origin/master -- images/*
git commit -m "[CI] Fwdport release automation from master" -m "${{ github.event.head_commit.message }}"
git push -u origin ${{matrix.branch}}
echo "::debug::syncd from master to ${{matrix.branch}}"
for f in $FILES; do
git checkout --theirs origin/master -- $f || true
done
git commit -a -m "[CI] Syncing release automation from master"
git push origin
echo "::debug::${FILES} syncd for ${{matrix.branch}}"

0 comments on commit 455c089

Please sign in to comment.