From 96eededc281642773d25e2996c8d137de45aaeaf Mon Sep 17 00:00:00 2001
From: Christophe Chaudier <devops@cchaudier.fr>
Date: Mon, 5 Nov 2018 16:57:25 +0100
Subject: [PATCH] =?UTF-8?q?=E2=99=BB(gitlab-ci)=20create=20template=20for?=
 =?UTF-8?q?=20standard=20stages?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitlab-ci.yml                         | 6 +-----
 gci-templates/ansible-lint.yml         | 2 +-
 gci-templates/ansible-syntax-check.yml | 2 +-
 gci-templates/stages.yml               | 5 +++++
 gci-templates/yaml-lint.yml            | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)
 create mode 100644 gci-templates/stages.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 00b1e5e..e102d11 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,8 +5,4 @@ include:
   - '/gci-templates/ansible-lint.yml'
   - '/gci-templates/yaml-lint.yml'
   - '/gci-templates/ansible-syntax-check.yml'
-
-stages:
-  - yaml-lint
-  - ansible-lint
-  - ansible-syntax-check
+  - '/gci-templates/stages.yml'
diff --git a/gci-templates/ansible-lint.yml b/gci-templates/ansible-lint.yml
index 5fc66a2..aa281a9 100644
--- a/gci-templates/ansible-lint.yml
+++ b/gci-templates/ansible-lint.yml
@@ -1,5 +1,5 @@
 ansible-lint:
   image: yokogawa/ansible-lint
-  stage: ansible-lint
+  stage: lint
   script: >
     find . -name "*.yml" | xargs -r ansible-lint --force-color
diff --git a/gci-templates/ansible-syntax-check.yml b/gci-templates/ansible-syntax-check.yml
index ad10cf6..36a8147 100644
--- a/gci-templates/ansible-syntax-check.yml
+++ b/gci-templates/ansible-syntax-check.yml
@@ -1,5 +1,5 @@
 ansible-syntax-check:
   image: williamyeh/ansible:alpine3
-  stage: ansible-syntax-check
+  stage: lint
   script: >
     find test/ -name "*.yml" | xargs -r ansible-playbook --syntax-check
diff --git a/gci-templates/stages.yml b/gci-templates/stages.yml
new file mode 100644
index 0000000..49e8c4e
--- /dev/null
+++ b/gci-templates/stages.yml
@@ -0,0 +1,5 @@
+stages:
+  - build
+  - lint
+  - test
+  - deploy
diff --git a/gci-templates/yaml-lint.yml b/gci-templates/yaml-lint.yml
index cb28351..239a7dc 100644
--- a/gci-templates/yaml-lint.yml
+++ b/gci-templates/yaml-lint.yml
@@ -1,5 +1,5 @@
 yaml-lint:
   image: vpgrp/linter:yaml
-  stage: yaml-lint
+  stage: lint
   script: >
     find . -name "*.yml" | xargs -r yaml-lint
-- 
GitLab