--- /dev/null
+---
+
+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
+