Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 2.41 KB

CONTRIBUTING.md

File metadata and controls

85 lines (61 loc) · 2.41 KB

Contributing to Berglas

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

Community Guidelines

This project follows Google's Open Source Community Guidelines.

Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.

Code reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.

Testing

If you want to develop on Berglas, you will need to create a test setup.

  1. Create a dedicated Google Cloud project in which to run the tests. No other infrastructure or services should run in this project.

    gcloud projects create ${PROJECT_ID}
    
  2. Enable the necessary APIs on the project:

    gcloud services enable --project ${PROJECT_ID} \
        cloudkms.googleapis.com \
        storage-api.googleapis.com \
        storage-component.googleapis.com
    
  3. Create a Cloud Storage bucket:

    gsutil mb -p ${PROJECT_ID} gs://${BUCKET_ID}
    gsutil versioning set on gs://${BUCKET_ID}
    
  4. Create a Cloud KMS key:

    gcloud kms keyrings create my-keyring \
        --project ${PROJECT_ID} \
        --location global
    
    gcloud kms keys create my-key \
        --project ${PROJECT_ID} \
        --location global \
        --keyring my-keyring \
        --purpose encryption
    
  5. Export the values as environment variables:

    export GOOGLE_CLOUD_PROJECT=${PROJECT_ID}
    export GOOGLE_CLOUD_BUCKET=${BUCKET_ID}
    export GOOGLE_CLOUD_KMS_KEY=projects/${PROJECT_ID}/locations/global/keyRings/my-keyring/cryptoKeys/my-key
    export GOOGLE_CLOUD_SERVICE_ACCOUNT=${SERVICE_ACCOUNT}
    
  6. Run tests:

    make test-acc