Skip to content

Commit

Permalink
Clean up init process a little
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgerring committed Feb 11, 2023
1 parent 013a6d2 commit 6bb2de8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,17 @@ EOF
# Create a secret for the mapbox credentials
kubectl -n stravad create secret generic mapbox-credentials --from-env-file=frontend/.env

# Fetch a refresh token for strava. You'll need to plug
# the response in further down!
export STRAVA_CLIENT_ID=123
export STRAVA_CLIENT_SECRET=00aabbccddee
ruby fetch/fetchAccessToken.rb

# Create an `env.sh` in `fetch` to specify strava access credentials:
cat > fetch/env.sh << EOF
STRAVA_CLIENT_ID="2345
STRAVA_CLIENT_SECRET="00aabbccddee"
STRAVA_REFRESH_TOKEN="eeffaabbccdd"
STRAVA_CLIENT_ID=$STRAVA_CLIENT_ID
STRAVA_CLIENT_SECRET=$STRAVA_CLIENT_SECRET
STRAVA_REFRESH_TOKEN=eeffaabbccdd
EOF

# Create the namespace
Expand Down
2 changes: 0 additions & 2 deletions fetch/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
env.sh
test.sh
testdata
testdata-complete
3 changes: 3 additions & 0 deletions fetch/fetch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

set -e
set -a

source ./env.sh

TARGET_DIR=/tiles/

Expand Down
21 changes: 21 additions & 0 deletions fetch/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e
set -a

source ./env.sh

docker build . -t stravad-fetch

docker run \
--rm \
-it \
--name devtest \
-e MAPBOX_ACCESS_TOKEN \
-e MAPBOX_MAP_ID \
-e STRAVA_CLIENT_ID \
-e STRAVA_CLIENT_SECRET \
-e STRAVA_REFRESH_TOKEN \
--mount type=bind,source="$(pwd)"/testdata/,target=/tiles/ \
ghcr.io/scottgerring/stravad-scrape:v0.0.3
#stravad-fetch

0 comments on commit 6bb2de8

Please sign in to comment.