mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-27 05:52:29 +08:00
feat: add test file
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
c9da2b0744
commit
2849b85f89
@ -4,7 +4,7 @@
|
|||||||
.dockerignore
|
.dockerignore
|
||||||
|
|
||||||
# Ignore build artifacts
|
# Ignore build artifacts
|
||||||
_output/
|
# _output/
|
||||||
logs/
|
logs/
|
||||||
|
|
||||||
# Ignore non-essential documentation
|
# Ignore non-essential documentation
|
||||||
|
|||||||
2
.env
2
.env
@ -15,5 +15,5 @@
|
|||||||
USER=root
|
USER=root
|
||||||
PASSWORD=openIM123
|
PASSWORD=openIM123
|
||||||
MINIO_ENDPOINT=http://127.0.0.1:10005
|
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
|
DATA_DIR=/root/workspaces/openim/openim-server
|
||||||
|
|||||||
@ -46,4 +46,8 @@ ENV PORT 10002
|
|||||||
|
|
||||||
EXPOSE ${PORT}
|
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"]
|
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_VERBOSE=4
|
||||||
|
|
||||||
|
openim::log::info "\n# Begin to check all openim service"
|
||||||
|
|
||||||
# OpenIM status
|
# OpenIM status
|
||||||
# Elegant printing function
|
# Elegant printing function
|
||||||
print_services_and_ports() {
|
print_services_and_ports() {
|
||||||
@ -55,7 +57,7 @@ print_services_and_ports OPENIM_DEPENDENCY_TARGETS OPENIM_DEPENDENCY_PORT_TARGET
|
|||||||
|
|
||||||
# OpenIM check
|
# OpenIM check
|
||||||
echo "++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
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[@]}"
|
echo "+++ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}"
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
@ -69,10 +71,10 @@ else
|
|||||||
fi
|
fi
|
||||||
set -e
|
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
|
. $(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[@]}"
|
echo "+++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
||||||
openim::util::check_ports ${OPENIM_SERVER_PORT_LISTARIES[@]}
|
openim::util::check_ports ${OPENIM_SERVER_PORT_LISTARIES[@]}
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
|
|||||||
@ -24,6 +24,8 @@ set -o pipefail
|
|||||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||||
|
|
||||||
|
openim::log::info "\n# Use Docker to start all openim service"
|
||||||
|
|
||||||
trap 'openim::util::onCtrlC' INT
|
trap 'openim::util::onCtrlC' INT
|
||||||
|
|
||||||
"${OPENIM_ROOT}"/scripts/start-all.sh
|
"${OPENIM_ROOT}"/scripts/start-all.sh
|
||||||
|
|||||||
@ -22,6 +22,8 @@ set -o pipefail
|
|||||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P)
|
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P)
|
||||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||||
|
|
||||||
|
openim::log::info "\n# Begin Install OpenIM Config"
|
||||||
|
|
||||||
for file in "${OPENIM_SERVER_TARGETS[@]}"; do
|
for file in "${OPENIM_SERVER_TARGETS[@]}"; do
|
||||||
VARNAME="$(echo $file | tr '[:lower:]' '[:upper:]' | tr '.' '_' | tr '-' '_')"
|
VARNAME="$(echo $file | tr '[:lower:]' '[:upper:]' | tr '.' '_' | tr '-' '_')"
|
||||||
VARVALUE="$OPENIM_OUTPUT_HOSTBIN/$file"
|
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() {
|
openim::tools::post_start_name() {
|
||||||
local targets=(
|
local targets=(
|
||||||
infra
|
infra
|
||||||
|
versionchecker
|
||||||
)
|
)
|
||||||
echo "${targets[@]}"
|
echo "${targets[@]}"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -289,7 +289,7 @@ openim::util::check_ports() {
|
|||||||
|
|
||||||
# Print information about ports whose processes are not running.
|
# Print information about ports whose processes are not running.
|
||||||
if [[ ${#not_started[@]} -ne 0 ]]; then
|
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
|
for port in "${not_started[@]}"; do
|
||||||
openim::log::error "Port $port is not started."
|
openim::log::error "Port $port is not started."
|
||||||
done
|
done
|
||||||
@ -297,7 +297,7 @@ openim::util::check_ports() {
|
|||||||
|
|
||||||
# Print information about ports whose processes are running.
|
# Print information about ports whose processes are running.
|
||||||
if [[ ${#started[@]} -ne 0 ]]; then
|
if [[ ${#started[@]} -ne 0 ]]; then
|
||||||
openim::log::info "### Started ports:"
|
openim::log::info "\n### Started ports:"
|
||||||
for info in "${started[@]}"; do
|
for info in "${started[@]}"; do
|
||||||
openim::log::info "$info"
|
openim::log::info "$info"
|
||||||
done
|
done
|
||||||
|
|||||||
@ -22,6 +22,8 @@ set -o pipefail
|
|||||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||||
|
|
||||||
|
openim::log::info "\n# Begin to start all openim service scripts"
|
||||||
|
|
||||||
set +o errexit
|
set +o errexit
|
||||||
openim::golang::check_openim_binaries
|
openim::golang::check_openim_binaries
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
@ -68,10 +70,14 @@ function execute_scripts() {
|
|||||||
|
|
||||||
# TODO Prelaunch tools, simple for now, can abstract functions later
|
# TODO Prelaunch tools, simple for now, can abstract functions later
|
||||||
TOOLS_START_SCRIPTS_PATH=${START_SCRIPTS_PATH}/openim-tools.sh
|
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
|
${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start
|
||||||
|
|
||||||
|
openim::log::info "\n## Starting OpenIM services"
|
||||||
execute_scripts
|
execute_scripts
|
||||||
|
|
||||||
|
openim::log::info "\n## Post Starting OpenIM services"
|
||||||
${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
||||||
|
|
||||||
openim::log::success "✨ All OpenIM services have been successfully started!"
|
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"
|
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[@]}"
|
echo "++ Ready to stop port: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
||||||
|
|
||||||
openim::util::stop_services_on_ports ${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