Skip to content

Instantly share code, notes, and snippets.

@mtrovo
Created March 21, 2017 13:10
Show Gist options
  • Save mtrovo/df6bf60722a618b8ff695db95a63dfd0 to your computer and use it in GitHub Desktop.
Save mtrovo/df6bf60722a618b8ff695db95a63dfd0 to your computer and use it in GitHub Desktop.
Create topics on nakadi for business events
MINT_BUCKET=zalando-stups-mint-200641888568-eu-west-1
PROJECT=user-management
TEAM_PACKAGE=solution_center
STAGING_URL="https://nakadi-staging.aruha-test.zalan.do/event-types"
PROD_URL="https://nakadi-live.aruha.zalan.do/event-types"
gradle clean build generateEventTypes
cd build/event-types
cd $TEAM_PACKAGE
mai login; berry -a $PROJECT -m $MINT_BUCKET --once /meta/credentials;
S2S_TOKEN=`http --print b --form POST "https://token.services.auth.zalando.com/oauth2/access_token?realm=/services" "scope=nakadi.event_stream.write nakadi.event_stream.read nakadi.event_type.write" grant_type=password "username=$(cat /meta/credentials/user.json | jq -r '.application_username')" "password=$(cat /meta/credentials/user.json | jq -r '.application_password')" --auth "$(cat /meta/credentials/client.json | jq -r '.client_id'):$(cat /meta/credentials/client.json | jq -r '.client_secret')" | jq -r '.access_token'` #nakadi-token
for f in `ls -1 *.json`;
cat "$f" | http --print HhBb POST $STAGING_URL "Authorization:Bearer $S2S_TOKEN"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment