]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding .gitlab-ci.yml
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Feb 2019 16:00:08 +0000 (17:00 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 6 Feb 2019 16:00:08 +0000 (17:00 +0100)
.gitlab-ci.yml [new file with mode: 0644]

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..ad1b2f9
--- /dev/null
@@ -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
+