------------------------- * MODIFY: - hosts change reverse_proxys -> all - .gitlab-ci.yml - runner change
87 lines
2.3 KiB
YAML
87 lines
2.3 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_PLAY: "deploy_proxy_sites.yml"
|
|
ANSIBLE_PLAY_PATH: "${CI_PROJECT_DIR}"
|
|
ANSIBLE_EXTRA_VARS: ""
|
|
|
|
|
|
stages:
|
|
- check_and_lint
|
|
- test_deploy
|
|
|
|
|
|
### BEGIN TEMPLATES ###
|
|
.tags_template: &tags_template
|
|
tags:
|
|
- zen-ci-deb
|
|
|
|
|
|
.zen_ci_deb_template: &zen_ci_deb_template
|
|
variables:
|
|
DOCKER_IMG_TAG: "latest"
|
|
|
|
|
|
.check_version_template: &check_version_template
|
|
<<: *tags_template
|
|
stage: check_and_lint
|
|
script:
|
|
- /bin/hostname
|
|
- chmod 755 ${ANSIBLE_PLAY_PATH}
|
|
- "cd ${ANSIBLE_PLAY_PATH} && git log -1"
|
|
- ansible --version
|
|
- ansible-lint --version
|
|
|
|
|
|
.lint_playbook_template: &lint_playbook_template
|
|
<<: *tags_template
|
|
stage: check_and_lint
|
|
script:
|
|
- chmod 755 ${ANSIBLE_PLAY_PATH}
|
|
- ansible-lint -v ${ANSIBLE_PLAY_PATH}/*.yml
|
|
|
|
|
|
.test_deploy_template: &test_deploy_template
|
|
<<: *tags_template
|
|
stage: test_deploy
|
|
script:
|
|
- chmod 755 ${ANSIBLE_PLAY_PATH}
|
|
- pwd
|
|
- ls -ltr
|
|
- ansible-galaxy install -r roles/requirements.yml
|
|
- ansible-playbook -v -i '127.0.0.1,' --connection=local ${ANSIBLE_EXTRA_VARS} ${ANSIBLE_PLAY}
|
|
- /bin/ls -l /etc/nginx/conf.d
|
|
- /bin/ls -l /etc/nginx/ssl/*
|
|
- /usr/sbin/nginx -c /etc/nginx/nginx.conf -t
|
|
### END TEMPLATES ###
|
|
|
|
|
|
### BEGIN JOBS ###
|
|
Check Versioning Info:
|
|
<<: *zen_ci_deb_template
|
|
<<: *check_version_template
|
|
|
|
|
|
Lint Playbook:
|
|
<<: *zen_ci_deb_template
|
|
<<: *lint_playbook_template
|
|
|
|
|
|
Test Deploy:
|
|
<<: *zen_ci_deb_template
|
|
<<: *test_deploy_template
|
|
### END JOBS ###
|