Skip to content

Commit

Permalink
Update preview builds for new test script
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpittwood committed Apr 10, 2024
1 parent 6ddeb65 commit 3db9ce6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 58 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-bake-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ jobs:
push: false
files: docker-bake.preview.hcl

- name: Test Connect (privileged container)
- name: Test
env:
WORKBENCH_DAILY_VERSION: ${{ steps.get-version.outputs.WORKBENCH_DAILY_VERSION }}
WORKBENCH_PREVIEW_VERSION: ${{ steps.get-version.outputs.WORKBENCH_PREVIEW_VERSION }}
PACKAGE_MANAGER_DAILY_VERSION: ${{ steps.get-version.outputs.PACKAGE_MANAGER_DAILY_VERSION }}
CONNECT_DAILY_VERSION: ${{ steps.get-version.outputs.CONNECT_DAILY_VERSION }}
BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
just -f build.justfile preview-test
Expand Down
25 changes: 23 additions & 2 deletions build.justfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,33 @@ preview-build branch="$(git branch --show-current)":
PACKAGE_MANAGER_DAILY_VERSION=$(just -f ci.Justfile get-version package-manager --type=daily --local) \
CONNECT_DAILY_VERSION=$(just -f ci.Justfile get-version connect --type=daily --local) \
BRANCH="{{branch}}" \
just -f {{justfile()}} bake preview-build
just -f {{justfile()}} preview-bake build

# Run tests

test:
python3 {{justfile_directory()}}/tools/test_bake_artifacts.py

preview-test:
preview-test branch="$(git branch --show-current)":
#!/bin/bash
if [ -z "$WORKBENCH_DAILY_VERSION" ]; then
WORKBENCH_DAILY_VERSION=$(just -f ci.Justfile get-version workbench --type=daily --local)
fi
if [ -z "$WORKBENCH_PREVIEW_VERSION" ]; then
WORKBENCH_PREVIEW_VERSION=$(just -f ci.Justfile get-version workbench --type=preview --local)
fi
if [ -z "$PACKAGE_MANAGER_DAILY_VERSION" ]; then
PACKAGE_MANAGER_DAILY_VERSION=$(just -f ci.Justfile get-version package-manager --type=daily --local)
fi
if [ -z "$CONNECT_DAILY_VERSION" ]; then
CONNECT_DAILY_VERSION=$(just -f ci.Justfile get-version connect --type=daily --local)
fi
if [ -z "$BRANCH" ]; then
BRANCH="{{branch}}"
fi
WORKBENCH_DAILY_VERSION="${WORKBENCH_DAILY_VERSION}" \
WORKBENCH_PREVIEW_VERSION="${WORKBENCH_PREVIEW_VERSION}" \
PACKAGE_MANAGER_DAILY_VERSION="${PACKAGE_MANAGER_DAILY_VERSION}" \
CONNECT_DAILY_VERSION="${CONNECT_DAILY_VERSION}" \
BRANCH="${BRANCH}" \
python3 {{justfile_directory()}}/tools/test_bake_artifacts.py --file docker-bake.preview.hcl
56 changes: 1 addition & 55 deletions docker-bake.preview.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ target "base" {
labels = {
"maintainer" = "Posit Docker <[email protected]>"
}
output = ["type=image"]
output = ["type=image", "type=docker"]
}

target "product-base-dev" {
Expand All @@ -238,12 +238,6 @@ target "product-base-dev" {
"docker.io/rstudio/product-base-dev:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}",
]

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/product-base-dev-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "product/base"

Expand All @@ -268,12 +262,6 @@ target "product-base-pro-dev" {
"docker.io/rstudio/product-base-pro-dev:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}",
]

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/product-base-pro-dev-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "product/pro"
contexts = {
Expand All @@ -300,12 +288,6 @@ target "package-manager-daily" {
name = "package-manager-daily-${builds.os}-${replace(PACKAGE_MANAGER_DAILY_VERSION, ".", "-")}"
tags = get_tags(builds.os, "rstudio-package-manager-preview", PACKAGE_MANAGER_DAILY_VERSION, "daily")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/package-manager-daily-${builds.os}-${replace(PACKAGE_MANAGER_DAILY_VERSION, ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "package-manager"
contexts = {
Expand All @@ -330,12 +312,6 @@ target "connect-daily" {
name = "connect-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}"
tags = get_tags(builds.os, "rstudio-connect-preview", CONNECT_DAILY_VERSION, "daily")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/connect-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "connect"
contexts = {
Expand All @@ -359,12 +335,6 @@ target "connect-content-init-daily" {
name = "connect-content-init-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}"
tags = get_tags(builds.os, "rstudio-connect-content-init-preview", CONNECT_DAILY_VERSION, "daily")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/connect-content-init-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "connect-content-init"

Expand All @@ -383,12 +353,6 @@ target "r-session-complete-daily" {
name = "r-session-complete-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}"
tags = get_tags(builds.os, "r-session-complete-preview", WORKBENCH_DAILY_VERSION, "daily")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/r-session-complete-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "r-session-complete"
contexts = {
Expand All @@ -415,12 +379,6 @@ target "r-session-complete-preview" {
name = "r-session-complete-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}"
tags = get_tags(builds.os, "r-session-complete-preview", WORKBENCH_PREVIEW_VERSION, "preview")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/r-session-complete-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "r-session-complete"
contexts = {
Expand All @@ -446,12 +404,6 @@ target "workbench-daily" {
name = "workbench-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}"
tags = get_tags(builds.os, "rstudio-workbench-preview", WORKBENCH_DAILY_VERSION, "daily")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/workbench-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "workbench"
contexts = {
Expand All @@ -477,12 +429,6 @@ target "workbench-preview" {
name = "workbench-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}"
tags = get_tags(builds.os, "rstudio-workbench-preview", WORKBENCH_PREVIEW_VERSION, "preview")

# We output to an OCI so it can be pulled in for testing later on.
output = [
"type=image",
"type=oci,tar=false,dest=./.out/preview/workbench-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}"
]

dockerfile = "Dockerfile.${builds.os}"
context = "workbench"
contexts = {
Expand Down

0 comments on commit 3db9ce6

Please sign in to comment.