Skip to content

Commit

Permalink
Merge pull request #17 from naogify/main
Browse files Browse the repository at this point in the history
ローカルで実行できるように設定を修正
  • Loading branch information
naogify authored Dec 14, 2023
2 parents b64e237 + 98f3898 commit 60209f6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INPUT_DIR=./docs
ACCESS_KEY=example-city
AWS_ACCESS_KEY=example-access-key
AWS_SECRET_ACCESS_KEY=example-secret-access-key
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 基本となるイメージ
FROM node:latest

WORKDIR /app

# 必要なパッケージのインストール
RUN apt-get update && apt-get install -y \
curl \
Expand All @@ -23,7 +25,7 @@ RUN curl -L https://github.com/protomaps/go-pmtiles/releases/download/v1.11.1/go
&& chmod +x pmtiles \
&& mv pmtiles /usr/local/bin/

# 現在のディレクトリを / にコピー
COPY ./* /
# 現在のディレクトリを ディレクトリ構成を維持して / にコピー
COPY . /app

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/app/entrypoint.sh"]
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# smartcity-data-upload-action
# smartcity-data-upload-action



# ローカルで実行する

```
$ cd geolonia/smartcity-data-upload-action # このリポジトリのルートディレクトリに移動
$ npm install
$ npm run docker:test # build と run が実行される
```
11 changes: 5 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ inputs:
runs:
using: 'docker'
image: 'Dockerfile'

args:
- ${{ inputs.input_dir }}
- ${{ inputs.access_key }}
- ${{ inputs.aws_access_key }}
- ${{ inputs.aws_secret_access_key }}
env:
INPUT_DIR: ${{ inputs.input_dir }}
ACCESS_KEY: ${{ inputs.access_key }}
AWS_ACCESS_KEY: ${{ inputs.aws_access_key }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws_secret_access_key }}
10 changes: 4 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
#!/bin/sh
set -e

INPUT_DIR=$1
ACCESS_KEY=$2
AWS_ACCESS_KEY=$3
AWS_SECRET_ACCESS_KEY=$4


npm install
ls

echo "INPUT_DIR: $INPUT_DIR"

node ./bin/excel2geojson.js $INPUT_DIR
node ./bin/geojson2mbtiles.js $INPUT_DIR

ls $INPUT_DIR
ls


exit 0
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"description": "",
"main": "bin/excel2geojson.js",
"scripts": {
"docker:build": "docker build -t geolonia/smartcity-data-upload-action .",
"docker:test": "npm run docker:build && docker run --env-file ./.env.test geolonia/smartcity-data-upload-action",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
Expand Down

0 comments on commit 60209f6

Please sign in to comment.