You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
963 B

  1. #!/usr/bin/env bash
  2. # parse arguments
  3. mode="prod"
  4. for opt in "$@"; do
  5. case "${opt}" in
  6. --dev) mode="dev" ;;
  7. esac
  8. done
  9. set -eo pipefail
  10. # install build dependencies
  11. apt-get update
  12. apt-get install --no-install-recommends -y --allow-downgrades \
  13. curl \
  14. gnupg=2.1.18-8~deb9u4 \
  15. apt-transport-https
  16. # install dependency to compile django-pyodbc-azure
  17. if [[ "${mode}" = "dev" ]]; then
  18. apt-get install --no-install-recommends -y \
  19. unixodbc-dev=2.3.4-1
  20. fi
  21. # add mssql repo
  22. curl -fsS https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
  23. curl -fsS https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql.list
  24. apt-get update
  25. # install mssql
  26. ACCEPT_EULA=Y apt-get install --no-install-recommends -y \
  27. msodbcsql17=17.3.1.1-1 \
  28. mssql-tools=17.3.0.1-1
  29. # remove build dependencies and artifacts
  30. apt-get remove -y \
  31. curl gnupg apt-transport-https
  32. rm -rf /var/lib/apt/lists/*