Looking Glass is a tool for mirroring objects to Artifactory.
It is common for vendors to release binaries to an S3 bucket or FTP. To prevent 100's of servers from reaching outside our network during deployments, we had manually copied these binaries to our Artifactory instance. Looking Glass automates this for us, so we know our Artifactory repo is always up to date!
The latest version of looking-glass can be found on the Releases tab.
First, you'll need to create a "Generic" repository in Artifactory, and ensure you have a user that can write to it.
Second, you'll need to gather up the credentials for the source you'd like to mirror (you'll need them for the config in the next step)
Third, create a looking-glass yaml configuration file that tells it how to talk to the source/destination of the objects (see details below)
artifactory:
url: http://my.artifactory.server/artifactory/
username: my-artifactory-user
key: my-artifactory-key
agents:
- name: my-s3-agent
artifactory_repo: my-repo-s3
sleep_duration: 900
downloader:
type: s3
config:
aws_bucket: my-s3-bucket
aws_key: my-aws-key
aws_secret: my-aws-secret
aws_prefix: my-prefix
aws_region: us-west-2
- name: my-github-agent
artifactory_repo: my-repo-github
sleep_duration: 900
downloader:
type: github
config:
github_repo: simplifi/looking-glass
github_token: my-github-token
This is where you tell looking-glass how to talk to your Artifactory server
url
- The URL to your Artifactory serverusername
- The username to use when authenticating with Artifactorykey
- The user's key used when authenticating with Artifactory
This is where you tell looking-glass about the agent(s) configuration
name
- The name of this agent, mainly used in loggingartifactory_repo
- The name of the Artifactory repo which will be the destination for the mirrored objectssleep_duration
- How long to wait before polling the for changes (in seconds)
This is where you tell looking-glass how to download objects from s3
type
- The type of downloader that you with to run (s3
in this case)config.aws_bucket
- The bucket from which you wish to mirrorconfig.aws_key
- The AWS Key ID to use when authenticating with S3config.aws_secret
- The AWS Secret Key to use when authenticating with S3config.aws_prefix
- The prefix to mirror from the S3 bucketconfig.aws_region
- The region in which the S3 bucket exists
This is where you tell looking-glass how to download assets from Github
type
- The type of downloader that you with to run (github
in this case)config.github_repo
- The github repo (in the form ofowner/repo_name
) from which to pull release assetsconfig.github_token
- (optional) The token to authenticate with when pulling release assets
Looking Glass (Artifactory Mirror)
Usage:
looking-glass [command]
Available Commands:
help Help about any command
start Start the Looking Glass agent
version Print the version number of looking-glass
Flags:
-h, --help help for looking-glass
Use "looking-glass [command] --help" for more information about a command.
looking-glass start -c /path/to/your/config.yml
make build
To run all the standard tests:
make test
This project is using goreleaser. GitHub release creation is automated using Travis CI. New releases are automatically created when new tags are pushed to the repo.
$ TAG=0.1.0 make tag