Skip to content

DrCord/arc-arcimoto-aws-services

Repository files navigation

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]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published