Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EnableAgentGitMirrorsExperiment parameter #555

Merged
merged 2 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .buildkite/steps/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ cat << EOF > config.json
{
"ParameterKey": "EnableDockerUserNamespaceRemap",
"ParameterValue": "true"
},
{
"ParameterKey": "EnableAgentGitMirrorsExperiment",
"ParameterValue": "true"
}
]
EOF
Expand Down
10 changes: 10 additions & 0 deletions packer/conf/bin/bk-install-elastic-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ if [[ -n "${BUILDKITE_AGENT_TAGS:-}" ]] ; then
agent_metadata=("${agent_metadata[@]}" "${extra_agent_metadata[@]}")
fi

# Enable git mirrors
if [[ "${BUILDKITE_AGENT_ENABLE_GIT_MIRRORS_EXPERIMENT}" == "true" ]] ; then
if [[ -z "$BUILDKITE_AGENT_EXPERIMENTS" ]] ; then
BUILDKITE_AGENT_EXPERIMENTS="git-mirrors"
else
BUILDKITE_AGENT_EXPERIMENTS+=",git-mirrors"
fi
fi

cat << EOF > /etc/buildkite-agent/buildkite-agent.cfg
name="${BUILDKITE_STACK_NAME}-${INSTANCE_ID}-%n"
token="${BUILDKITE_AGENT_TOKEN}"
Expand All @@ -100,6 +109,7 @@ timestamp-lines=${BUILDKITE_AGENT_TIMESTAMP_LINES}
hooks-path=/etc/buildkite-agent/hooks
build-path=/var/lib/buildkite-agent/builds
plugins-path=/var/lib/buildkite-agent/plugins
git-mirrors-path=/var/lib/buildkite-agent/git-mirrors
experiment="${BUILDKITE_AGENT_EXPERIMENTS}"
priority=%n
spawn=${BUILDKITE_AGENTS_PER_INSTANCE}
Expand Down
4 changes: 4 additions & 0 deletions packer/scripts/install-buildkite-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ echo "Creating builds dir..."
sudo mkdir -p /var/lib/buildkite-agent/builds
sudo chown -R buildkite-agent: /var/lib/buildkite-agent/builds

echo "Creating git mirrors dir..."
sudo mkdir -p /var/lib/buildkite-agent/git-mirrors
sudo chown -R buildkite-agent: /var/lib/buildkite-agent/git-mirrors

echo "Creating plugins dir..."
sudo mkdir -p /var/lib/buildkite-agent/plugins
sudo chown -R buildkite-agent: /var/lib/buildkite-agent/plugins
Expand Down
9 changes: 9 additions & 0 deletions templates/aws-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@ Parameters:
Description: The value of the Cost Allocation Tag used for billing purposes
Default: "buildkite-elastic-ci-stack-for-aws"

EnableAgentGitMirrorsExperiment:
Type: String
Description: Enables the git-mirrors experiment in the agent
AllowedValues:
- "true"
- "false"
Default: "false"

Outputs:
ManagedSecretsBucket:
Value:
Expand Down Expand Up @@ -700,6 +708,7 @@ Resources:
BUILDKITE_AGENT_EXPERIMENTS="${BuildkiteAgentExperiments}" \
BUILDKITE_AGENT_RELEASE="${BuildkiteAgentRelease}" \
BUILDKITE_QUEUE="${BuildkiteQueue}" \
BUILDKITE_AGENT_ENABLE_GIT_MIRRORS_EXPERIMENT=${EnableAgentGitMirrorsExperiment} \
BUILDKITE_ELASTIC_BOOTSTRAP_SCRIPT="${BootstrapScriptUrl}" \
BUILDKITE_AUTHORIZED_USERS_URL="${AuthorizedUsersUrl}" \
BUILDKITE_ECR_POLICY=${ECRAccessPolicy} \
Expand Down