commit 97d61d7bb2b0dadb09657b9926a13ddadef81181
parent 82d713ec8e03e35e4819124c30f58e6630c29460
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Sat, 11 May 2024 23:08:04 +0200
feat: add debian 12 postgres build
Diffstat:
2 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/postgres-lxc.pkr.hcl b/postgres-lxc.pkr.hcl
@@ -0,0 +1,31 @@
+variable "manifest" {
+ type = string
+ default = "manifest.json"
+}
+
+source "lxc" "postgres" {
+ config_file = "config/lxc-config"
+ template_name = "download"
+ template_parameters = ["--dist", "Debian_by_maurer", "--release", "Bookworm", "--arch", "armv7l"]
+}
+
+build {
+ sources = ["source.lxc.postgres"]
+
+ provisioner "shell" {
+ script = "scripts/timezone.sh"
+ }
+
+ provisioner "shell" {
+ script = "scripts/postgres.sh"
+ }
+}
+
+packer {
+ required_plugins {
+ lxc = {
+ version = ">= 1.0.2"
+ source = "github.com/hashicorp/lxc"
+ }
+ }
+}
diff --git a/scripts/postgres.sh b/scripts/postgres.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+set -o xtrace
+
+# install postgres
+apt-get install -y postgresql postgresql-contrib