Commit 777410a8 authored by Shaun McCann's avatar Shaun McCann

Merge branch 'weimeng-master-patch-13652' into 'master'

Prune GitLab Rails Console Cheat Sheet page

Closes gitlab-com/support/toolbox/snippets#62, gitlab-com/support/toolbox/snippets#57, gitlab-com/support/toolbox/snippets#48, gitlab-com/support/toolbox/snippets#47, gitlab-com/support/toolbox/snippets#43, and gitlab-com/support/toolbox/snippets#13

See merge request gitlab-org/gitlab!26148
parents da76de12 ccf9ff31
...@@ -262,14 +262,6 @@ p.each do |project| ...@@ -262,14 +262,6 @@ p.each do |project|
end end
``` ```
### Identify un-indexed projects
```ruby
Project.find_each do |project|
puts "id #{project.id}: #{project.namespace.name.to_s}/#{project.name.to_s}" if project.index_status.nil?
end
```
## Wikis ## Wikis
### Recreate ### Recreate
...@@ -761,12 +753,6 @@ Ci::Pipeline.where(project_id: p.id).where(status: 'pending').each {|p| p.cancel ...@@ -761,12 +753,6 @@ Ci::Pipeline.where(project_id: p.id).where(status: 'pending').each {|p| p.cancel
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count
``` ```
### Manually modify runner minutes
```ruby
Namespace.find_by_full_path("user/proj").namespace_statistics.update(shared_runners_seconds: 27360)
```
### Remove artifacts more than a week old ### Remove artifacts more than a week old
The Latest version of these steps can be found in the [job artifacts documentation](../job_artifacts.md) The Latest version of these steps can be found in the [job artifacts documentation](../job_artifacts.md)
...@@ -806,21 +792,6 @@ build.dependencies.each do |d| { puts "status: #{d.status}, finished at: #{d.fin ...@@ -806,21 +792,6 @@ build.dependencies.each do |d| { puts "status: #{d.status}, finished at: #{d.fin
completed: #{d.complete?}, artifacts_expired: #{d.artifacts_expired?}, erased: #{d.erased?}" } completed: #{d.complete?}, artifacts_expired: #{d.artifacts_expired?}, erased: #{d.erased?}" }
``` ```
### Disable strict artifact checking (Introduced in GitLab 10.3.0)
See [job artifacts documentation](../job_artifacts.md#validation-for-dependencies).
```ruby
Feature.enable('ci_disable_validates_dependencies')
```
### Remove CI traces older than 6 months
```ruby
current_user = User.find_by_email('cindy@gitlap.com')
Ci::Build.where("finished_at < ?", 6.months.ago.to_date).each {|b| puts b.id; b.erase(erased_by: current_user) if b.erasable?};nil
```
### Try CI service ### Try CI service
```ruby ```ruby
...@@ -965,12 +936,6 @@ end ...@@ -965,12 +936,6 @@ end
## Sidekiq ## Sidekiq
### Size of a queue
```ruby
Sidekiq::Queue.new('background_migration').size
```
### Kill a worker's Sidekiq jobs ### Kill a worker's Sidekiq jobs
```ruby ```ruby
...@@ -1017,12 +982,6 @@ See <https://github.com/mperham/sidekiq/wiki/Signals#ttin>. ...@@ -1017,12 +982,6 @@ See <https://github.com/mperham/sidekiq/wiki/Signals#ttin>.
/opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket /opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket
``` ```
### Connect to Redis (HA)
```shell
/opt/gitlab/embedded/bin/redis-cli -h <host ip> -a <password>
```
## LFS ## LFS
### Get info about LFS objects and associated project ### Get info about LFS objects and associated project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment