This GitLab CI configuration is valid. Learn more
.gitlab-ci.yml 2.42 KiB
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
stages:
    - build
    - testing
    - packaging
variables:
    DOCKER_DRIVER: overlay2
    DOCKER_VERSION: 19.03.0
build-application:
    stage: build
    tags:
        - my-shell-runner
    script:
        - echo "Compiling the code..."
        - pwd
        - echo "Compile complete."
lint-testing:   
    stage: testing    
    tags:
        - my-shell-runner
    script:
        - echo "Linting code... This will take about 10 seconds."
unit-testing:   
    stage: testing
    only:
        - master
        - develop
        - merge_requests
    needs:
        - lint-testing
    tags:
        - my-shell-runner
    script:
        - echo "Running unit tests... This will take about 60 seconds."
# build-image-job:
#     stage: packaging
#     only:
#         - master
#         - develop
#     tags:
#         - my-shell-runner
#     script:
#         - ls
#         - echo "Building image..."
#         - docker login -u $DOCKER_LOGIN -p $DOCKER_PWD
#         - docker build -f ./docker/Dockerfile -t docker.io/mrk3ks/myapp:$CI_COMMIT_BRANCH .
#         - docker push docker.io/mrk3ks/myapp:$CI_COMMIT_BRANCH
build-image-job:
    stage: packaging
71727374757677787980818283848586
image: docker:$DOCKER_VERSION services: - docker:$DOCKER_VERSION-dind only: - master - develop tags: - docker variables: DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" before_script: - docker info script: - docker build -f ./docker/Dockerfile -t docker.io/mrk3ks/myapp:$CI_COMMIT_BRANCH . - docker push docker.io/mrk3ks/myapp:$CI_COMMIT_BRANCH