Skip to content

Instantly share code, notes, and snippets.

@mike-carey
Last active March 26, 2018 21:00
Show Gist options
  • Save mike-carey/25edfdc9356c25bcb564956c9446c704 to your computer and use it in GitHub Desktop.
Save mike-carey/25edfdc9356c25bcb564956c9446c704 to your computer and use it in GitHub Desktop.
Shows a concourse example of keeping a mirror in sync with its original
# Original
git_original_uri: # Fill in URI
git_original_branch: master # Change if need be
git_original_private_key: # Fill in SSH key
# Mirror
git_mirror_uri: # Fill in URI
git_mirror_branch: master # Change if need be
git_mirror_private_key: # Fill in SSH key
resources:
- name: original
type: git
source:
uri: {{git_original_uri}}
branch: {{git_original_branch}}
private_key: {{git_original_private_key}}
- name: mirror
type: git
source:
uri: {{git_mirror_uri}}
branch: {{git_mirror_branch}}
private_key: {{git_mirror_private_key}}
- name: schedule
type: time
source:
interval: 10m
jobs:
- name: Synchronize mirror
plan:
- aggregate:
- get: schedule
trigger: true
- get: original
- put: mirror
params:
repository: original
TARGET=lite # Fly target
PIPELINE=mirrors # Pipeline name
# Login
fly -t $TARGET login
# Set the pipeline
fly -t $TARGET set-pipeline -p $PIPELINE -c pipeline.yml -l params.yml
# Unpause the pipeline
fly -t $TARGET unpause-pipeline -p $PIPELINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment