Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gitlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
gitlab
Commits
201170e9
Commit
201170e9
authored
Aug 03, 2021
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Makefile to build gitlab properly
parent
f53237dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
57 deletions
+130
-57
Makefile
Makefile
+60
-57
cleanup
cleanup
+70
-0
No files found.
Makefile
View file @
201170e9
...
@@ -8,7 +8,7 @@ all: database-config
...
@@ -8,7 +8,7 @@ all: database-config
rm
/etc/gshadow
rm
/etc/gshadow
mv
-v
/data/etc/gshadow /etc/gshadow
mv
-v
/data/etc/gshadow /etc/gshadow
groupadd
-g
101 git
groupadd
-g
101 git
useradd
-c
"GitLab"
-
d
/srv/gitlab
-
g
git
-s
/bin/false
-u
101 git
useradd
-c
"GitLab"
-g
git
-s
/bin/false
-u
101 git
rm
/etc/passwd-
rm
/etc/passwd-
rm
/etc/group-
rm
/etc/group-
rm
/etc/shadow-
rm
/etc/shadow-
...
@@ -27,82 +27,85 @@ all: database-config
...
@@ -27,82 +27,85 @@ all: database-config
mkswap
swap
mkswap
swap
swapon
swap
swapon
swap
mkdir
tmp
mkdir
tmp
chown
-R
git.git
tmp
mount
--bind
tmp
/tmp
mount
--bind
tmp
/tmp
mkdir
gitlab-home
mkdir
gitlab-home
chown
-R
git.git
gitlab-home
install
-v
-m755
-d
/home/git
-o
git
-g
git
install
-v
-m755
-d
/srv/gitlab
-o
git
-g
git
install
-v
-m755
-d
/srv/gitlab
-o
git
-g
git
sudo
-u
git
-H
tar
xf
gitlab-foss-v13.1.0.tar.bz2
-C
/srv/gitlab
--strip-components
=
1
ln
-s
/srv/gitlab
/home/git/gitlab
sudo
-u
git
-H
patch
-Np1
-d
/srv/gitlab
<
gitlab-foss-v13.1.0-gems_update.patch
chown
-R
git.git
/srv/gitlab
cd
/srv/gitlab
&&
sudo
-u
git
-H
mv
config/gitlab.yml.example
config/gitlab.yml
sudo
-u
git
-H
tar
xf
gitlab-foss-v13.1.0.tar.bz2
-C
/home/git/gitlab
--strip-components
=
1
cd
/srv/gitlab
&&
sudo
-u
git
-H
mv
config/secrets.yml.example
config/secrets.yml
sudo
-u
git
-H
patch
-Np1
-d
/home/git/gitlab
<
gitlab-foss-v13.1.0-gems_update.patch
cd
/srv/gitlab
&&
chown
-R
git
log/
chown
-R
git.git
/home/git/gitlab
cd
/srv/gitlab
&&
chown
-R
git
tmp/
cd
/srv/gitlab
&&
chmod
-R
u+rwX,go-w
log/
cd
/home/git/gitlab
&&
sudo
-u
git
-H
mv
config/gitlab.yml.example
config/gitlab.yml
cd
/srv/gitlab
&&
chmod
-R
u+rwX
tmp/
cd
/home/git/gitlab
&&
sudo
-u
git
-H
mv
config/secrets.yml.example
config/secrets.yml
cd
/srv/gitlab
&&
chmod
-R
u+rwX
tmp/pids/
cd
/home/git/gitlab
&&
chown
-R
git
log/
cd
/srv/gitlab
&&
chmod
-R
u+rwX
tmp/sockets/
cd
/home/git/gitlab
&&
chown
-R
git
tmp/
cd
/srv/gitlab
&&
sudo
-u
git
-H
mkdir
-p
public/uploads/
cd
/home/git/gitlab
&&
chmod
-R
u+rwX,go-w
log/
cd
/srv/gitlab
&&
chmod
0700
public/uploads
cd
/home/git/gitlab
&&
chmod
-R
u+rwX
tmp/
cd
/srv/gitlab
&&
chmod
-R
u+rwX
builds/
cd
/home/git/gitlab
&&
chmod
-R
u+rwX
tmp/pids/
cd
/srv/gitlab
&&
chmod
-R
u+rwX
shared/artifacts/
cd
/home/git/gitlab
&&
chmod
-R
u+rwX
tmp/sockets/
cd
/srv/gitlab
&&
chmod
-R
ug+rwX
shared/pages/
cd
/home/git/gitlab
&&
sudo
-u
git
-H
mkdir
-p
public/uploads/
cd
/srv/gitlab
&&
sudo
-u
git
-H
mv
config/puma.rb.example
config/puma.rb
cd
/home/git/gitlab
&&
chmod
0700
public/uploads
cd
/home/git/gitlab
&&
chmod
-R
u+rwX
builds/
cd
/home/git/gitlab
&&
chmod
-R
u+rwX
shared/artifacts/
cd
/home/git/gitlab
&&
chmod
-R
ug+rwX
shared/pages/
cd
/home/git/gitlab
&&
sudo
-u
git
-H
mv
config/puma.rb.example
config/puma.rb
sudo
-u
git
-H
git
config
--global
core.autocrlf
input
sudo
-u
git
-H
git
config
--global
core.autocrlf
input
sudo
-u
git
-H
git
config
--global
gc.auto
0
sudo
-u
git
-H
git
config
--global
gc.auto
0
sudo
-u
git
-H
git
config
--global
repack.writeBitmaps
true
sudo
-u
git
-H
git
config
--global
repack.writeBitmaps
true
sudo
-u
git
-H
git
config
--global
receive.advertisePushOptions
true
sudo
-u
git
-H
git
config
--global
receive.advertisePushOptions
true
sudo
-u
git
-H
git
config
--global
core.fsyncObjectFiles
true
sudo
-u
git
-H
git
config
--global
core.fsyncObjectFiles
true
cd
/srv/gitlab
&&
sudo
-u
git
-H
mv
config/resque.yml.example
config/resque.yml
cd
/home/git/gitlab
&&
sudo
-u
git
-H
mv
config/resque.yml.example
config/resque.yml
@echo
"$$DATABASE_CONFIG"
>
/srv/gitlab/config/database.yml
cd
/srv/gitlab
&&
chown
-R
git.git
config/database.yml
cd
/srv/gitlab
&&
sudo
-u
git
-H
chmod
o-rwx
config/database.yml
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
install
--deployment
--without
development
test
mysql
aws
kerberos
@echo
"$$DATABASE_CONFIG"
>
/home/git/gitlab/config/database.yml
cd /srv/gitlab && sudo -u git -H PATH=$$PATH
:
$(CURDIR)/../go/go/bin GOCACHE=$(CURDIR)/gitlab-home/gocache bundle exec rake gitlab:shell:install RAILS_ENV=production
cd
/home/git/gitlab
&&
chown
-R
git.git
config/database.yml
cd
/srv/gitlab
&&
sudo
-u
git
-H
PATH
=
$$
PATH:
$(CURDIR)
/../go/go/bin
GOCACHE
=
$(CURDIR)
/gitlab-home/gocache bundle
exec
rake
"gitlab:workhorse:install[/srv/gitlab/gitlab-workhorse]"
RAILS_ENV
=
production
cd
/home/git/gitlab
&&
sudo
-u
git
-H
chmod
o-rwx
config/database.yml
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
exec
rake
"gitlab:gitaly:install[/srv/gitlab/gitaly,/srv/gitlab/repositories]"
RAILS_ENV
=
production
chmod
0700 /srv/gitlab/tmp/sockets/private
chown
git /srv/gitlab/tmp/sockets/private
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
exec
rake gitlab:env:info
RAILS_ENV
=
production
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
exec
rake gettext:compile
RAILS_ENV
=
production
cd
/srv/gitlab
&&
sudo
-u
git
-H
yarn
install
--production
--pure-lockfile
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
exec
rake gitlab:assets:compile
RAILS_ENV
=
production
NODE_ENV
=
production
NODE_OPTIONS
=
"--max-old-space-size=3072"
rm
-rf
/usr/local/share/.yarnrc
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home bundle
install
--deployment
--without
development
test
mysql aws kerberos
rm
-rf
/srv/gitlab/tmp/cache/*
cd /home/git/gitlab && sudo -u git -H HOME=$(CURDIR)/gitlab-home PATH=$$PATH
:
$(CURDIR)/../go/go/bin GOCACHE=$(CURDIR)/gitlab-home/gocache bundle exec rake gitlab:shell:install RAILS_ENV=production
rm
-rf
/srv/gitlab/vendor/bundle/ruby/*/gems/nokogumbo-*/ext/nokogumboc/tmp
mv
/home/git/gitlab-shell /srv/gitlab-shell
rm
-rf
/srv/gitlab/vendor/bundle/ruby/*/gems/graphiql-rails-*/test/dummy/tmp
ln
-s
/srv/gitlab-shell /home/git/gitlab-shell
find
/srv/gitlab
-name
*.gz
-exec
rm
-f
'{}'
';'
chown
-R
git.git /home/git/gitlab-shell
find
/
-name
*.gem
-exec
rm
-f
'{}'
';'
chmod
o+w /srv
find
/
-name
*.pyc
-exec
rm
-f
'{}'
';'
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home
PATH
=
$$
PATH:
$(CURDIR)
/../go/go/bin
GOCACHE
=
$(CURDIR)
/gitlab-home/gocache bundle
exec
rake
"gitlab:workhorse:install[/srv/gitlab-workhorse]"
RAILS_ENV
=
production
find
/
-name
*.js.map
-exec
rm
-f
'{}'
';'
ln
-s
/srv/gitlab-workhorse /home/git/gitlab-workhorse
find
/
-name
*.css.map
-exec
rm
-f
'{}'
';'
chown
-R
git.git /home/git/gitlab-workhorse
find
/
-depth
-name
.cache
-type
d
-exec
rm
-rf
'{}'
';'
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home
PATH
=
$$
PATH:
$(CURDIR)
/../go/go/bin
GOCACHE
=
$(CURDIR)
/gitlab-home/gocache
VERBOSE
=
1 bundle
exec
rake
"gitlab:gitaly:install[/srv/gitaly,/home/git/repositories]"
RAILS_ENV
=
production
find
/
-depth
-name
.pytest_cache
-type
d
-exec
rm
-rf
'{}'
';'
ln
-s
/srv/gitaly /home/git/gitaly
find
/
-depth
-name
.mypy_cache
-type
d
-exec
rm
-rf
'{}'
';'
chown
-R
git.git /home/git/gitaly
find
/
-depth
-name
__pycache__
-type
d
-exec
rm
-rf
'{}'
';'
chmod
o-w /srv
find
/
-depth
-name
.tox
-type
d
-exec
rm
-rf
'{}'
';'
chmod
0700 /home/git/gitlab/tmp/sockets/private
find
/
-depth
-name
node_modules
-type
d
-exec
rm
-rf
'{}'
';'
chown
git /home/git/gitlab/tmp/sockets/private
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home bundle
exec
rake gettext:compile
RAILS_ENV
=
production
rm
-rf
gitlab-home
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home yarn
install
--production
--pure-lockfile
umount
/tmp
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home bundle
exec
rake gitlab:assets:compile
RAILS_ENV
=
production
NODE_ENV
=
production
NODE_OPTIONS
=
"--max-old-space-size=3072"
rm
-rf
tmp
swapoff
swap
rm
-rf
swap
postinstall
:
install
-v
-m775
-o
git
-g
git
-d
/var/run/redis
sudo
-u
git
/usr/bin/redis-server
/etc/redis/redis.conf
--daemonize
yes
--unixsocket
/var/run/redis/redis.sock
--supervised
no
install
-v
-m775
-o
postgres
-g
postgres
-d
/run/postgresql
install
-v
-m775
-o
postgres
-g
postgres
-d
/run/postgresql
sudo
-u
postgres
/usr/bin/pg_ctl
-s
-D
/srv/pgsql/data
start
-w
-t
120
sudo
-u
postgres
/usr/bin/pg_ctl
-s
-D
/srv/pgsql/data
start
-w
-t
120
sudo
-u
postgres
psql
-d
template1
-c
"CREATE USER git CREATEDB;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE USER git CREATEDB;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE EXTENSION IF NOT EXISTS pg_trgm;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE EXTENSION IF NOT EXISTS pg_trgm;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE EXTENSION IF NOT EXISTS btree_gist;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE EXTENSION IF NOT EXISTS btree_gist;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE DATABASE gitlabhq_production OWNER git;"
sudo
-u
postgres
psql
-d
template1
-c
"CREATE DATABASE gitlabhq_production OWNER git;"
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
exec
rake gitlab:setup
RAILS_ENV
=
production
force
=
yes
sudo
-u
git
-H
sh
-c
"/home/git/gitlab/bin/daemon_with_pidfile /home/git/gitlab/tmp/pids/gitaly.pid /home/git/gitaly/gitaly /home/git/gitaly/config.toml >> /home/git/gitlab/log/gitaly.log 2>&1 &"
cd
/srv/gitlab
&&
sudo
-u
git
-H
bundle
exec
rake gitlab:setup
RAILS_ENV
=
production
GITLAB_ROOT_PASSWORD
=
password
GITLAB_ROOT_EMAIL
=
email
GITLAB_LICENSE_FILE
=
"/srv/gitlab/license"
cd /home/git/gitlab && sudo -u git -H bundle exec rake gitlab
:
setup RAILS_ENV=production force=yes
cd
/home/git/gitlab
&&
sudo
-u
git
-H
HOME
=
$(CURDIR)
/gitlab-home
PATH
=
$$
PATH:
$(CURDIR)
/../go/go/bin
GOCACHE
=
$(CURDIR)
/gitlab-home/gocache bundle
exec
rake gitlab:env:info
RAILS_ENV
=
production
sudo
-u
postgres /usr/bin/pg_ctl
-s
-D
/srv/pgsql/data stop
-m
fast
sudo
-u
postgres /usr/bin/pg_ctl
-s
-D
/srv/pgsql/data stop
-m
fast
sudo
-u
git /usr/bin/redis-cli shutdown nosave
rm
-rf
/usr/local/share/.yarnrc
/bin/sh
cleanup
gitlab
bundler
dev
doc
git
tests
cache
ports
man
patches
node_modules
windows
macos
bytecode
maps
packed_assets
rm
-rf
gitlab-home
umount
/tmp
rm
-rf
tmp
swapoff
swap
rm
-rf
swap
database-config
:
database-config
:
define
DATABASE_CONFIG
define
DATABASE_CONFIG
...
...
cleanup
0 → 100755
View file @
201170e9
#!/bin/sh
pkg
=
$1
if
[
"$#"
!=
"0"
]
;
then
shift
for
group
in
$@
;
do
removegroups+
=(
"
$group
"
)
done
fi
load_regexps
()
{
local
groupfile
=
$1
.groups
local
group
set
-f
unset
regexps
if
[
-f
$groupfile
]
;
then
while
read
-r
line
do
if
[
-n
"
$line
"
]
;
then
if
[[
!
$line
=
~ ^/
]]
;
then
group
=
$line
else
if
[
-z
$removegroups
]
;
then
regexps+
=(
"
$line
"
)
else
for
remove
in
${
removegroups
[@]
}
;
do
if
[[
$group
==
$remove
]]
;
then
regexps+
=(
"
$line
"
)
fi
done
fi
fi
fi
done
<
"
$groupfile
"
fi
set
+f
}
check_regexps
()
{
declare
-a
matches
set
-f
count
=
0
for
regexp
in
${
regexps
[@]
}
;
do
if
[[
"
$1
"
=
~ ^
$regexp$
]]
;
then
matches+
=(
"
$regexp
"
)
((
count++
))
fi
done
set
+f
if
[[
$count
==
0
]]
;
then
return
1
elif
[[
$count
==
1
]]
;
then
return
0
else
echo
"File
$1
matches multiple groups patterns, check your groups file"
echo
"Patterns:
${
matches
[@]
}
"
return
0
fi
}
load_regexps
$pkg
while
read
-r
filename
do
if
check_regexps
"
$filename
"
;
then
rm
-f
"
$filename
"
fi
done
<<<
$(
find /
-type
f
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment