diff --git a/.gitignore b/.gitignore index 5c79730..0603611 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,11 @@ target/ # Direnv .envrc .direnv + +# Ruby/Bundler +.bundle +vendor + +# Terraform +*.tfstate +*.tfstate.backup diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..16f9cdb --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--format documentation diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..2bf1c1c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.3.1 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..024da78 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'rake' +gem 'awspec' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..b57c033 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,66 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (4.2.7) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + aws-sdk (2.2.37) + aws-sdk-resources (= 2.2.37) + aws-sdk-core (2.2.37) + jmespath (~> 1.0) + aws-sdk-resources (2.2.37) + aws-sdk-core (= 2.2.37) + aws_config (0.0.4) + awsecrets (1.3.0) + aws-sdk (>= 2.2.7, < 2.4) + aws_config (= 0.0.4) + awspec (0.47.0) + activesupport (~> 4.0) + aws-sdk (~> 2.2.37) + awsecrets (~> 1.3.0) + rspec (~> 3.0) + rspec-its + term-ansicolor + thor + diff-lcs (1.2.5) + i18n (0.7.0) + jmespath (1.3.1) + json (1.8.3) + minitest (5.9.0) + rake (11.2.2) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.1) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + term-ansicolor (1.3.2) + tins (~> 1.0) + thor (0.19.1) + thread_safe (0.3.5) + tins (1.11.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + awspec + rake + +BUNDLED WITH + 1.12.5 diff --git a/README.md b/README.md index df42b5a..4273f5f 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,12 @@ Requirements -------------------------------------------------------------------------------- - Python 2.7 (Recommend [yyuu/pyenv: Simple Python version management](https://github.com/yyuu/pyenv)) -- pip -- virtualenv + - pip + - virtualenv +- Ruby 2.3.1 (Recoomend [rbenv/rbenv: Groom your app’s Ruby environment with rbenv](https://github.com/rbenv/rbenv)) + - RubyGems + - Bundler +- Terraform Getting Started @@ -19,6 +23,7 @@ Install dependencies: ```sh $ pip install -r requirements.txt +$ bundle install --path vendor/bundle ``` Create IAM role to execute lambda functions: @@ -32,6 +37,8 @@ $ apex infra apply # Apply changes Development AWS Lambda functions -------------------------------------------------------------------------------- +### Create a function + Move to the `example` function directory: ``` @@ -58,6 +65,15 @@ $ apex deploy example --chdir ../../ --log-level debug ``` +### Project testing + +Run all tests: + +```sh +$ bundle exec rake spec +``` + + LICENSE -------------------------------------------------------------------------------- diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..941f88c --- /dev/null +++ b/Rakefile @@ -0,0 +1,3 @@ +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new('spec') +task :default => :spec diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..5a23deb --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'awspec'