Skip to content

Commit 876a6bb

Browse files
authored
ci use azp to sync filter example (#13501)
Signed-off-by: Lizan Zhou <[email protected]>
1 parent 7857873 commit 876a6bb

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.azure-pipelines/pipelines.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,24 @@ jobs:
115115
artifactSuffix: ".arm64"
116116
bazelBuildExtraOptions: "--sandbox_base=/tmp/sandbox_base"
117117

118+
- job: filter_example
119+
displayName: "filter-example sync"
120+
dependsOn: []
121+
condition: and(succeeded(), eq(variables['PostSubmit'], true))
122+
steps:
123+
- task: InstallSSHKey@0
124+
inputs:
125+
hostName: "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
126+
sshPublicKey: "$(FilterExamplePublicKey)"
127+
sshPassphrase: "$(SshDeployKeyPassphrase)"
128+
sshKeySecureFile: "$(FilterExamplePrivateKey)"
129+
130+
- bash: ci/filter_example_mirror.sh
131+
displayName: "Sync envoy-filter-example"
132+
workingDirectory: $(Build.SourcesDirectory)
133+
env:
134+
AZP_BRANCH: $(Build.SourceBranch)
135+
118136
- job: bazel
119137
displayName: "Linux-x64"
120138
dependsOn: ["release"]

.circleci/config.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,9 @@ jobs:
3535
- "9d:3b:fe:7c:09:3b:ce:a9:6a:de:de:41:fb:6b:52:62"
3636
- run: ci/go_mirror.sh
3737

38-
filter_example_mirror:
39-
executor: ubuntu-build
40-
steps:
41-
- run: rm -rf /home/circleci/project/.git # CircleCI git caching is likely broken
42-
- checkout
43-
- add_ssh_keys:
44-
fingerprints:
45-
- "f6:f9:df:90:9c:4b:5f:9c:f4:69:fd:42:94:ff:88:24"
46-
- run: ci/filter_example_mirror.sh
47-
4838
workflows:
4939
version: 2
5040
all:
5141
jobs:
5242
- api
5343
- go_control_plane_mirror
54-
- filter_example_mirror

ci/filter_example_mirror.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ set -e
44

55
ENVOY_SRCDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../" && pwd)
66
CHECKOUT_DIR=../envoy-filter-example
7+
MAIN_BRANCH="refs/heads/master"
8+
FILTER_EXAMPLE_MAIN_BRANCH="master"
79

8-
if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" == "master" ]
9-
then
10+
if [[ "${AZP_BRANCH}" == "${MAIN_BRANCH}" ]]; then
1011
echo "Cloning..."
11-
git clone [email protected]:envoyproxy/envoy-filter-example "$CHECKOUT_DIR"
12+
git clone [email protected]:envoyproxy/envoy-filter-example "$CHECKOUT_DIR" -b "${FILTER_EXAMPLE_MAIN_BRANCH}"
1213

13-
git -C "$CHECKOUT_DIR" config user.name "envoy-filter-example(CircleCI)"
14+
git -C "$CHECKOUT_DIR" config user.name "envoy-filter-example(Azure Pipelines)"
1415
git -C "$CHECKOUT_DIR" config user.email [email protected]
15-
git -C "$CHECKOUT_DIR" fetch
16-
git -C "$CHECKOUT_DIR" checkout -B master origin/master
1716

1817
echo "Updating Submodule..."
1918
# Update submodule to latest Envoy SHA
@@ -26,6 +25,6 @@ then
2625

2726
echo "Committing, and Pushing..."
2827
git -C "$CHECKOUT_DIR" commit -a -m "Update Envoy submodule to $ENVOY_SHA"
29-
git -C "$CHECKOUT_DIR" push origin master
28+
git -C "$CHECKOUT_DIR" push origin "${FILTER_EXAMPLE_MAIN_BRANCH}"
3029
echo "Done"
3130
fi

0 commit comments

Comments
 (0)