diff --git a/.github/workflows/build-ot3-actions.yml b/.github/workflows/build-ot3-actions.yml index f958f58b..d46b0628 100644 --- a/.github/workflows/build-ot3-actions.yml +++ b/.github/workflows/build-ot3-actions.yml @@ -163,7 +163,7 @@ jobs: if: ${{ matrix.build_env == 'stage-prod' }} uses: slackapi/slack-github-action@v1.14.0 with: - payload: "{\"s3-url\":\"${{ steps.upload-results.outputs.console_url }}/\",\"type\":\"branch\", \"reflike\":\"${{ github.ref }}\", \"full-image\":\"${{ steps.upload-results.outputs.fullimage_url }}\", \"system-update\":\"${{ steps.upload-results.outputs.system_url }}\", \"version-file\":\"${{ steps.upload-results.outputs.version_file_url }}\"}" + payload: "{\"s3-url\":\"${{ steps.upload-results.outputs.console_url }}/\",\"type\":\"branch\", \"reflike\":\"${{ steps.build-refs.outputs.oe-core }}\", \"full-image\":\"${{ steps.upload-results.outputs.fullimage_url }}\", \"system-update\":\"${{ steps.upload-results.outputs.system_url }}\", \"version-file\":\"${{ steps.upload-results.outputs.version_file_url }}\"}" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - name: Remove build data diff --git a/layers/meta-opentrons/classes/get_ot_package_version.bbclass b/layers/meta-opentrons/classes/get_ot_package_version.bbclass index fc942589..118f6fe9 100644 --- a/layers/meta-opentrons/classes/get_ot_package_version.bbclass +++ b/layers/meta-opentrons/classes/get_ot_package_version.bbclass @@ -1,10 +1,18 @@ -PACKAGEJSON_FILE ?= "${S}/package.json" +OT_PACKAGE ?= '' DEST_SYSTEMD_DROPFILE ?= "${B}/version.conf" +MONOREPO_ROOT_PATH = "${S}" def get_ot_package_version(d): import json + import os + s = d.getVar('MONOREPO_ROOT_PATH') f = d.getVar('PACKAGEJSON_FILE') - return json.load(open(f))['version'] + try: + sys.path.append(os.path.join(s, 'scripts')) + from python_build_utils import get_version + return get_version(d.getVar('OT_PACKAGE', 'robot-server'), 'ot3') + finally: + sys.path = sys.path[:-1] # Add this as a task if you want to use it: # addtask do_write_systemd_dropfile after do_compile before do_install diff --git a/layers/meta-opentrons/recipes-robot/opentrons-robot-server/opentrons-robot-server_git.bb b/layers/meta-opentrons/recipes-robot/opentrons-robot-server/opentrons-robot-server_git.bb index 28ac77ca..a3959f39 100644 --- a/layers/meta-opentrons/recipes-robot/opentrons-robot-server/opentrons-robot-server_git.bb +++ b/layers/meta-opentrons/recipes-robot/opentrons-robot-server/opentrons-robot-server_git.bb @@ -6,8 +6,8 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" # Modify these as desired -PACKAGEJSON_FILE = "${S}/robot-server/robot_server/package.json" DEST_SYSTEMD_DROPFILE ?= "${B}/robot-server-version.conf" +OT_PACKAGE = "robot-server" inherit insane systemd get_ot_package_version SYSTEMD_AUTO_ENABLE = "enable" @@ -31,7 +31,7 @@ addtask do_write_systemd_dropfile after do_compile before do_install do_install_append () { # create json file to be used in VERSION.json install -d ${D}/opentrons_versions - python3 ${S}/scripts/python_build_utils.py robot-server dump_br_version > ${D}/opentrons_versions/opentrons-robot-server-version.json + python3 ${S}/scripts/python_build_utils.py robot-server ot3 dump_br_version > ${D}/opentrons_versions/opentrons-robot-server-version.json install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/opentrons-robot-server.service ${D}${systemd_system_unitdir}/opentrons-robot-server.service diff --git a/layers/meta-opentrons/recipes-robot/opentrons-update-server/opentrons-update-server_git.bb b/layers/meta-opentrons/recipes-robot/opentrons-update-server/opentrons-update-server_git.bb index 24fb7080..2898d776 100644 --- a/layers/meta-opentrons/recipes-robot/opentrons-update-server/opentrons-update-server_git.bb +++ b/layers/meta-opentrons/recipes-robot/opentrons-update-server/opentrons-update-server_git.bb @@ -27,7 +27,7 @@ PIPENV_APP_BUNDLE_USE_GLOBAL = "python3-aiohttp systemd-python" do_install_append() { # create json file to be used in VERSION.json install -d ${D}/opentrons_versions - python3 ${S}/scripts/python_build_utils.py update-server dump_br_version > ${D}/opentrons_versions/opentrons-update-server-version.json + python3 ${S}/scripts/python_build_utils.py update-server ot3 dump_br_version > ${D}/opentrons_versions/opentrons-update-server-version.json install -d ${D}/${systemd_unitdir}/system install -m 0644 ${WORKDIR}/opentrons-update-server.service ${D}/${systemd_unitdir}/system