Skip to content

Commit

Permalink
Merge pull request #7 from microsoft/update-planetary-computer-with-p…
Browse files Browse the repository at this point in the history
…oetry

Adding poetry install to Planetary Computer DataGenerator
  • Loading branch information
KevinDMack authored Jul 10, 2024
2 parents 937524c + ca569d4 commit a8cf44c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
}
},
"remoteUser": "root",
"postStartCommand": ""
"postStartCommand": "bash /workspace/planetary-computer-datagenerator/devcontainer_postStart.sh"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
#
# Runs after the container is started to install poetry and the local package
#
#

# Script Flags
SCRIPT_NAME=$(basename "$0")


install_poetry() {
echo "START: ${FUNCNAME[0]}"
curl -sSL https://install.python-poetry.org | POETRY_HOME=/root/.local python3 -
chmod +x /root/.local/bin/poetry
echo "END: ${FUNCNAME[0]}"
}

install_package() {
echo "START: ${FUNCNAME[0]}"
/root/.local/bin/poetry config virtualenvs.create false
rm -f -- /workspace/planetary-computer-datagenerator/poetry.lock
/root/.local/bin/poetry install --with dev
rm -f -- /workspace/planetary-computer-datagenerator/poetry.lock
echo "END: ${FUNCNAME[0]}"
}

clean_up() {
echo "START: ${FUNCNAME[0]}"
echo "rm -rf /workspace/planetary-computer-datagenerator/.devcontainer/tmp"
rm -rf /workspace/planetary-computer-datagenerator/.devcontainer/tmp
echo "END: ${FUNCNAME[0]}"
}

main() {
echo "START: ${SCRIPT_NAME}"
echo "------------------------------------------"
install_poetry
install_package
clean_up
echo "------------------------------------------"
echo "END: ${SCRIPT_NAME}"
}

main

0 comments on commit a8cf44c

Please sign in to comment.