Skip to content

Commit 763dd09

Browse files
troferolleralexstroke1BAStos525
authored
Add environment variable support for Iroha image tag in CI workflow (#444)
* Rework TAG classificator Signed-off-by: troferoller <[email protected]> * Add new var Signed-off-by: troferoller <[email protected]> * Update iroha2-allure.yml Signed-off-by: troferoller <[email protected]> * add env Signed-off-by: troferoller <[email protected]> * Update iroha2-allure.yml Signed-off-by: troferoller <[email protected]> * Check run Signed-off-by: troferoller <[email protected]> * Update IrohaContainer.kt refactor IrohaContainer Signed-off-by: alexstroke1 <[email protected]> * Update iroha2-pr.yml add IROHA_IMAGE_TAG in env Signed-off-by: alexstroke1 <[email protected]> * Update IrohaContainer.kt fix vars Signed-off-by: alexstroke1 <[email protected]> * Update IrohaConfig.kt fix vars Signed-off-by: alexstroke1 <[email protected]> * Update iroha2-pr.yml change env Signed-off-by: alexstroke1 <[email protected]> * Update iroha2-allure.yml add env var into allure job Signed-off-by: alexstroke1 <[email protected]> * Update iroha2-pr.yml replace image Signed-off-by: alexstroke1 <[email protected]> * Update iroha2-allure.yml delete line Signed-off-by: alexstroke1 <[email protected]> * Update iroha2-pr.yml fix comment Signed-off-by: alexstroke1 <[email protected]> * use iroha-ubuntu-latest by default Signed-off-by: BAStos525 <[email protected]> * Update iroha2-pr.yml replace on selfhosted Signed-off-by: alexstroke1 <[email protected]> --------- Signed-off-by: troferoller <[email protected]> Signed-off-by: alexstroke1 <[email protected]> Signed-off-by: BAStos525 <[email protected]> Co-authored-by: alexstroke1 <[email protected]> Co-authored-by: BAStos525 <[email protected]>
1 parent d75e92d commit 763dd09

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/iroha2-allure.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
required: false
2020

2121
env:
22+
IROHA_IMAGE_TAG: "dev"
2223
ALLURE_RESULTS: "${{ github.workspace }}/modules/client/build/allure-results"
2324
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }}
2425

.github/workflows/iroha2-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
jobs:
77
build:
88
runs-on: self-hosted
9+
10+
env:
11+
IROHA_IMAGE_TAG: "2.0.0-pre-rc.22.2" # Place "dev" to run on the last iroha
912

1013
steps:
1114
- uses: actions/checkout@v3

modules/test-tools/src/main/kotlin/jp/co/soramitsu/iroha2/testengine/IrohaContainer.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,13 @@ open class IrohaContainer : GenericContainer<IrohaContainer> {
152152
private fun String.readStatusBlocks() = JSON_SERDE.readTree(this).get("blocks")?.doubleValue()
153153

154154
companion object {
155-
private fun IrohaConfig.getFullImageName() = when (this.imageTag.contains("sha256")) {
156-
true -> "${this.imageName}@${this.imageTag}"
157-
false -> "${this.imageName}:${this.imageTag}"
158-
}.let { DockerImageName.parse(it) }
155+
private fun IrohaConfig.getFullImageName(): DockerImageName {
156+
val imageTag = System.getenv("IROHA_IMAGE_TAG") ?: DEFAULT_IMAGE_TAG
157+
return when (imageTag.contains("sha256")) {
158+
true -> "${this.imageName}@$imageTag"
159+
false -> "${this.imageName}:$imageTag"
160+
}.let { DockerImageName.parse(it) }
161+
}
159162

160163
const val NETWORK_ALIAS = "iroha"
161164
const val DEFAULT_IMAGE_TAG = "2.0.0-pre-rc.22.2"

0 commit comments

Comments
 (0)