﻿{"id":882,"date":"2022-12-02T17:20:14","date_gmt":"2022-12-02T09:20:14","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=882"},"modified":"2022-12-07T15:53:43","modified_gmt":"2022-12-07T07:53:43","slug":"%e4%b8%80%e4%b8%aa%e6%9c%80%e5%9f%ba%e7%a1%80%e7%9a%84gitlab%e8%87%aa%e5%8a%a8%e7%bc%96%e8%af%91vue%e9%a1%b9%e7%9b%ae%e5%b9%b6%e5%8f%91%e5%b8%83%e5%88%b0docker%e7%9a%84ci%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=882","title":{"rendered":"\u4e00\u4e2a\u6700\u57fa\u7840\u7684gitlab\u81ea\u52a8\u7f16\u8bd1vue\u9879\u76ee\u5e76\u53d1\u5e03\u5230docker\u7684ci\u914d\u7f6e"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># This file is a template, and might need editing before it works on your project.\n# This is a sample GitLab CI\/CD configuration file that should run without any modifications.\n# It demonstrates a basic 3 stage CI\/CD pipeline. Instead of real tests or scripts,\n# it uses echo commands to simulate the pipeline execution.\n#\n# A pipeline is composed of independent jobs that run scripts, grouped into stages.\n# Stages run in sequential order, but jobs within stages run in parallel.\n#\n# For more information, see: https:\/\/docs.gitlab.com\/ee\/ci\/yaml\/index.html#stages\n#\n# You can copy and paste this template into a new `.gitlab-ci.yml` file.\n# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.\n#\n# To contribute improvements to CI\/CD templates, please follow the Development guide at:\n# https:\/\/docs.gitlab.com\/ee\/development\/cicd\/templates.html\n# This specific template is located at:\n# https:\/\/gitlab.com\/gitlab-org\/gitlab\/-\/blob\/master\/lib\/gitlab\/ci\/templates\/Getting-Started.gitlab-ci.yml\n\nstages:          # List of stages for jobs, and their order of execution.\n  - build\n#  - test\n  - deploy\n\nbuild-job:       # This job runs in the build stage, which runs first.\n  stage: build\n  script:\n    - echo \"Compiling the code...\"\n    - npm install\n    - npm run build\n    - docker build -t yuexi_admin .\n    - echo \"Compile complete.\"\n\n#unit-test-job:   # This job runs in the test stage.\n#  stage: test    # It only starts when the job in the build stage completes successfully.\n#  script:\n#    - echo \"Running unit tests... This will take about 60 seconds.\"\n#    - sleep 60\n#    - echo \"Code coverage is 90%\"\n\n#lint-test-job:   # This job also runs in the test stage.\n#  stage: test    # It can run at the same time as unit-test-job (in parallel).\n#  script:\n#    - echo \"Linting code... This will take about 10 seconds.\"\n#    - sleep 10\n#    - echo \"No lint issues found.\"\n\ndeploy-job:      # This job runs in the deploy stage.\n  stage: deploy  # It only runs when *both* jobs in the test stage complete successfully.\n  environment: production\n  script:\n    - echo \"Deploying application...\"\n    - docker stop yuexi_admin\n    - docker rm yuexi_admin\n    - docker run -d -p 8611:80 --name yuexi_admin yuexi_admin\n    - echo \"Application successfully deployed.\"<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-882","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=882"}],"version-history":[{"count":3,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/882\/revisions"}],"predecessor-version":[{"id":900,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/882\/revisions\/900"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=882"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}