I want to use custom logo-white, logo-black, and favicon in my company installation of GitLab.
I've Googled my butt off and tried eveything I can find to clear these damn images and nothing seems to work.
Here's the only process that seems to run successfully, yet it does not remove the images:
bundle exec rake cache:clear RAILS_ENV=production
service gitlab stop
redis-cli FLUSHALL
bundle exec rake assets:precompile RAILS_ENV=production
service gitlab start
Then I clear my browser cache and go to the domain and there are the same damn images again!
I even deleted all the logo and favicon files I could find completely from the application, and yet somehow they are still there.
HELP!
There's a rake task assets:clean
since version 6.0. So run bundle exec rake assets:clean RAILS_ENV=production
from the command line and it will remove the assets.
After you nuke them, you'll probably want to run bundle exec rake assets:precompile RAILS_ENV=production
to rebuild them.
I was able to combine some of the info here, and successfully replaced the logo using the following steps (note that some commands are slightly different using the latest version of gitlab, 7.11.4, on CentOS 7, so I am adding this as an answer in the hopes that it will be helpful to users with the new version):
/opt/gitlab/embedded/service/gitlab-rails/app/assets/images
sudo gitlab-ctl stop
sudo gitlab-rake assets:clean RAILS_ENV=production
followed by sudo gitlab-rake assets:precompile RAILS_ENV=production
sudo gitlab-ctl start
For some reason I was getting permission errors in the precompile
step. This was solved by changing the write permissions to /opt/gitlab/embedded/service/gitlab-rails/public/assets/
to be globally writable (a+w
). It seems that gitlab-rake
runs as the git
user, even though I used sudo
. So, after the steps above, I also changed the owner to root (sudo chown -R root:root /opt/gitlab/embedded/service/gitlab-rails/public/assets
), and the permissions back using a-w
.
I assume that upgrading gitlab will revert the logo back to the original one, but I haven't tried that yet.
I found the answer for anyone looking.
You also have to replace the images in
app/assets/images/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With