diff --git a/.github/workflows/iroha2-allure.yml b/.github/workflows/iroha2-allure.yml index 13b19241..660e08ae 100644 --- a/.github/workflows/iroha2-allure.yml +++ b/.github/workflows/iroha2-allure.yml @@ -19,6 +19,7 @@ on: required: false env: + IROHA_IMAGE_TAG: "dev" ALLURE_RESULTS: "${{ github.workspace }}/modules/client/build/allure-results" ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }} diff --git a/.github/workflows/iroha2-pr.yml b/.github/workflows/iroha2-pr.yml index 79ab0919..8588b6c5 100644 --- a/.github/workflows/iroha2-pr.yml +++ b/.github/workflows/iroha2-pr.yml @@ -6,6 +6,9 @@ on: jobs: build: runs-on: self-hosted + + env: + IROHA_IMAGE_TAG: "2.0.0-pre-rc.22.2" # Place "dev" to run on the last iroha steps: - uses: actions/checkout@v3 diff --git a/modules/test-tools/src/main/kotlin/jp/co/soramitsu/iroha2/testengine/IrohaContainer.kt b/modules/test-tools/src/main/kotlin/jp/co/soramitsu/iroha2/testengine/IrohaContainer.kt index c7093ce6..7edfabfa 100644 --- a/modules/test-tools/src/main/kotlin/jp/co/soramitsu/iroha2/testengine/IrohaContainer.kt +++ b/modules/test-tools/src/main/kotlin/jp/co/soramitsu/iroha2/testengine/IrohaContainer.kt @@ -152,10 +152,13 @@ open class IrohaContainer : GenericContainer { private fun String.readStatusBlocks() = JSON_SERDE.readTree(this).get("blocks")?.doubleValue() companion object { - private fun IrohaConfig.getFullImageName() = when (this.imageTag.contains("sha256")) { - true -> "${this.imageName}@${this.imageTag}" - false -> "${this.imageName}:${this.imageTag}" - }.let { DockerImageName.parse(it) } + private fun IrohaConfig.getFullImageName(): DockerImageName { + val imageTag = System.getenv("IROHA_IMAGE_TAG") ?: DEFAULT_IMAGE_TAG + return when (imageTag.contains("sha256")) { + true -> "${this.imageName}@$imageTag" + false -> "${this.imageName}:$imageTag" + }.let { DockerImageName.parse(it) } + } const val NETWORK_ALIAS = "iroha" const val DEFAULT_IMAGE_TAG = "2.0.0-pre-rc.22.2"