zen_ntp/.gitlab-ci.yml
Chris Hammer c80a55fe7d 0.1.3-DEV-20210219-022129
-------------------------
    * ADD:
      - add support for centos 8

    * MODIFY:
      - update .gitlab-ci.yml so jobs will run on the correct ci host
2021-02-19 02:22:32 -05:00

88 lines
2.1 KiB
YAML

# CI Mark that build is executed in CI environment
# GITLAB_CI Mark that build is executed in GitLab CI environment
# CI_SERVER Mark that build is executed in CI environment
# CI_SERVER_NAME CI server that is used to coordinate builds
# CI_SERVER_VERSION Not yet defined
# CI_SERVER_REVISION Not yet defined
# CI_BUILD_REF The commit revision for which project is built
# CI_BUILD_BEFORE_SHA The first commit that were included in push request
# CI_BUILD_REF_NAME The branch or tag name for which project is built
# CI_BUILD_ID The unique id of the current build that GitLab CI uses internally
# CI_BUILD_REPO The URL to clone the Git repository
# CI_PROJECT_ID The unique id of the current project that GitLab CI uses internally
# CI_PROJECT_DIR The full path where the repository is cloned and where the build is ran
variables:
ANSIBLE_ROLE: "zen_ntp"
ANSIBLE_ROLE_PATH: "${CI_PROJECT_DIR}"
ANSIBLE_EXTRA_VARS: ""
stages:
- check_and_lint
- test_deploy
### BEGIN TEMPLATES ###
.tags_template: &tags_template
tags:
- zen-ci
.header_template: &header
variables:
DOCKER_IMG_TAG: "7.7.1908"
.check_versions_template: &check_vers
<<: *tags_template
stage: check_and_lint
only:
- development
script:
- /usr/bin/hostname
- "cd ${CI_PROJECT_DIR} && git log -1"
- "ansible --version"
- "ansible-lint --version"
.lint_play_template: &lint_play
<<: *tags_template
stage: check_and_lint
only:
- development
script:
- "ansible-lint -v ${ANSIBLE_ROLE_PATH}"
.test_deploy_template: &test_deploy
<<: *tags_template
stage: test_deploy
only:
- development
script:
- cp -av ${ANSIBLE_ROLE_PATH} /etc/ansible/roles/${ANSIBLE_ROLE}
- ansible-playbook -v --connection=local ${ANSIBLE_EXTRA_VARS} tests/test.yml
- cat /etc/ntp.conf
- ansible-playbook -v --connection=local ${ANSIBLE_EXTRA_VARS} tests/test.yml -e ntp_node_type=client
- cat /etc/ntp.conf
### END TEMPLATES ###
### BEGIN JOBS ###
Version Checks:
<<: *header
<<: *check_vers
Lint Play:
<<: *header
<<: *lint_play
Test Deploy:
<<: *header
<<: *test_deploy
### END JOBS ###