Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
development:deploy:cicd [2020/02/27 14:14]
kalenpw created
development:deploy:cicd [2021/06/29 15:02] (current)
kalenpw
Line 1: Line 1:
 ====== CI/CD with GitLab ====== ====== CI/CD with GitLab ======
 +----
 +
   - create a ''.gitlab-ci.yml'' - I usually do this via web interface. An example is included below   - create a ''.gitlab-ci.yml'' - I usually do this via web interface. An example is included below
   - ''brew install gitlab-runner'' install gitlab runner - can usually be done via package manager on system   - ''brew install gitlab-runner'' install gitlab runner - can usually be done via package manager on system
Line 13: Line 15:
   * Notes   * Notes
     * Without configuring the runner it will create a ''build'' directory in project root so ensure that is added to .gitignore     * Without configuring the runner it will create a ''build'' directory in project root so ensure that is added to .gitignore
 +
 +<file yaml .gitlab-ci.yml>
 +  
 +deploy_stage:
 +    stage: deploy
 +    environment: Staging
 +    only:
 +        - development
 +    script:
 +        - rm -rf /Users/kwilliams/Documents/Development/
 +        - mkdir -p /Users/kwilliams/Documents/Development
 +        - ls > /Users/kwilliams/ls.txt
 +        - mv ./* /Users/kwilliams/Documents/Development
 +        
 +deploy_production:
 +    stage: deploy
 +    environment: Production
 +    only:
 +        - master
 +    script:
 +        - rm -rf /Users/kwilliams/Documents/Deployed
 +        - mkdir -p /Users/kwilliams/Documents/Deployed
 +        - mv ./* /Users/kwilliams/Documents/Deployed
 +</file>
 +----