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.

86 lines
2.5 KiB

  1. {
  2. "variables": {
  3. "do_api_token": "{{env `DIGITALOCEAN_API_TOKEN`}}",
  4. "image_name": "wikijs-snapshot-{{timestamp}}",
  5. "apt_packages": "apt-transport-https ca-certificates curl jq linux-image-extra-virtual software-properties-common gnupg-agent openssl ",
  6. "application_name": "Wiki.js",
  7. "application_version": "{{env `WIKI_APP_VERSION`}}",
  8. "docker_compose_version": "1.29.2"
  9. },
  10. "sensitive-variables": [
  11. "do_api_token"
  12. ],
  13. "builders": [
  14. {
  15. "type": "digitalocean",
  16. "api_token": "{{user `do_api_token`}}",
  17. "image": "ubuntu-20-04-x64",
  18. "region": "tor1",
  19. "size": "s-1vcpu-1gb",
  20. "ssh_username": "root",
  21. "snapshot_name": "{{user `image_name`}}"
  22. }
  23. ],
  24. "provisioners": [
  25. {
  26. "type": "shell",
  27. "inline": [
  28. "cloud-init status --wait"
  29. ]
  30. },
  31. {
  32. "type": "file",
  33. "source": "scripts/001-onboot.sh",
  34. "destination": "/var/lib/cloud/scripts/per-instance/001-onboot.sh"
  35. },
  36. {
  37. "type": "file",
  38. "source": "scripts/099-one-click",
  39. "destination": "/etc/update-motd.d/099-one-click"
  40. },
  41. {
  42. "type": "shell",
  43. "inline": [
  44. "chmod +x /var/lib/cloud/scripts/per-instance/001-onboot.sh",
  45. "chmod +x /etc/update-motd.d/099-one-click"
  46. ]
  47. },
  48. {
  49. "type": "shell",
  50. "environment_vars": [
  51. "DEBIAN_FRONTEND=noninteractive",
  52. "LC_ALL=C",
  53. "LANG=en_US.UTF-8",
  54. "LC_CTYPE=en_US.UTF-8"
  55. ],
  56. "inline": [
  57. "apt -qqy update",
  58. "apt -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' full-upgrade",
  59. "apt -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install {{user `apt_packages`}}",
  60. "apt-get -qqy clean"
  61. ]
  62. },
  63. {
  64. "type": "shell",
  65. "environment_vars": [
  66. "application_name={{user `application_name`}}",
  67. "application_version={{user `application_version`}}",
  68. "docker_compose_version={{user `docker_compose_version`}}",
  69. "DEBIAN_FRONTEND=noninteractive",
  70. "LC_ALL=C",
  71. "LANG=en_US.UTF-8",
  72. "LC_CTYPE=en_US.UTF-8"
  73. ],
  74. "scripts": [
  75. "scripts/010-docker.sh",
  76. "scripts/011-docker-compose.sh",
  77. "scripts/012-grub-opts.sh",
  78. "scripts/013-docker-dns.sh",
  79. "scripts/014-ufw-docker.sh",
  80. "scripts/020-application-tag.sh",
  81. "scripts/900-cleanup.sh",
  82. "scripts/999-img-check.sh"
  83. ]
  84. }
  85. ]
  86. }