Skip to content

Commit 47aa0e5

Browse files
authored
fix: Update rate centers (#25)
1 parent fe7b4ae commit 47aa0e5

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

skyetel/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ GEM
7676
rack (3.1.7)
7777
rainbow (3.1.1)
7878
rake (13.2.1)
79-
rate_center (0.1.6)
79+
rate_center (0.1.7)
8080
regexp_parser (2.9.2)
8181
rexml (3.3.8)
8282
rspec (3.13.0)

skyetel/app.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module App
44
class Handler
55
def self.process(**)
66
new.process
7+
rescue StandardError => e
8+
Sentry.capture_exception(e)
9+
raise(e)
710
end
811

912
def process

skyetel/config/app_settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ default: &default
33
skyetel_username: "<%= ENV['SKYETEL_USERNAME'] %>"
44
skyetel_password: "<%= ENV['SKYETEL_PASSWORD'] %>"
55
supported_cities_data_file: "<%= ENV.fetch('SUPPORTED_CITIES_DATA_FILE', 'supported_cities.csv') %>"
6-
min_stock: "<%= ENV.fetch('MIN_STOCK', 50) %>"
7-
max_stock: "<%= ENV.fetch('MAX_STOCK', 100) %>"
6+
min_stock: "<%= ENV.fetch('MIN_STOCK', 0) %>"
7+
max_stock: "<%= ENV.fetch('MAX_STOCK', 0) %>"
88
somleng_number_visibility: "<%= ENV.fetch('SOMLENG_NUMBER_VISIBILITY', 'public') %>"
99

1010
development: &development

skyetel/examples/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1+
# Examples
2+
13
## Build your own docker image
24

3-
1. Edit the supported_cities.csv file with a list of supported cities
4-
2. Build your own docker image
5+
Edit the supported_cities.csv file with a list of supported cities and build your own docker image.
56

67
```bash
78
docker buildx build -t --platform linux/amd64 somleng-skyetel:example .
89
```
910

10-
3. Run your image
11+
## Deployment
12+
13+
The image is ready to be deployed to AWS Lambda and can be triggered by a scheduler.
14+
15+
## Standalone mode
16+
17+
If you're not using Lambda, you can run your image with the following command.
1118

1219
```bash
13-
docker run --platform linux/amd64 --rm -it --entrypoint /bin/sh somleng-skyetel:example
20+
docker run --platform linux/amd64 --rm -it -e APP_ENV=production -e SOMLENG_API_KEY='somleng-carrier-api-key' SOMLENG_API_KEY='somleng-carrier-api-key' -e SKYETEL_USERNAME='skyetel-username' -e SKYETEL_PASSWORD='skyetel-password' -e MAX_STOCK=2 --entrypoint ruby somleng-skyetel:example -r ./app.rb -e App::Handler.process
1421
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
country,region,name
2-
US,NY,New York
2+
US,FL,Jacksonville

skyetel/spec/app_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module App
1717
}
1818
].to_json
1919
)
20-
stub_app_settings(max_stock: 2)
20+
stub_app_settings(min_stock: 2, max_stock: 3)
2121
stub_jsonapi_request(
2222
:get, "https://api.somleng.org/carrier/v1/phone_numbers/stats",
2323
response_body: file_fixture("somleng/responses/phone_number_stats.json").read
@@ -40,7 +40,7 @@ module App
4040

4141
App::Handler.process(event: {}, context: double("LambdaContext", as_json: {}))
4242

43-
expect(a_request(:post, "https://api.somleng.org/carrier/v1/phone_numbers")).to have_been_made.times(2)
43+
expect(a_request(:post, "https://api.somleng.org/carrier/v1/phone_numbers")).to have_been_made.times(4)
4444
end
4545
end
4646
end

0 commit comments

Comments
 (0)