ssaw

command module
v0.0.0-...-524e7de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

README

ssaw

Self Serve Affiliations Workflow

Running locally

  • To compile locally use: make.
  • To run local sync service: ./serve.sh test|prod (it will use prod/test *.secret files for all environment variables.
  • To do request to local service (check service used for reacting sync request): ./sync.sh origin_name.

DB triggers

  • To test DB triggers on a local database execute: mysql ... < ./sql/sh_sync_test.sql.
  • Use SH_DB_ENDPOINT="`cat ./helm/ssaw/secrets/SH_DB_ENDPOINT.secret.example`" ./serve.sh to use local SortingHat DB running from docker (using LF-Engineering/dev-analytics-affiliation repo).
  • After starting against a local docker MariaDB run: SH_USR=sortinghat SH_PASS=pwd SH_DB=sortinghat ./sh/mariadb_sortinghat_shell.sh, then confirm that company with src=exampleOrigin was created.
  • Execute: select * from organizations where src = 'exampleOrigin' (there will be company with name exampleCompany).

Docker

  • Build docker image: DOCKER_USER=... docker/build_image.sh.
  • Run it: DOCKER_USER=... docker/run.sh. It will serve on 16060 instead of 6060 port.
  • Shell into the container: DOCKER_USER=... docker/shell.sh.
  • Test request, SYNC_URL must be provided to specify non-default 16060 port: SYNC_URL='127.0.0.1:16060' ./sync.sh json2hat.

Kubernetes/Helm

To deploy on Kubernetes

  • Go to helm/, run (LF real world example): ./setup.sh prod.
  • Eventually adjust Helm chart to your needs, including setup.sh and delete.sh shell scripts.
  • Run from repository root directory (test env): SYNC_URL="`cat helm/ssaw/secrets/SYNC_URL.test.secret`" ./sync.sh gitdm.
  • Run from repository root directory (prod env): SYNC_URL="`cat helm/ssaw/secrets/SYNC_URL.prod.secret`" ./sync.sh da-affiliation-api.

GitHub actions

  • Add your sync URL (for example AWS ELB of ssaw service stored in helm/ssaw/secrets/SYNC_URL.prod.secret) in GitHub repository (Settings -> Secrets -> New secret: SYNC_URL).
  • Configre actions in .github/workflows/, for example: .github/workflows/sync.yaml.

SNS topic

  • If running for the firs time - create a topic: AWS_PROFILE=... aws sns create-topic --name platform-trigger-affiliation-test.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
models

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL