Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 7 tasks
webjoel opened this issue Dec 4, 2018 · 10 comments
Closed
2 of 7 tasks

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

webjoel opened this issue Dec 4, 2018 · 10 comments
Labels
topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/bug

Comments

@webjoel
Copy link
Contributor

webjoel commented 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

@lafriks lafriks added type/bug topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile labels Dec 4, 2018
@serieznyi
Copy link

I have same problem on version 1.6.1

@r4co0n
Copy link

r4co0n commented 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.

@apricote
Copy link
Contributor

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
Copy link
Contributor

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.

@gcstang
Copy link

gcstang commented 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.

@Wyall
Copy link
Contributor

Wyall commented Dec 21, 2018

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

@techknowlogick
Copy link
Member

techknowlogick commented 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)

@sonallux
Copy link

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

@lafriks
Copy link
Member

lafriks commented Jan 24, 2019

Duplicate of #4782

@lafriks lafriks marked this as a duplicate of #4782 Jan 24, 2019
@lafriks lafriks closed this as completed Jan 24, 2019
@zeripath
Copy link
Contributor

zeripath commented May 3, 2019

Fixed by #6836 and its backport #6839

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/bug
Projects
None yet
Development

No branches or pull requests

10 participants