-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKarfile
51 lines (44 loc) · 1007 Bytes
/
Karfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
REPOSITORY=article-rec-training-job
DOCKER_OPTS=$(cat <<END_HEREDOC
-v $HOME/.aws/credentials:/root/.aws/credentials:ro \
-v $(pwd):/app \
-e STAGE=local
END_HEREDOC
)
#@deploy
#+CDK deploy.
task-deploy() {
echo "Deploying all dev stacks..."
cd cdk
for stack in $(npx cdk list | grep Dev)
do
npx cdk deploy $stack
done
cd ..
}
#@build
#+Build docker image.
task-build() {
docker build . -t $REPOSITORY
}
#@run
#+Run docker container.
task-run() {
docker run $DOCKER_OPTS -it $REPOSITORY "$@"
}
#@test
#+Run tests.
task-test() {
docker run $DOCKER_OPTS $REPOSITORY py.test tests
}
#@backfill
#+Run backfill command in docker container.
task-backfill() {
docker run $DOCKER_OPTS -it $REPOSITORY python /app/scripts/backfill_task.py $@
}
#@article-backfill
#+Run article backfill command in docker container.
task-article-backfill() {
docker run $DOCKER_OPTS -it $REPOSITORY python /app/scripts/article_backfill.py $@
}