# 自定义阶段 stages: # - create # 定版,推送信息到运维系统 - build # 打包,将工程打包成jar或npm - test # 测试,对工程进行自动化测试 - push # 发布,将工程打包为镜像并推送到镜像仓库 before_script: # - wget "http://ci.cdyfsz.com/npm_tag.sh" # 获取CI执行脚本->创建版本tag # - chmod +x ./npm_tag.sh # 赋予执行权限 - wget "http://ci.cdyfsz.com/npm_build.sh" #获取CI执行脚本->推送docker iamge 到阿里云镜像仓库 - chmod +x ./npm_build.sh # 赋予执行权限 - wget "http://ci.cdyfsz.com/npm_docker.sh" #获取CI执行脚本->推送docker iamge 到阿里云镜像仓库 - chmod +x ./npm_docker.sh # 赋予执行权限 - export # # 创建版本tag # create_tag: # stage: create # script: # - ./npm_tag.sh # # - cat npm_tag.sh # only: # - 0.2.7 # tags: # - gitlab # nodejs打包并将dist文件放在共享空间 npm_build: image: registry.cn-shenzhen.aliyuncs.com/yfsz-test/yfsz-vue stage: build script: - ./npm_build.sh cache: # key: $CI_PROJECT_NAME-$CI_BUILD_REF_NAME key: ${CI_JOB_NAME} paths: - node_modules/ when: manual # when: on_success allow_failure: false artifacts: paths: - dist/ only: - dev tags: - gitlab #制作镜像包并推送到镜像仓库 docker_build_and_push: image: registry.cn-shenzhen.aliyuncs.com/yfsz-test/yfsz-docker stage: push script: - ./npm_docker.sh artifacts: paths: - dist/ when: on_success only: - dev tags: - gitlab