Skip to content

Instantly share code, notes, and snippets.

@brunomacf
Created February 3, 2021 15:07
Show Gist options
  • Save brunomacf/57f41e71afb2087a279ca447de6f2180 to your computer and use it in GitHub Desktop.
Save brunomacf/57f41e71afb2087a279ca447de6f2180 to your computer and use it in GitHub Desktop.
usefull_commands
## To run multiple local service
```bash
gemstone up -l obsidian,jasper
```
---------------------------------------------------------------
## To run local tourmaline pointing to QA ES
In internal-service/js/server/service.js change:
```js
-const port = 3000;
+const port = 5090;
```
then run tourmaline
```bash
TOURMALINE_ES_ENDPOINT=https://vpc-content-search-l7jzbpujtl5jrg6vaht5gzl7iy.us-east-1.es.amazonaws.com TOURMALINE_BRANDGRAPH_AUTOCOMPLETE_INDEX=brandgraph_autocomplete_search_qa1_live_v2 TOURMALINE_CONTENT_INDEX=content_search_qa1_live_v2 node internal-service/js/server/service.js
TOURMALINE_AWS_PROFILE=qa TOURMALINE_AWS_REGION=us-east-1 TOURMALINE_IG_EMBED_ACCESS_TOKEN_SECRET=izea-qa1-sapphire-discovery-access-token-secret TOURMALINE_ES_ENDPOINT=https://vpc-content-search-l7jzbpujtl5jrg6vaht5gzl7iy.us-east-1.es.amazonaws.com TOURMALINE_BRANDGRAPH_AUTOCOMPLETE_INDEX=brandgraph_autocomplete_search_qa1_live_v2 TOURMALINE_CONTENT_INDEX=content_search_qa1_live_v2 node internal-service/js/server/service.js
```
and set the following on gemstone-microservices/env/obsidian.env
```txt
TOURMALINE_V1_API_URL=http://docker.for.mac.host.internal:5090/content/v1
TOURMALINE_BRANDGRAPH_V1_API_URL=http://docker.for.mac.host.internal:5090/brandgraph/v1
TOURMALINE_CONTENT_V2_API_URL=http://docker.for.mac.host.internal:5090/content/v2
```
---------------------------------------------------------------
## Use tourmaline from QA
Set the following on gemstone-microservices/env/obsidian.env
```txt
TOURMALINE_V1_API_URL=http://data.qa1.izea.internal/content/v1
TOURMALINE_BRANDGRAPH_V1_API_URL=http://data.qa1.izea.internal/brandgraph/v1
TOURMALINE_CONTENT_V2_API_URL=http://data.qa1.izea.internal/content/v2
```
---------------------------------------------------------------
## Daniele Blog Sparkels
property_id: 1602
organization_id: 1254
## Facebook
property_id: 968
organization_id: 1254
---------------------------------------------------------------
## To debug rails
Put the following into code:
```rails
binding.pry
```
Then access the container with:
```
docker attach gemstone-microservices_obsidian_1
```
```
continue
```
---------------------------------------------------------------
in `app/controllers/v2/base_controller.rb`:
```
# If you wish to allow anyone to make a request to your API controller,
# override this (as a private method) to be `false`.
def authentication_required?
- true
+ #true
end
```
in `app/controllers/v2/content/searches_controller.rb`:
```
- authorize(search, :create?, failure_message: "Not permitted to create the content search.")
+ #authorize(search, :create?, failure_message: "Not permitted to create the content search.")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment