.gitlab-ci.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # This file is a template, and might need editing before it works on your project.
  2. # To contribute improvements to CI/CD templates, please follow the Development guide at:
  3. # https://docs.gitlab.com/ee/development/cicd/templates.html
  4. # This specific template is located at:
  5. # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
  6. # This is a sample GitLab CI/CD configuration file that should run without any modifications.
  7. # It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
  8. # it uses echo commands to simulate the pipeline execution.
  9. #
  10. # A pipeline is composed of independent jobs that run scripts, grouped into stages.
  11. # Stages run in sequential order, but jobs within stages run in parallel.
  12. #
  13. # For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
  14. stages: # List of stages for jobs, and their order of execution
  15. - Test
  16. - Deploy
  17. Test-job: # This job runs in the deploy stage.
  18. stage: Test # It only runs when *both* jobs in the test stage complete successfully.
  19. script:
  20. - echo "Testing application..."
  21. - docker-compose up -d
  22. - echo "Application successfully Deployed."
  23. tags:
  24. - test
  25. only:
  26. - triggers
  27. Deploy-job:
  28. stage: Deploy
  29. script:
  30. - echo "Deploy application..."
  31. - docker-compose up -d
  32. - echo "Application successfully Deployed."
  33. only:
  34. - tags
  35. tags:
  36. - Deploy