Skip to content

Commit

Permalink
Merge pull request #54 from technologiestiftung/fix/tileset-name
Browse files Browse the repository at this point in the history
fix: test with hard coded mapbox tileset name
  • Loading branch information
dnsos authored Aug 10, 2021
2 parents 6f1871d + 14ac568 commit d917d0e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-docker-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
MAPBOXUSERNAME: ${{ secrets.MAPBOXUSERNAME }}
MAPBOXTOKEN: ${{ secrets.MAPBOXTOKEN }}
MAPBOXTILESET: ${{ secrets.MAPBOXTILESET }}
MAPBOXLAYERNAME: ${{ secrets.MAPBOXLAYERNAME }}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
MAPBOXUSERNAME: "123"
MAPBOXTOKEN: "456"
MAPBOXTILESET: "xyz"
MAPBOXLAYERNAME: "abc"
LOGGING: INFO
DATABASE_URL: postgresql://fangorn:ent@localhost:5432/trees?schema=public

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ inputs:
MAPBOXTILESET:
description: ""
required: true
MAPBOXLAYERNAME:
description: "The layer within the tileset that holds the trees data"
required: true
LOGGING:
description: ""
required: true
Expand All @@ -56,5 +59,7 @@ runs:
S3_BUCKET: ${{ inputs.S3_BUCKET }}
MAPBOXUSERNAME: ${{ inputs.MAPBOXUSERNAME }}
MAPBOXTOKEN: ${{ inputs.MAPBOXTOKEN }}
MAPBOXTILESET: ${{ inputs.MAPBOXTILESET }}
MAPBOXLAYERNAME: ${{ inputs.MAPBOXLAYERNAME }}
LOGGING: ${{ inputs.LOGGING }}
DATABASE_URL: ${{ inputs.DATABASE_URL }}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
MAPBOXUSERNAME: "123"
MAPBOXTOKEN: "456"
MAPBOXTILESET: "xyz"
MAPBOXLAYERNAME: "abc"

OUTPUT: "True"
LOGGING: INFO
Expand Down
4 changes: 2 additions & 2 deletions harvester/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ def finishGeojson(feature_list, file_name):

url = "https://api.mapbox.com/uploads/v1/{}?access_token={}".format(
os.getenv("MAPBOXUSERNAME"), os.getenv("MAPBOXTOKEN"))
payload = '{{"url":"http://{}.s3.amazonaws.com/{}","tileset":"{}.{}"}}'.format(
s3_credentials["bucket"], s3_credentials["key"], os.getenv("MAPBOXUSERNAME"), os.getenv("MAPBOXTILESET"))
payload = '{{"url":"http://{}.s3.amazonaws.com/{}","tileset":"{}.{}","name":"{}"}}'.format(
s3_credentials["bucket"], s3_credentials["key"], os.getenv("MAPBOXUSERNAME"), os.getenv("MAPBOXTILESET"), os.getenv("MAPBOXLAYERNAME"))
headers = {'content-type': 'application/json',
'Accept-Charset': 'UTF-8', 'Cache-Control': 'no-cache'}
response = requests.post(url, data=payload, headers=headers)
Expand Down

0 comments on commit d917d0e

Please sign in to comment.