Library for interacting with Arcimoto AWS services. Used as dependency/submodule by other repos.
Arcimoto repositories that use this as git submodule:
- Cord Slatton - Repo Man (Authorizes changes to master branch)
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.
- aws_service
- bundle
- cognito
- command
- lambda_service
- layers
- path
- pipeline
- secretsmanager
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.
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.
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
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}}
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]
).
MAJOR.MINOR.PATCH
- Require
Commitizen
for all contributors (see above)
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.
The arcimoto_aws_services
folder contains the package. The tests
folder contains the unit tests.
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.
The BitBucket pipelines file [bitbucket-pipelines.yml] implements the Continuous Integration (CI)/Continuous Deployment (CD) for the repository.
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.
- Notification to email group:
[email protected]
- Notification to email group:
[email protected]
- 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]