scout-camp 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/scout-camp +2 -0
- data/lib/scout/aws/s3.rb +4 -0
- data/scout-camp.gemspec +3 -3
- data/scout_commands/terraform/add +24 -9
- data/share/terraform/aws/bucket/main.tf +1 -5
- data/share/terraform/aws/bucket/output.tf +2 -2
- data/share/terraform/aws/bucket/variables.tf +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91e19b9f83e8b15a04642fa32d87a0af095b382a9698c169c454edffda2cdc1f
|
4
|
+
data.tar.gz: 92f2e5d29ed614db92ed7bfe3cdb25a55f2d64b2c8ab91bc12dda8939dfb76db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dab11e3e250669b167f0f8f49e16fba9b8b55b66a4b6254f1815d4e04282e257442e25e72368616a33ac9a2bfcf471b32466d01833de94328cd2138ad7522c3
|
7
|
+
data.tar.gz: f3c21f33ee76f8fc8a90d231e46a620262647eac1941d34adf3aba3fc4100d2f77d3b390a339ed43e379cb95fd3378fd7d25df891e9f4799221f4f97aac75995
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/bin/scout-camp
CHANGED
data/lib/scout/aws/s3.rb
CHANGED
data/scout-camp.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: scout-camp 0.1.
|
5
|
+
# stub: scout-camp 0.1.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "scout-camp".freeze
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.3".freeze
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Miguel Vazquez".freeze]
|
14
|
-
s.date = "2025-03-
|
14
|
+
s.date = "2025-03-25"
|
15
15
|
s.description = "Functionalities to deploy and use scouts in remote servers like AWS".freeze
|
16
16
|
s.email = "mikisvaz@gmail.com".freeze
|
17
17
|
s.executables = ["scout-camp".freeze]
|
@@ -12,6 +12,8 @@ $ #{$0} [<options>] <name>
|
|
12
12
|
|
13
13
|
-h--help Print this help
|
14
14
|
-w--workflows* Workflows to provision
|
15
|
+
-w--dependencies* Workflows to provision
|
16
|
+
-b--bucket* Bucket to connect
|
15
17
|
EOF
|
16
18
|
if options[:help]
|
17
19
|
if defined? scout_usage
|
@@ -29,19 +31,27 @@ deployments = Scout.var.deployments.glob_all("*").collect(&:basename)
|
|
29
31
|
raise "Deployment clash" if deployments.include? name
|
30
32
|
dir = Scout.var.deployments[name]
|
31
33
|
|
32
|
-
IndiferentHash.add_defaults options, workflows: '', dependencies: 'scout-gear'
|
34
|
+
IndiferentHash.add_defaults options, workflows: '', dependencies: 'scout-gear,scout-camp', bucket: 'scout.var'
|
33
35
|
|
34
36
|
workflows = options[:workflows].split(",")
|
35
37
|
dependencies = options[:dependencies].split(",")
|
36
38
|
|
37
|
-
code =<<-EOF
|
39
|
+
code =<<-'EOF'
|
38
40
|
def lambda_handler(event:, context:)
|
41
|
+
require 'scout'
|
42
|
+
Path.path_maps[:bucket] = "s3://#{ENV["AWS_BUCKET"]}/{TOPLEVEL}/{SUBPATH}"
|
43
|
+
Path.path_maps[:default] = :bucket
|
44
|
+
|
39
45
|
require 'scout/workflow'
|
46
|
+
require 'scout/aws/s3'
|
47
|
+
|
48
|
+
workflow, task_name, jobname, inputs = IndiferentHash.process_options event,
|
49
|
+
:workflow, :task_name, :jobname, :inputs
|
40
50
|
|
41
|
-
wf = Workflow.require_workflow
|
42
|
-
|
43
|
-
|
44
|
-
|
51
|
+
wf = Workflow.require_workflow workflow
|
52
|
+
|
53
|
+
job = wf.job(task_name, jobname, inputs)
|
54
|
+
job.run
|
45
55
|
end
|
46
56
|
EOF
|
47
57
|
|
@@ -71,8 +81,13 @@ lambda_package dependencies, workflows, code do |file|
|
|
71
81
|
terraform = TerraformDSL.new
|
72
82
|
filename = 'lambda_package.zip'
|
73
83
|
Open.cp file, dir[filename]
|
74
|
-
terraform.add :aws, :lambda, function_name: "ScoutJob", filename: filename, environment_variables: {HOME: '.'}
|
75
|
-
terraform.config dir
|
76
|
-
end
|
77
84
|
|
85
|
+
terraform.add :aws, :lambda, function_name: "#{name}Job", filename: filename,
|
86
|
+
environment_variables: {
|
87
|
+
HOME: '.',
|
88
|
+
HOSTNAME: "aws_lambda",
|
89
|
+
AWS_BUCKET: options[:bucket],
|
90
|
+
}
|
78
91
|
|
92
|
+
terraform.config dir
|
93
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
output "
|
2
|
-
value = aws_s3_bucket.
|
1
|
+
output "bucket_id" {
|
2
|
+
value = aws_s3_bucket.this.id
|
3
3
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout-camp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-25 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: scout-essentials
|