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

Integrate Go s3secrets-helper into elastic-stack #772

Merged
merged 8 commits into from
Nov 23, 2020
Merged

Conversation

pda
Copy link
Member

@pda pda commented Nov 19, 2020

Integrating buildkite/elastic-ci-stack-s3-secrets-hooks#37 into elastic-stack.

CI:

  • Build the s3secrets-helper binaries as CI steps (linux & windows)
  • Upload binaries as artifacts
  • Add them to the packer AMI builds, place them in PATH

Development:

  • Build the s3secrets-helper binaries via Makefile
  • Packer will pick them up from there.

@pda pda force-pushed the go-secrets-plugin branch from dfca5df to d000c0e Compare November 19, 2020 22:12
@yob
Copy link
Contributor

yob commented Nov 20, 2020

👀

@pda pda marked this pull request as ready for review November 20, 2020 09:07
Copy link
Contributor

@yob yob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

I tested this (and buildkite/elastic-ci-stack-s3-secrets-hooks#37) as a blackbox by creating a new stack based on this branch and running some builds.

My secrets bucket looked like this:

aws s3 ls s3://<bucket-name> --recursive
2020-11-22 22:31:56         26 env
2020-11-22 22:32:22          0 gist-test/
2020-11-22 22:32:50         28 gist-test/env
2020-11-22 22:29:43       1678 private_ssh_key

My global env:

$ cat env 
#!/bin/sh

GLOBAL_ENV=foo

My pipeline env:

$ cat env 
#!/bin/sh

PIPELINE_ENV=bar

The build script looked like this:

#!/bin/bash

set -ux

echo $GLOBAL_ENV
echo $PIPELINE_ENV

The hook ran in 0 seconds (woo!), and did everything I expected:

Screenshot from 2020-11-22 23-09-23

The environment variables set in the env files were available when the script ran:

Screenshot from 2020-11-22 23-11-21

There's some things I didn't test, like ssh credentials (my test repo was checked out via http), and git-credentials. Still, my tests show there's no glaring errors and I reckon we should merge so we can start dogfooding it via our own builds.

A few of these changes will conflict with the arm support that's brewing in #758. That's OK though, I'm happy to rebase the arm support if this merges first.

@yob
Copy link
Contributor

yob commented Nov 22, 2020

Oh. I should add that I also ran the same test on windows and everything worked as expected 👍

Previous submodule commit on this branch was the branch commit prior to
merge, so it has the same file tree.
@pda pda merged commit e71d923 into master Nov 23, 2020
@pda pda deleted the go-secrets-plugin branch November 23, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants