Skip to content

Commit

Permalink
ci use azp to sync filter example (#13501)
Browse files Browse the repository at this point in the history
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
  • Loading branch information
lizan authored Oct 13, 2020
1 parent 7857873 commit 876a6bb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
18 changes: 18 additions & 0 deletions .azure-pipelines/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
11 changes: 0 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 6 additions & 7 deletions ci/filter_example_mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 876a6bb

Please sign in to comment.