Skip to content

Commit

Permalink
fix docker ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
xiagw committed Aug 1, 2023
1 parent dce4e99 commit 94630d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git/
.github/
.dockerignore
.gitattributes
.gitignore
.gitlab-ci.yml
data/
docs/
Dockerfile
README*
15 changes: 9 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1005,19 +1005,20 @@ _inject_files() {
done
copy_flyway_file=0
fi
## inject docker build files
if [ -d "${gitlab_project_dir}/root/opt" ]; then
_msg "found ${gitlab_project_dir}/root/opt"
else
rsync -a "${me_dockerfile}/root/" "$gitlab_project_dir/root/"
fi

## from deploy.env, 使用全局模板文件替换项目文件
echo ENV_ENABLE_INJECT: ${ENV_ENABLE_INJECT:-keep}
case ${ENV_ENABLE_INJECT:-keep} in
keep)
echo 'Keep Dockerfile in project.'
;;
overwrite)
## inject docker build files
if [ -d "${gitlab_project_dir}/root/opt" ]; then
_msg "found ${gitlab_project_dir}/root/opt"
else
rsync -a "${me_dockerfile}/root/" "$gitlab_project_dir/root/"
fi
## Dockerfile 优先查找 data/ 目录
if [[ -f "${me_data_dockerfile}/Dockerfile.${project_lang}" ]]; then
echo "Found ${me_data_dockerfile}/Dockerfile.${project_lang}, overwriting ${gitlab_project_dir}/Dockerfile"
Expand Down Expand Up @@ -1636,6 +1637,8 @@ main() {
[[ "${ENV_DISABLE_RSYNC:-0}" -eq 1 ]] && exec_deploy_rsync_ssh=0
[[ "${exec_deploy_rsync_ssh:-1}" -eq 1 ]] && _deploy_rsync_ssh

## clean

## function test / 功能测试
## 在 gitlab 的 pipeline 配置环境变量 PIPELINE_FUNCTION_TEST ,1 启用,0 禁用[default]
_msg step "[test] function test"
Expand Down

0 comments on commit 94630d1

Please sign in to comment.