Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Docker Manticore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
Docker Manticore
Commits
ce050730
Commit
ce050730
authored
Feb 04, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first
parent
efed4e3e
Pipeline
#9219
canceled with stages
in 30 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
174 additions
and
0 deletions
+174
-0
.gitlab-ci.yml
.gitlab-ci.yml
+65
-0
Dockerfile
Dockerfile
+10
-0
docker-entrypoint.sh
docker-entrypoint.sh
+97
-0
reindex.cron
reindex.cron
+2
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
ce050730
stages
:
-
build
-
combine
-
deploy
variables
:
GIT_DEPTH
:
"
1"
CONTAINER_TEST_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_TEST_ARM_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
CONTAINER_TEST_X86_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
CONTAINER_RELEASE_IMAGE
:
$CI_REGISTRY_IMAGE:latest
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build-x86
:
stage
:
build
tags
:
-
docker
script
:
-
TARGET_IMAGE=$CONTAINER_TEST_X86_IMAGE
-
docker build --pull -t $TARGET_IMAGE .
-
docker push $TARGET_IMAGE
build-arm
:
stage
:
build
tags
:
-
docker-arm
script
:
-
TARGET_IMAGE=$CONTAINER_TEST_ARM_IMAGE
-
docker build --pull -t $TARGET_IMAGE .
-
docker push $TARGET_IMAGE
combine
:
stage
:
combine
tags
:
-
docker
script
:
-
TARGET_IMAGE=$CONTAINER_TEST_IMAGE
-
SOURCE_IMAGE_2=$CONTAINER_TEST_ARM_IMAGE
-
SOURCE_IMAGE_1=$CONTAINER_TEST_X86_IMAGE
-
docker pull $SOURCE_IMAGE_1
-
docker pull $SOURCE_IMAGE_2
-
docker manifest create $TARGET_IMAGE --amend $SOURCE_IMAGE_1 --amend
$SOURCE_IMAGE_2
-
docker manifest push $TARGET_IMAGE
deploy_latest
:
stage
:
deploy
tags
:
-
docker
script
:
-
TARGET_IMAGE=$CONTAINER_RELEASE_IMAGE
-
SOURCE_IMAGE=$CONTAINER_TEST_IMAGE
-
docker pull $SOURCE_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE
-
docker push $TARGET_IMAGE
only
:
-
master
deploy_tag
:
stage
:
deploy
tags
:
-
docker
script
:
-
TARGET_IMAGE=$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
-
SOURCE_IMAGE=$CONTAINER_TEST_IMAGE
-
docker pull $SOURCE_IMAGE
-
docker tag $SOURCE_IMAGE $TARGET_IMAGE
-
docker push $TARGET_IMAGE
only
:
-
tags
Dockerfile
0 → 100644
View file @
ce050730
FROM
manticoresearch/manticore:latest
RUN
set
-x
\
&&
apt-get update
&&
apt-get
install
-y
--no-install-recommends
util-linux cron
&&
rm
-rf
/var/lib/apt/lists/
*
COPY
./docker-entrypoint.sh /usr/local/bin/
COPY
./reindex.cron /etc/cron.d/reindex.cron
ENV
CHECKING_FILE=threads.spm
RUN
crontab /etc/cron.d/reindex.cron
docker-entrypoint.sh
0 → 100755
View file @
ce050730
#!/bin/bash
set
-eo
pipefail
# check to see if this file is being run or sourced from another script
_is_sourced
()
{
# https://unix.stackexchange.com/a/215279
[
"
${#
FUNCNAME
[@]
}
"
-ge
2
]
&&
[
"
${
FUNCNAME
[0]
}
"
=
'_is_sourced'
]
&&
[
"
${
FUNCNAME
[1]
}
"
=
'source'
]
}
_searchd_want_help
()
{
local
arg
for
arg
;
do
case
"
$arg
"
in
-
'?'
|
--help
|
-h
|
-v
)
return
0
;;
esac
done
return
1
}
docker_setup_env
()
{
if
[
-n
"
$QUERY_LOG_TO_STDOUT
"
]
;
then
ln
-sf
/dev/stdout /var/log/manticore/query.log
fi
}
_main
()
{
# first arg is `h` or some `--option`
if
[
"
${
1
#-
}
"
!=
"
$1
"
]
;
then
set
--
searchd
"
$@
"
fi
if
[
"
$1
"
=
'searchd'
]
&&
!
_searchd_want_help
"@"
;
then
docker_setup_env
"
$@
"
# allow the container to be started with `--user`
if
[
"
$(
id
-u
)
"
=
'0'
]
;
then
find /var/lib/manticore /var/log/manticore /var/run/manticore /etc/manticoresearch
\!
-user
manticore
-exec
chown
manticore
'{}'
+
exec
gosu manticore
"
$0
"
"
$@
"
fi
fi
_replace_conf_from_env
exec
"
$@
"
}
_replace_conf_from_env
()
{
sed_query
=
""
while
IFS
=
'='
read
-r
oldname value
;
do
if
[[
$oldname
==
'searchd_'
*
||
$oldname
==
'common_'
*
]]
;
then
value
=
$(
echo
${
!oldname
}
|
sed
's/\//\\\//g'
)
oldname
=
$(
echo
$oldname
|
sed
"s/searchd_//g;s/common_//g;"
)
newname
=
$oldname
if
[[
$newname
==
'listen'
]]
;
then
oldname
=
"listen_env"
IFS
=
'|'
read
-ra
ADDR
<<<
"
$value
"
count
=
0
for
i
in
"
${
ADDR
[@]
}
"
;
do
if
[[
$count
==
0
]]
;
then
value
=
$i
else
value
=
"
$value
\n
listen =
$i
"
fi
count
=
$((
count
+
1
))
done
fi
if
[[
-z
$sed_query
]]
;
then
sed_query
=
"s/(#
\s
)*?
$oldname
\s
?=
\s
?.*?
$/$newname
=
$value
/g"
else
sed_query
=
"
$sed_query
;s/(#
\s
)*?
$oldname
\s
?=
\s
?.*?
$/$newname
=
$value
/g"
fi
fi
done
< <
(
env
)
if
[[
!
-z
$sed_query
]]
;
then
sed
-i
-E
"
$sed_query
"
/etc/manticoresearch/manticore.conf
fi
}
_check_index_all
()
{
if
[[
!
-f
"/var/lib/manticore/
$CHECKING_FILE
"
]]
;
then
echo
"Indexing all..."
gosu manticore indexer
--all
fi
}
# If we are sourced from elsewhere, don't perform any further actions
if
!
_is_sourced
;
then
_check_index_all
rm
-rf
/tmp/reindex.lock
cron
_main
"
$@
"
fi
reindex.cron
0 → 100644
View file @
ce050730
0 4 * * * /usr/bin/flock -xE 0 /tmp/reindex.lock /usr/local/bin/gosu manticore /usr/bin/indexer --rotate threads posts
* * * * * /usr/bin/flock -nxE 0 /tmp/reindex.lock /usr/local/bin/gosu manticore /usr/bin/indexer --rotate threads_minute posts_minute
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