From 782e7900f8ac4493c04ed389e8598b74332a749b Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 6 Feb 2019 17:00:08 +0100 Subject: [PATCH] Adding .gitlab-ci.yml --- .gitlab-ci.yml | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ad1b2f9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,72 @@ +--- + +stages: + - test + - linter + - deploy + +variables: + FLAKE8_MAX_LINE_LENGTH: 99 + FLAKE8_MAX_COMPLEXITY: 20 + FLAKE8_IGNORE_ERRORS: 'E226,E302,E41,E402' + +.template_job: &job_definition + before_script: + - rm -rf venv + - virtualenv --python=python3.6 venv + - source venv/bin/activate + - pip install --upgrade pip + - pip install --upgrade --upgrade-strategy eager --requirement python_fb_tools/requirements.txt + - pip install --upgrade --upgrade-strategy eager --requirement requirements.txt + - cd python_fb_tools && ./compile-xlate-msgs.sh; cd .. + tags: + - deploy + after_script: + - deactivate + +Test source: + <<: *job_definition + stage: test + script: + - hostname -f + - whoami + - pwd + - bin/create-vmware-template --version + environment: + name: test + except: + - /^dev-.*$/ + - /^dev\/.*$/ + - /^hf.*$/ + - tags + +Linter: + <<: *job_definition + stage: linter + script: + - pip install --upgrade --upgrade-strategy eager flake8 pylint + - flake8 --max-line-length=$FLAKE8_MAX_LINE_LENGTH --max-complexity=$FLAKE8_MAX_COMPLEXITY --ignore=$FLAKE8_IGNORE_ERRORS bin lib + environment: + name: test + except: + - /^dev-.*$/ + - /^dev\/.*$/ + - /^hf.*$/ + - tags + +Deploy OEL7 template image: + <<: *job_definition + stage: deploy + script: + - hostname -f + - whoami + - pwd + - bin/create-vmware-template --help + environment: + name: production + except: + - /^dev-.*$/ + - /^dev\/.*$/ + - /^hf.*$/ + - tags + -- 2.39.5