diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c863ffbe..cf3b02e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: + - gen_git-log - build_project - - build_image + # - build_image cache: key: @@ -12,6 +13,17 @@ cache: before_script: - export UI_TAG=$(date +%Y%m%d%H%M%S) + +generate_git-log: + stage: gen_git-log + script: + - if (( `grep git-log.html ./public/index.html | wc -l` == 0 )); then sed -i '/
/ a 更新记录' ./public/index.html; echo "添加更新记录链接"; fi; + - echo "最近的100个提交记录" + - echo "" > ./public/git-log.html + - git log -100 --pretty=format:"%ad : %s" >> ./public/git-log.html + - echo "" >> ./public/git-log.html + - echo "处理 git-log.html 结束" + build_project: stage: build_project script: @@ -27,18 +39,18 @@ build_project: tags: - GN-XXG-Server -build_image: - stage: build_image - script: - - echo "docker build" - - sudo docker build -t dev_cn-ui:$UI_TAG . - - echo "docker tag" - - sudo docker tag dev_cn-ui:$UI_TAG 192.168.40.153:9080/cyber-narrator/dev_cn-ui:$UI_TAG - - echo "docker push" - - sudo docker push 192.168.40.153:9080/cyber-narrator/dev_cn-ui:$UI_TAG - when: on_success - only: - - dev-cicd - tags: - - GN-XXG-Server +#build_image: + #stage: build_image + #script: + # - echo "docker build" + # - sudo docker build -t dev_cn-ui:$UI_TAG . + # - echo "docker tag" + #- sudo docker tag dev_cn-ui:$UI_TAG 192.168.40.153:9080/cyber-narrator/dev_cn-ui:$UI_TAG + #- echo "docker push" + # - sudo docker push 192.168.40.153:9080/cyber-narrator/dev_cn-ui:$UI_TAG + #when: on_success + #only: + # - dev-cicd + # tags: + # - GN-XXG-Server