Skip to content

Commit a8cf44c

Browse files
authored
Merge pull request #7 from microsoft/update-planetary-computer-with-poetry
Adding poetry install to Planetary Computer DataGenerator
2 parents 937524c + ca569d4 commit a8cf44c

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.devcontainer/planetary-computer-datagenerator/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@
4141
}
4242
},
4343
"remoteUser": "root",
44-
"postStartCommand": ""
44+
"postStartCommand": "bash /workspace/planetary-computer-datagenerator/devcontainer_postStart.sh"
4545
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
#
3+
# Runs after the container is started to install poetry and the local package
4+
#
5+
#
6+
7+
# Script Flags
8+
SCRIPT_NAME=$(basename "$0")
9+
10+
11+
install_poetry() {
12+
echo "START: ${FUNCNAME[0]}"
13+
curl -sSL https://install.python-poetry.org | POETRY_HOME=/root/.local python3 -
14+
chmod +x /root/.local/bin/poetry
15+
echo "END: ${FUNCNAME[0]}"
16+
}
17+
18+
install_package() {
19+
echo "START: ${FUNCNAME[0]}"
20+
/root/.local/bin/poetry config virtualenvs.create false
21+
rm -f -- /workspace/planetary-computer-datagenerator/poetry.lock
22+
/root/.local/bin/poetry install --with dev
23+
rm -f -- /workspace/planetary-computer-datagenerator/poetry.lock
24+
echo "END: ${FUNCNAME[0]}"
25+
}
26+
27+
clean_up() {
28+
echo "START: ${FUNCNAME[0]}"
29+
echo "rm -rf /workspace/planetary-computer-datagenerator/.devcontainer/tmp"
30+
rm -rf /workspace/planetary-computer-datagenerator/.devcontainer/tmp
31+
echo "END: ${FUNCNAME[0]}"
32+
}
33+
34+
main() {
35+
echo "START: ${SCRIPT_NAME}"
36+
echo "------------------------------------------"
37+
install_poetry
38+
install_package
39+
clean_up
40+
echo "------------------------------------------"
41+
echo "END: ${SCRIPT_NAME}"
42+
}
43+
44+
main

0 commit comments

Comments
 (0)