In Gitea version with docker container shows git hash commit #2616

Closed
opened 2025-11-02 04:42:08 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @webjoel on GitHub (Dec 4, 2018).

  • Gitea version (or commit ref): 0da8bc9
  • Git version: 2.15.3
  • Operating system: Linux Ubuntu 64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

Gitea running in a container docker is displaying in the footer instead of the version (v1.6.0) the hash commit of git (0da8bc9), is this correct?

I am using release v1.6.0 from docker image: gitea/gitea:1.6.0

Screenshots

gitea1
gitea2
gitea3

Originally created by @webjoel on GitHub (Dec 4, 2018). - Gitea version (or commit ref): 0da8bc9 - Git version: 2.15.3 - Operating system: Linux Ubuntu 64 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description Gitea running in a container docker is displaying in the footer instead of the version (v1.6.0) the hash commit of git (0da8bc9), is this correct? I am using release v1.6.0 from docker image: gitea/gitea:1.6.0 ## Screenshots ![gitea1](https://user-images.githubusercontent.com/1946348/49459081-5e7ac900-f7d5-11e8-8189-f3ce6af31928.png) ![gitea2](https://user-images.githubusercontent.com/1946348/49459088-6175b980-f7d5-11e8-8cf9-2e9efad1a89e.png) ![gitea3](https://user-images.githubusercontent.com/1946348/49459093-6470aa00-f7d5-11e8-900b-9047e4afd73e.png)
GiteaMirror added the type/bugtopic/build labels 2025-11-02 04:42:08 -06:00
Author
Owner

@serieznyi commented on GitHub (Dec 10, 2018):

I have same problem on version 1.6.1

@serieznyi commented on GitHub (Dec 10, 2018): I have same problem on version 1.6.1
Author
Owner

@r4co0n commented on GitHub (Dec 14, 2018):

I have just pulled gitea/gitea:1.6:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
gitea/gitea         1.6                 96b698fc7516        23 hours ago        77.2MB

The web interface is reporting version 200b974, which is the current HEAD of branch release/v1.6, but not the commit of any release as in the original bug report.

@r4co0n commented on GitHub (Dec 14, 2018): I have just pulled `gitea/gitea:1.6`: ``` REPOSITORY TAG IMAGE ID CREATED SIZE gitea/gitea 1.6 96b698fc7516 23 hours ago 77.2MB ``` The web interface is reporting version `200b974`, which is the current [`HEAD` of branch `release/v1.6`](https://github.com/go-gitea/gitea/commit/200b974e198f5a18bf8b6638e1f8f21de17602fb), but not the commit of any release as in the original bug report.
Author
Owner

@apricote commented on GitHub (Dec 14, 2018):

The HEAD commit instead of the last tag is caused by the build step docker:

  docker:
    image: plugins/docker:17.12
    pull: true
    secrets: [ docker_username, docker_password ]
    repo: gitea/gitea
    tags: [ '${DRONE_BRANCH##release/v}' ]
    when:
      event: [ push ]
      branch: [ release/* ]

The tags parameter is a replace function that modifies the branch name from release/v1.6 to 1.6.

This behaviour should be fixed if the event condition is changed from [ push ] to [ tag ]. Only tagged commits in the release branches will trigger the deployment then.

I can test this and create a PR in the next few days if desired.

@apricote commented on GitHub (Dec 14, 2018): The `HEAD` commit instead of the last tag is caused by the build step `docker`: ```yaml docker: image: plugins/docker:17.12 pull: true secrets: [ docker_username, docker_password ] repo: gitea/gitea tags: [ '${DRONE_BRANCH##release/v}' ] when: event: [ push ] branch: [ release/* ] ``` The `tags` parameter is a replace function that modifies the branch name from `release/v1.6` to `1.6`. This behaviour should be fixed if the event condition is changed from `[ push ]` to `[ tag ]`. Only tagged commits in the release branches will trigger the deployment then. I can test this and create a PR in the next few days if desired.
Author
Owner

@apricote commented on GitHub (Dec 15, 2018):

My proposed fix does not work. The tag event does not have the variable DRONE_BRANCH populated, only DRONE_TAG, We would need to drop the last segment of the semver (tag name v1.6.1 -> 1.6) to know the docker image tag.

Problem is, the Drone string operations do not support regex based replacing, only removing prefix/suffix and substrings.

@apricote commented on GitHub (Dec 15, 2018): My proposed fix does not work. The `tag` event does not have the variable `DRONE_BRANCH` populated, only `DRONE_TAG`, We would need to drop the last segment of the semver (tag name `v1.6.1` -> `1.6`) to know the docker image tag. Problem is, the Drone [string operations](https://0-8-0.docs.drone.io/substitution/#string-operations-reference) do not support regex based replacing, only removing prefix/suffix and substrings.
Author
Owner

@gcstang commented on GitHub (Dec 21, 2018):

how can I figure out what version I'm on, is there a file or something internal to the docker image?
I see the hash "8670dec" at the bottom of my UI.

@gcstang commented on GitHub (Dec 21, 2018): how can I figure out what version I'm on, is there a file or something internal to the docker image? I see the hash "8670dec" at the bottom of my UI.
Author
Owner

@Wyall commented on GitHub (Dec 21, 2018):

Try checking the release section. But if you used the latest tag this will probably not work

@Wyall commented on GitHub (Dec 21, 2018): Try checking the release section. But if you used the latest tag this will probably not work
Author
Owner

@techknowlogick commented on GitHub (Dec 21, 2018):

@gcstang you you add that hash to the end of https://github.com/go-gitea/gitea/commit/ then you'll be taken to the exact commit (ex https://github.com/go-gitea/gitea/commit/8670dec is the URL for the version that you are on)

@techknowlogick commented on GitHub (Dec 21, 2018): @gcstang you you add that hash to the end of https://github.com/go-gitea/gitea/commit/ then you'll be taken to the exact commit (ex `https://github.com/go-gitea/gitea/commit/8670dec` is the URL for the version that you are on)
Author
Owner

@sonallux commented on GitHub (Jan 24, 2019):

This issue is still not fixed in gitea docker version 1.6.4. Only the git commit eb0ee6b is show in the footer.

According to this comment it is also present in the new gitea docker version 1.7.0.

I think this is a duplicate of issue #4782

@sonallux commented on GitHub (Jan 24, 2019): This issue is still not fixed in gitea docker version 1.6.4. Only the git commit `eb0ee6b` is show in the footer. According to [this comment](https://github.com/go-gitea/gitea/issues/4782#issuecomment-457136661) it is also present in the new gitea docker version 1.7.0. I think this is a duplicate of issue #4782
Author
Owner

@lafriks commented on GitHub (Jan 24, 2019):

Duplicate of #4782

@lafriks commented on GitHub (Jan 24, 2019): Duplicate of #4782
Author
Owner

@zeripath commented on GitHub (May 3, 2019):

Fixed by #6836 and its backport #6839

@zeripath commented on GitHub (May 3, 2019): Fixed by #6836 and its backport #6839
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2616