Skip to content

Commit

Permalink
Configure image tags for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto committed Oct 30, 2023
1 parent 30d6680 commit 24d4628
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 3 additions & 1 deletion ubuntu/focal/variables.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
img_name = "src-ubuntu_focal"
img_name = "src-test-workspace"
docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace"
img_tag = "ubuntu_focal"
docker_base_img = "ubuntu:focal"
vagrant_base_img = "ubuntu/focal64"
extra_packages = ""
Expand Down
4 changes: 3 additions & 1 deletion ubuntu/focal_desktop/variables.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
img_name = "src-ubuntu_focal_desktop"
img_name = "src-test-workspace"
docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace"
img_tag = "ubuntu_focal-desktop"
docker_base_img = "ubuntu:focal"
vagrant_base_img = "ubuntu/focal64"
extra_packages = "xfce4"
Expand Down
4 changes: 3 additions & 1 deletion ubuntu/jammy/variables.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
img_name = "src-ubuntu_jammy"
img_name = "src-test-workspace"
docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace"
img_tag = "ubuntu_jammy"
docker_base_img = "ubuntu:jammy"
vagrant_base_img = "ubuntu/jammy64"
extra_packages = ""
Expand Down
16 changes: 13 additions & 3 deletions ubuntu/src-ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "source_repo" {
type = string
}

variable "docker_repo" {
default = ""
type = string
}

variable "ansible_host" {
default = "packer-src"
type = string
Expand Down Expand Up @@ -85,12 +90,17 @@ variable "vagrant_base_img" {
}

variable "img_name" {
default = "src-workspace"
default = ""
type = string
}

variable "img_tag" {
default = ""
type = string
}

local "ansible_host" {
expression = "${var.ansible_host}-${var.img_name}"
expression = "${var.ansible_host}-${var.img_tag}"
}

local "dummy_plugin_args" {
Expand Down Expand Up @@ -199,7 +209,7 @@ build {

post-processor "docker-tag" {
except = ["vagrant.ubuntu"]
repository = var.img_name
repository = "${var.docker_repo}:${var.img_tag}"
}
post-processor "shell-local" {
except = ["vagrant.ubuntu"]
Expand Down

0 comments on commit 24d4628

Please sign in to comment.