mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 05:02:11 +08:00
feat: add test file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
6db9e2c7a9
commit
3f2d771190
@ -4,7 +4,7 @@
|
||||
.dockerignore
|
||||
|
||||
# Ignore build artifacts
|
||||
_output/
|
||||
# _output/
|
||||
logs/
|
||||
|
||||
# Ignore non-essential documentation
|
||||
|
||||
2
.env
2
.env
@ -15,5 +15,5 @@
|
||||
USER=root
|
||||
PASSWORD=openIM123
|
||||
MINIO_ENDPOINT=http://127.0.0.1:10005
|
||||
API_URL=http://14.153.17.42:10002
|
||||
API_URL=http://\;\;\ communications\ error\ to\ 216.239.36.10#53:\ timed\ out14.153.17.42:10002
|
||||
DATA_DIR=/root/workspaces/openim/openim-server
|
||||
|
||||
@ -46,4 +46,8 @@ ENV PORT 10002
|
||||
|
||||
EXPOSE ${PORT}
|
||||
|
||||
RUN cp ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-api /usr/bin/openim-api
|
||||
|
||||
ENTRYPOINT ["/usr/bin/openim-api","-c" ${SERVER_WORKDIR}/config"]
|
||||
|
||||
CMD ["bash", "-c","${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-api --port ${PORT} -c ${SERVER_WORKDIR}/config"]
|
||||
8
build/images/openim-api/Dockerfile.release
Normal file
8
build/images/openim-api/Dockerfile.release
Normal file
@ -0,0 +1,8 @@
|
||||
FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
|
||||
COPY openim-api /usr/bin/
|
||||
|
||||
# nosemgrep: dockerfile.security.missing-user.missing-user
|
||||
ENTRYPOINT ["/usr/bin/openim-api"]
|
||||
# nosemgrep: dockerfile.security.missing-user.missing-user
|
||||
CMD ["--help"]
|
||||
@ -28,6 +28,8 @@ source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
|
||||
OPENIM_VERBOSE=4
|
||||
|
||||
openim::log::info "\n# Begin to check all openim service"
|
||||
|
||||
# OpenIM status
|
||||
# Elegant printing function
|
||||
print_services_and_ports() {
|
||||
@ -55,7 +57,7 @@ print_services_and_ports OPENIM_DEPENDENCY_TARGETS OPENIM_DEPENDENCY_PORT_TARGET
|
||||
|
||||
# OpenIM check
|
||||
echo "++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
||||
echo "## Check all dependent service ports"
|
||||
openim::log::info "\n## Check all dependent service ports"
|
||||
echo "+++ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}"
|
||||
|
||||
set +e
|
||||
@ -69,10 +71,10 @@ else
|
||||
fi
|
||||
set -e
|
||||
|
||||
echo -e "\n## Check OpenIM service name"
|
||||
openim::log::info "\n## Check OpenIM service name"
|
||||
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check
|
||||
|
||||
echo -e "\n## Check all OpenIM service ports"
|
||||
openim::log::info "\n## Check all OpenIM service ports"
|
||||
echo "+++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
||||
openim::util::check_ports ${OPENIM_SERVER_PORT_LISTARIES[@]}
|
||||
if [[ $? -ne 0 ]]; then
|
||||
|
||||
@ -24,6 +24,8 @@ set -o pipefail
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
|
||||
openim::log::info "\n# Use Docker to start all openim service"
|
||||
|
||||
trap 'openim::util::onCtrlC' INT
|
||||
|
||||
"${OPENIM_ROOT}"/scripts/start-all.sh
|
||||
|
||||
@ -22,6 +22,8 @@ set -o pipefail
|
||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P)
|
||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
|
||||
openim::log::info "\n# Begin Install OpenIM Config"
|
||||
|
||||
for file in "${OPENIM_SERVER_TARGETS[@]}"; do
|
||||
VARNAME="$(echo $file | tr '[:lower:]' '[:upper:]' | tr '.' '_' | tr '-' '_')"
|
||||
VARVALUE="$OPENIM_OUTPUT_HOSTBIN/$file"
|
||||
|
||||
@ -71,6 +71,7 @@ readonly OPENIM_TOOLS_PRE_START_NAME_LISTARIES=("${OPENIM_TOOLS_PRE_START_NAME_T
|
||||
openim::tools::post_start_name() {
|
||||
local targets=(
|
||||
infra
|
||||
versionchecker
|
||||
)
|
||||
echo "${targets[@]}"
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ openim::util::check_ports() {
|
||||
|
||||
# Print information about ports whose processes are not running.
|
||||
if [[ ${#not_started[@]} -ne 0 ]]; then
|
||||
openim::log::info "### Not started ports:"
|
||||
openim::log::info "\n### Not started ports:"
|
||||
for port in "${not_started[@]}"; do
|
||||
openim::log::error "Port $port is not started."
|
||||
done
|
||||
@ -297,7 +297,7 @@ openim::util::check_ports() {
|
||||
|
||||
# Print information about ports whose processes are running.
|
||||
if [[ ${#started[@]} -ne 0 ]]; then
|
||||
openim::log::info "### Started ports:"
|
||||
openim::log::info "\n### Started ports:"
|
||||
for info in "${started[@]}"; do
|
||||
openim::log::info "$info"
|
||||
done
|
||||
|
||||
@ -22,6 +22,8 @@ set -o pipefail
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
|
||||
openim::log::info "\n# Begin to start all openim service scripts"
|
||||
|
||||
set +o errexit
|
||||
openim::golang::check_openim_binaries
|
||||
if [[ $? -ne 0 ]]; then
|
||||
@ -68,10 +70,14 @@ function execute_scripts() {
|
||||
|
||||
# TODO Prelaunch tools, simple for now, can abstract functions later
|
||||
TOOLS_START_SCRIPTS_PATH=${START_SCRIPTS_PATH}/openim-tools.sh
|
||||
|
||||
openim::log::info "\n## Pre Starting OpenIM services"
|
||||
${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start
|
||||
|
||||
openim::log::info "\n## Starting OpenIM services"
|
||||
execute_scripts
|
||||
|
||||
openim::log::info "\n## Post Starting OpenIM services"
|
||||
${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
||||
|
||||
openim::log::success "✨ All OpenIM services have been successfully started!"
|
||||
@ -26,6 +26,8 @@ OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
|
||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
|
||||
openim::log::info "\n# Begin to stop all openim service"
|
||||
|
||||
echo "++ Ready to stop port: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
||||
|
||||
openim::util::stop_services_on_ports ${OPENIM_SERVER_PORT_LISTARIES[@]}
|
||||
|
||||
17
test.dockerfile
Normal file
17
test.dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
# FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
FROM ghcr.io/openim-sigs/openim-bash-image:latest
|
||||
|
||||
WORKDIR /openim/openim-server
|
||||
|
||||
COPY ./_output/bin/platforms /openim/openim-server/_output/bin/platforms
|
||||
COPY ./config /openim/openim-server/config
|
||||
|
||||
ENV PORT 10002
|
||||
|
||||
EXPOSE 10002
|
||||
|
||||
RUN cp -r ${OPENIM_SERVER_BINDIR}/platforms/$(get_os)/$(get_arch)/openim-api /usr/bin/openim-api
|
||||
|
||||
ENTRYPOINT ["/usr/bin/openim-api","-c","${SERVER_WORKDIR}/config"]
|
||||
|
||||
CMD ["--port 10002"]
|
||||
Loading…
x
Reference in New Issue
Block a user