Code Monkey home page Code Monkey logo

gitops-test-manager's Introduction

Test-Manager

Test Manager deploys a EC2 instance in an AWS account which will monitor a configured GitHub repository and run a configured script for each non draft Pull Request. It is designed to be used to perform continuous integration (CI) testing of pull requests and will report the result of the script execution as a check status. It does not need a GitHub action or secrets to execute the test script.

To deploy the test manager in an AWS account in order to do CI testing for a repository you must provide a GitHub token with write access to the repository under test. You also need to provide the GitHub repository name and the path to the script to be executed. The GitHub token is provided via an environmental variable TEST_MANAGER_CI_GITHUB_TOKEN and the other information is specficed via a yaml file. See Pulumi.sample.yaml for an example.

The following environmental variables are avaialable to the CI testing script executed by the test manager:

Variable Description
PR_NUM Pull Request number
CI_ID Name of this CI tester
GITHUB_TOKEN GitHub token used to update pull request status
AWS_REGION AWS Region

Setup

Install python3, pip, Pulumi and AWS CLI version 2.

Clone this repository and deploy the python code in a virtualenv, e.g.

cd <path to clone of directory>
export PATH=$PATH:$PWD/bin
cd aws-deploy
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Deploy

To deploy a test manager you need AWS credentials for and Admin user in the target AWS account.

Create an S3 bucket to use for the pulumi stack:

create-state-bucket.sh <bucket name> <AWS region> <stack name>

e.g.

create-state-bucket.sh aws-github-test-manager $AWS_REGION aws-github

Then copy the sample yaml file to `Pulumi..yaml and edit it to reflect the requirements for the specific respository, i.e.

cd aws-deploy
cp Pulumi.sample.yaml Pulumi.aws-github.yaml

When ready to create the test manager, source your AWS credentials for the target account and deploy the test manager:

export PULUMI_CONFIG_PASSPHRASE=""    
pulumi --non-interactive login s3://aws-github-test-manager
pulumi --non-interactive up  --yes --stack aws-github

Log Access

If the EC2 instance running the CI checks has not been deployed with web access enabled then it is not possible to view the CI check log file.

gitops-test-manager's People

Watchers

James Cloos avatar Paul Carlton avatar

Forkers

phoban01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.