diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index caea144..c6f7dbc 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -88,12 +88,11 @@ jobs: - name: Build image id: build-image run: IMG=${{ matrix.images }} ./pack.sh docker - - name: Get image name # grep in the image directory's variables file to find the image tag to push + - name: Get image name and tag # grep in the image directory's variables file to find the image name/tag to push to id: get-image-name run: | - echo "image_name=`grep img_name ${{ matrix.images }}/variables.auto.pkrvars.hcl | awk '{print $3}'`" >> "$GITHUB_OUTPUT" - echo "image_tag=`grep img_tag ${{ matrix.images }}/variables.auto.pkrvars.hcl | awk '{print $3}'`" >> "$GITHUB_OUTPUT" + echo "docker_repo=`grep docker_repo ${{ matrix.images }}/variables.auto.pkrvars.hcl | awk '{print $3}'`" >> "$GITHUB_OUTPUT" - name: Debug - run: echo ${{ steps.get-image-name.outputs.image_name }} ${{ steps.get-image-name.outputs.image_tag }} + run: echo ${{ steps.get-image-name.outputs.image_name }} - name: Push image - run: docker push ${{ steps.get-image-name.outputs.image_name }}:${{ steps.get-image-name.outputs.image_tag }} + run: docker push ${{ steps.get-image-name.outputs.docker_repo }} \ No newline at end of file diff --git a/ubuntu/focal/variables.auto.pkrvars.hcl b/ubuntu/focal/variables.auto.pkrvars.hcl index 473536d..ea5a276 100644 --- a/ubuntu/focal/variables.auto.pkrvars.hcl +++ b/ubuntu/focal/variables.auto.pkrvars.hcl @@ -1,5 +1,4 @@ -img_name = "src-test-workspace" -docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace" +docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_focal" img_tag = "ubuntu_focal" docker_base_img = "ubuntu:focal" vagrant_base_img = "ubuntu/focal64" diff --git a/ubuntu/focal_desktop/variables.auto.pkrvars.hcl b/ubuntu/focal_desktop/variables.auto.pkrvars.hcl index 3866406..bdd97fd 100644 --- a/ubuntu/focal_desktop/variables.auto.pkrvars.hcl +++ b/ubuntu/focal_desktop/variables.auto.pkrvars.hcl @@ -1,5 +1,4 @@ -img_name = "src-test-workspace" -docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace" +docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_focal-desktop" img_tag = "ubuntu_focal-desktop" docker_base_img = "ubuntu:focal" vagrant_base_img = "ubuntu/focal64" diff --git a/ubuntu/jammy/variables.auto.pkrvars.hcl b/ubuntu/jammy/variables.auto.pkrvars.hcl index d252969..3a0bcc9 100644 --- a/ubuntu/jammy/variables.auto.pkrvars.hcl +++ b/ubuntu/jammy/variables.auto.pkrvars.hcl @@ -1,5 +1,4 @@ -img_name = "src-test-workspace" -docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace" +docker_repo = "ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy" img_tag = "ubuntu_jammy" docker_base_img = "ubuntu:jammy" vagrant_base_img = "ubuntu/jammy64" diff --git a/ubuntu/src-ubuntu.pkr.hcl b/ubuntu/src-ubuntu.pkr.hcl index 3c03d1e..b8b4122 100644 --- a/ubuntu/src-ubuntu.pkr.hcl +++ b/ubuntu/src-ubuntu.pkr.hcl @@ -90,7 +90,7 @@ variable "vagrant_base_img" { } variable "img_name" { - default = "" + default = "src-test-workspace" type = string } @@ -209,7 +209,7 @@ build { post-processor "docker-tag" { except = ["vagrant.ubuntu"] - repository = "${var.docker_repo}:${var.img_tag}" + repository = var.docker_repo } post-processor "shell-local" { except = ["vagrant.ubuntu"]