Skip to content

Commit

Permalink
Fix build and add lambda nodejs18
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiMysko committed May 8, 2024
1 parent ca81035 commit 7113485
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 9 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language: ruby
rvm:
- 3.1
- 3.2
- 3.3

cache:
- bundler
Expand All @@ -18,14 +19,16 @@ jobs:
if: commit_message !~ /skip:test_dependencies/ AND env(SKIP_TEST_DEPENDENCIES) IS blank
cache: false
install:
- rvm use 3.3 --install --binary --fuzzy
- gem build dpl.gemspec
- gem install dpl-*.gem
- nvm install 12.22.0
- nvm use 12.22.0
- gem update --system
- nvm install 18.20.2
- nvm use 18.20.2
- node --version
script:
- .travis/test_install
rvm: 3.1
rvm: 3.3
- <<: *job
language: python
python: 2.7
Expand Down
2 changes: 1 addition & 1 deletion lib/dpl/ctx/bash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def npm_install(package, cmd = package)
def pip_install(package, cmd = package, version = nil)
ENV['VIRTUAL_ENV'] = File.expand_path('~/dpl_venv')
ENV['PATH'] = File.expand_path("~/dpl_venv/bin:#{ENV['PATH']}")
shell 'virtualenv --no-site-packages ~/dpl_venv', echo: true
shell 'virtualenv ~/dpl_venv', echo: true
shell 'pip install urllib3[secure]'
cmd = "pip install #{package}"
cmd << pip_version(version) if version
Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/cloudformation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Cloudformation < Provider
tbd
STR

gem 'nokogiri', '~> 1.15'
gem 'aws-sdk-cloudformation', '~> 1.0'

env :aws, :cloudformation
Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/codedeploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Codedeploy < Provider
tbd
STR

gem 'nokogiri', '~> 1.15'
gem 'aws-sdk-codedeploy', '~> 1.0'
gem 'aws-sdk-s3', '~> 1'

Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/ecr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Ecr < Provider
tbd
STR

gem 'nokogiri', '~> 1.15'
gem 'aws-sdk-ecr', '~> 1.0'
# gem 'docker-api', '~> 1.34'
gem 'json'
Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/elasticbeanstalk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Elasticbeanstalk < Provider
* Optionally waits until the deployment finishes
STR

gem 'nokogiri', '~> 1.15'
gem 'aws-sdk-elasticbeanstalk', '~> 1'
gem 'aws-sdk-s3', '~> 1'
gem 'rubyzip', '~> 2.3', require: 'zip'
Expand Down
2 changes: 1 addition & 1 deletion lib/dpl/providers/lambda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Lambda < Provider
opt '--subnet_ids IDS', 'List of subnet IDs to be added to the function', type: :array, note: 'Needs the ec2:DescribeSubnets and ec2:DescribeVpcs permission for the user of the access/secret key to work'
opt '--security_group_ids IDS', 'List of security group IDs to be added to the function', type: :array, note: 'Needs the ec2:DescribeSecurityGroups and ec2:DescribeVpcs permission for the user of the access/secret key to work'
opt '--environment VARS', 'List of Environment Variables to add to the function', type: :array, format: /[\w-]+=.+/, note: 'Can be encrypted for added security', alias: :environment_variables
opt '--runtime NAME', 'Lambda runtime to use', note: 'required when creating a new function', default: 'nodejs12.x', enum: %w[nodejs16.x nodejs14.x nodejs12.x python3.8 python3.7 python3.6 python2.7 ruby2.7 ruby2.5 java11 java8 go1.x dotnetcore2.1]
opt '--runtime NAME', 'Lambda runtime to use', note: 'required when creating a new function', default: 'nodejs12.x', enum: %w[nodejs18.x nodejs16.x nodejs14.x nodejs12.x python3.8 python3.7 python3.6 python2.7 ruby2.7 ruby2.5 java11 java8 go1.x dotnetcore2.1]
opt '--dead_letter_arn ARN', 'ARN to an SNS or SQS resource used for the dead letter queue.'
opt '--kms_key_arn ARN', 'KMS key ARN to use to encrypt environment_variables.'
opt '--tracing_mode MODE', 'Tracing mode', default: 'PassThrough', enum: %w[Active PassThrough], note: 'Needs xray:PutTraceSegments xray:PutTelemetryRecords on the role'
Expand Down
2 changes: 1 addition & 1 deletion lib/dpl/providers/netlify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Netlify < Provider
tbd
STR

node_js '>= 12.0.0'
node_js '>= 18.14.0'

npm 'netlify-cli', 'netlify'

Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/opsworks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Opsworks < Provider
tbd
STR

gem 'nokogiri', '~> 1.15'
gem 'aws-sdk-opsworks', '~> 1.0'

env :aws, :opsworks
Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/puppetforge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Puppetforge < Provider
tbd
STR

gem 'racc', '~> 1.7'
gem 'puppet', '~> 7.25', require: 'puppet/face'
gem 'puppet-blacksmith', '~> 7', require: 'puppet_blacksmith'

Expand Down
1 change: 1 addition & 0 deletions lib/dpl/providers/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class S3 < Provider
tbd
STR

gem 'nokogiri', '~> 1.15'
gem 'aws-sdk-s3', '~> 1'
gem 'mime-types', '~> 3.4.1'

Expand Down
2 changes: 1 addition & 1 deletion lib/dpl/providers/transifex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Transifex < Provider
tbd
STR

python '>= 2.7', '!= 3.0', '!= 3.1', '!= 3.2', '!= 3.3', '< 3.8'
python '>= 2.7', '!= 3.0', '!= 3.1', '!= 3.2', '!= 3.3', '< 3.12'

required :api_token, %i[username password]

Expand Down
4 changes: 2 additions & 2 deletions spec/dpl/ctx/bash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ def self.cmds(cmds)
describe 'version req given' do
before { bash.pip_install('name', 'cmd', '1.0.0') }

it { is_expected.to call_system 'virtualenv --no-site-packages ~/dpl_venv' }
it { is_expected.to call_system 'virtualenv ~/dpl_venv' }
it { is_expected.to call_system 'pip install name==1.0.0' }
end

describe 'no version req given' do
before { bash.pip_install('name', 'cmd') }

it { is_expected.to call_system 'virtualenv --no-site-packages ~/dpl_venv' }
it { is_expected.to call_system 'virtualenv ~/dpl_venv' }
it { is_expected.to call_system 'pip install name' }
end
end
Expand Down

0 comments on commit 7113485

Please sign in to comment.