Merge pull request #7136 from blockscout/vb-release-version

Add release link or commit hash to docker images
pull/7143/head
Victor Baranov 2 years ago committed by GitHub
commit 75f5af28da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .github/workflows/publish-docker-image-every-push.yml
  2. 1
      .github/workflows/publish-docker-image-release.yml
  3. 1
      CHANGELOG.md
  4. 31
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex

@ -7,7 +7,7 @@ on:
env: env:
OTP_VERSION: '25.2.1' OTP_VERSION: '25.2.1'
ELIXIR_VERSION: '1.14.3' ELIXIR_VERSION: '1.14.3'
NEXT_RELEASE_VERSION: 5.1.1 RELEASE_VERSION: 5.1.1
jobs: jobs:
push_to_registry: push_to_registry:
@ -55,7 +55,7 @@ jobs:
push: true push: true
cache-from: type=registry,ref=blockscout/blockscout:buildcache cache-from: type=registry,ref=blockscout/blockscout:buildcache
cache-to: type=registry,ref=blockscout/blockscout:buildcache,mode=max cache-to: type=registry,ref=blockscout/blockscout:buildcache,mode=max
tags: blockscout/blockscout:latest, blockscout/blockscout:${{ env.NEXT_RELEASE_VERSION }}-prerelease-${{ env.SHORT_SHA }} tags: blockscout/blockscout:latest, blockscout/blockscout:${{ env.RELEASE_VERSION }}.+commit.${{ env.SHORT_SHA }}
build-args: | build-args: |
CACHE_EXCHANGE_RATES_PERIOD= CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_READ_API=false DISABLE_READ_API=false
@ -65,6 +65,7 @@ jobs:
WOBSERVER_ENABLED=false WOBSERVER_ENABLED=false
ADMIN_PANEL_ENABLED=false ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v{{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
- name: Build and push Docker image for frontend - name: Build and push Docker image for frontend
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3

@ -62,6 +62,7 @@ jobs:
WOBSERVER_ENABLED=false WOBSERVER_ENABLED=false
ADMIN_PANEL_ENABLED= ADMIN_PANEL_ENABLED=
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v{{ env.RELEASE_VERSION }}-beta
merge-master-after-release: merge-master-after-release:
name: Merge 'master' to specific branch after release name: Merge 'master' to specific branch after release

@ -24,6 +24,7 @@
### Chore ### Chore
- [#7136](https://github.com/blockscout/blockscout/pull/7136) - Add release link or commit hash to docker images
- [#7072](https://github.com/blockscout/blockscout/pull/7072) - Add a separate docker compose for geth with clique consensus - [#7072](https://github.com/blockscout/blockscout/pull/7072) - Add a separate docker compose for geth with clique consensus
- [#7056](https://github.com/blockscout/blockscout/pull/7056) - Add path_helper in interact.js - [#7056](https://github.com/blockscout/blockscout/pull/7056) - Add path_helper in interact.js
- [#7040](https://github.com/blockscout/blockscout/pull/7040) - Use alias BlockScoutWeb.Cldr.Number - [#7040](https://github.com/blockscout/blockscout/pull/7040) - Use alias BlockScoutWeb.Cldr.Number

@ -109,25 +109,34 @@ defmodule BlockScoutWeb.LayoutView do
BlockScoutWeb.version() BlockScoutWeb.version()
end end
def release_link(""), do: ""
def release_link(nil), do: ""
def release_link(version) do def release_link(version) do
release_link_env_var = Application.get_env(:block_scout_web, :release_link) release_link_env_var = Application.get_env(:block_scout_web, :release_link)
release_link = release_link =
cond do if release_link_env_var == "" || release_link_env_var == nil do
version == "" || version == nil -> release_link_from_version(version)
nil else
release_link_env_var
end
release_link_env_var == "" || release_link_env_var == nil -> html_escape({:safe, "<a href=\"#{release_link}\" class=\"footer-link\" target=\"_blank\">#{version}</a>"})
"https://github.com/blockscout/blockscout/releases/tag/" <> version end
true -> def release_link_from_version(version) do
release_link_env_var repo = "https://github.com/blockscout/blockscout"
end
if String.contains?(version, "+commit.") do
commit_hash =
version
|> String.split("+commit.")
|> List.last()
if release_link == nil do repo <> "/commit/" <> commit_hash
""
else else
html_escape({:safe, "<a href=\"#{release_link}\" class=\"footer-link\" target=\"_blank\">#{version}</a>"}) repo <> "/releases/tag/" <> version
end end
end end

Loading…
Cancel
Save