GithubHelp home page GithubHelp logo

arc-arcimoto-aws-services's Introduction

Arcimoto AWS Services

Library for interacting with Arcimoto AWS services. Used as dependency/submodule by other repos.

Arcimoto repositories that use this as git submodule:

Contributors

  • Cord Slatton - Repo Man (Authorizes changes to master branch)

Contributing

Git commit formatting

We use the Angular git commit style

Full (long) version:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Short version

<type>(<scope>): <subject>

See https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format more details

VS Code extension that helps you to make the commit msg, no need to remember your scope, etc.: https://marketplace.visualstudio.com/items?itemName=Jhecht.git-angular

We use the allowed types from https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format

We use custom scopes per repository, see scopes below. If you need to add a scope that is allowed.

Scopes

  • aws_service
  • bundle
  • cognito
  • command
  • lambda_service
  • layers
  • path
  • pipeline
  • secretsmanager

Prerequisites

The majority of the repo code is written in Python and meant to be executed by AWS Lambda in a Python runtime environment. Many of the functions rely on the AWS SDK for Python, boto3.

Install boto3 using pip:

pip install boto3

Additionally, in order to run Lambda functions which interact with AWS services, use the AWS Command Line Interface (CLI).
Install CLI using pip:

pip install awscli

In order to use the CLI, you will also need the proper AWS credentials, managed by the AWS Identity and Access Management (IAM) service. Have the Arcimoto AWS administrator create CLI credentials for you, or give you IAM permission to create them yourself. Then on the command line run:

aws configure

and enter the Access Key ID and Secret Access Key that you just created.

Installing

For Development

To get the AWSLmbda Lambda functions running locally, first obtain a local copy by cloning the repository. From the directory that you want to install your local copy, use git on the command line:

git clone https://<username>@bitbucket.org/arcimotocode1/awsshared.git

Where <username> is your bitbucket user name.

For usage (installation via pip)

Setup a bitbucket app password with read access to your account's repositories and substitute the username into the command:

pip install git+https://{{BITBUCKET_USERNAME}}@bitbucket.org/arcimotocode1/arcimoto-lambda-utility.git
Usage in a bitbucket pipeline (directly or as a submodule)

In order to be able to install in a pipeline programatically you will need to set up ssh access between the repos. On the repo that is using this utility in the pipeline you will need to retrieve the repository public ssh key from settings->pipeline->ssh keys->copy public key (you may need to generate the keypair before you can copy the public key portion). On this repository set that public key as an access key at settings->access keys->add key.

Pipeline usage example:

# install arcimoto-aws-services
- pip install git+ssh://[email protected]/arcimotocode1/arcimoto-aws-services.git
- python -m arcimoto_aws_services {{command}}

Automatic Versioning

This package automatically updates it's version in setup.py using semantic versioning via the python-semantic-release package. It runs on a merge to the master branch via bitbucket Continous Integration (CI) (see bitbucket-pipelines.yml). It generates a new section in the CHANGELOG.md file then updates the version in setup.py and commits to the master branch master with a message that prevents a re-run of the CI ([skip-ci]).

Semantic Version Schema

MAJOR.MINOR.PATCH

Initial Setup

  • Require Commitizen for all contributors (see above)

Configuration

Uses angular commit style to evaluate commits for automatic semantic versioning. We use the default rules from semantic-release: commit-analyzer.

Scope => Release Type

  • feat => minor
  • fix => patch
  • perf => patch

The body or footer can begin with BREAKING CHANGE: followed by a short description to create a major release.

Directory Layout

The arcimoto_aws_services folder contains the package. The tests folder contains the unit tests.

Git Flow

Due to the Continous Integration pipeline attached to this repositry all work must be done on feature branches created from dev with a TEL- prefix, then merge to dev via a pull request (PR) to trigger automatic testing. After a successful merge to dev then code should move to staging via a PR and then finally to master via a PR.

BitBucket Pipelines

The BitBucket pipelines file [bitbucket-pipelines.yml] implements the Continuous Integration (CI)/Continuous Deployment (CD) for the repository.

Pipelines

Run Tests

Tests are run automatically on Pull Request (PR) creation/update from a feature branch beginning with the prefix TEL- to the dev branch.

These tests include:

  • linting
  • unit tests

Any failed tests will result in a failure of the pipeline, which will prevent merging the PR to dev until the PR is updated to fix the issue(s) and the pipeline is re-run successfully for the PR.

Merge to Dev

Merge to Staging

Merge to Prod

  • Publish new semantic version based on the commits included (see Automatic Versioning section above)
  • create pull requests in dependent repos (arcimoto-lambda-global-dependencies, arcimoto-lambda-utility) with update to arcimoto-aws-services git submodule
  • Notification to email group: [email protected]

arc-arcimoto-aws-services's People

Contributors

drcord avatar

Watchers

 avatar

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.