diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index 3cbb88eebba5..31fb5e06fae0 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -115,6 +115,24 @@ jobs: artifactSuffix: ".arm64" bazelBuildExtraOptions: "--sandbox_base=/tmp/sandbox_base" + - job: filter_example + displayName: "filter-example sync" + dependsOn: [] + condition: and(succeeded(), eq(variables['PostSubmit'], true)) + steps: + - task: InstallSSHKey@0 + inputs: + hostName: "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" + sshPublicKey: "$(FilterExamplePublicKey)" + sshPassphrase: "$(SshDeployKeyPassphrase)" + sshKeySecureFile: "$(FilterExamplePrivateKey)" + + - bash: ci/filter_example_mirror.sh + displayName: "Sync envoy-filter-example" + workingDirectory: $(Build.SourcesDirectory) + env: + AZP_BRANCH: $(Build.SourceBranch) + - job: bazel displayName: "Linux-x64" dependsOn: ["release"] diff --git a/.circleci/config.yml b/.circleci/config.yml index 105c71dba328..e04a9737d8f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,20 +35,9 @@ jobs: - "9d:3b:fe:7c:09:3b:ce:a9:6a:de:de:41:fb:6b:52:62" - run: ci/go_mirror.sh - filter_example_mirror: - executor: ubuntu-build - steps: - - run: rm -rf /home/circleci/project/.git # CircleCI git caching is likely broken - - checkout - - add_ssh_keys: - fingerprints: - - "f6:f9:df:90:9c:4b:5f:9c:f4:69:fd:42:94:ff:88:24" - - run: ci/filter_example_mirror.sh - workflows: version: 2 all: jobs: - api - go_control_plane_mirror - - filter_example_mirror diff --git a/ci/filter_example_mirror.sh b/ci/filter_example_mirror.sh index 1d6d5ae05b23..8602b1677e4b 100755 --- a/ci/filter_example_mirror.sh +++ b/ci/filter_example_mirror.sh @@ -4,16 +4,15 @@ set -e ENVOY_SRCDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../" && pwd) CHECKOUT_DIR=../envoy-filter-example +MAIN_BRANCH="refs/heads/master" +FILTER_EXAMPLE_MAIN_BRANCH="master" -if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" == "master" ] -then +if [[ "${AZP_BRANCH}" == "${MAIN_BRANCH}" ]]; then echo "Cloning..." - git clone git@github.com:envoyproxy/envoy-filter-example "$CHECKOUT_DIR" + git clone git@github.com:envoyproxy/envoy-filter-example "$CHECKOUT_DIR" -b "${FILTER_EXAMPLE_MAIN_BRANCH}" - git -C "$CHECKOUT_DIR" config user.name "envoy-filter-example(CircleCI)" + git -C "$CHECKOUT_DIR" config user.name "envoy-filter-example(Azure Pipelines)" git -C "$CHECKOUT_DIR" config user.email envoy-filter-example@users.noreply.github.com - git -C "$CHECKOUT_DIR" fetch - git -C "$CHECKOUT_DIR" checkout -B master origin/master echo "Updating Submodule..." # Update submodule to latest Envoy SHA @@ -26,6 +25,6 @@ then echo "Committing, and Pushing..." git -C "$CHECKOUT_DIR" commit -a -m "Update Envoy submodule to $ENVOY_SHA" - git -C "$CHECKOUT_DIR" push origin master + git -C "$CHECKOUT_DIR" push origin "${FILTER_EXAMPLE_MAIN_BRANCH}" echo "Done" fi