Skip to content

Commit

Permalink
Add environment variable support for Iroha image tag in CI workflow (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
3 people authored Nov 8, 2024
1 parent d75e92d commit 763dd09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/iroha2-allure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/iroha2-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ open class IrohaContainer : GenericContainer<IrohaContainer> {
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"
Expand Down

0 comments on commit 763dd09

Please sign in to comment.