From a8a60925b892e1972ebfe06d5129d07bc436487c Mon Sep 17 00:00:00 2001 From: Enzo Arroyo Date: Sun, 26 Jun 2022 00:42:26 +0200 Subject: [PATCH] Se inicializa el *CHANGELOG* para un mejor seguimiento de los cambios --- CHANGELOG.md | 4 ++++ Jenkinsfile | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ tasks/main.yml | 1 + 3 files changed, 60 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 Jenkinsfile diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8deaf2d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +# 0.1.0 +* Se inicializa el *CHANGELOG* para un mejor seguimiento de los cambios +* Se activa el **update_cache** para cada vez que se haga la instalación de requerimientos +* Se actualiza el *Jenkinsfile* con la configuración adaptada para las nuevas librerías diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..63b6d98 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,55 @@ +// https://kb.novaordis.com/index.php/Jenkins_Credentials_Binding_Plugin#usernamePassword + +@Library("mainEnzzito@development") _ + +pipeline { + agent any + + parameters { + choice(name: 'gitlab_branch', choices: ['development', 'master'], description: 'Branch name') + string(name: 'check_paths', defaultValue: '/tasks/, /tests/', description: 'Paths where you want to run yaml syntax check, ejem: path1, path2', trim: true) + } + + environment { + gitlab_token = credentials('jenkins_gitlab_token_oauth') + python_jail = "/opt/pyenv/p3/ansible29/bin/activate" + container_name = "${BUILD_TAG}_${gitlab_branch}" + repository_name = "lvols" + } + + stages { + stage('syntax_check') { + steps { + echo 'Notify GitLab' + updateGitlabCommitStatus name: 'syntax_check', state: 'pending' + + script { + linterActions.yamllintCheck(paths: "${check_paths}") + } + } + + post { + success { + echo 'syntax_check step completed' + updateGitlabCommitStatus name: 'syntax_check', state: 'success' + } + failure { + echo 'syntax_check step failed' + updateGitlabCommitStatus name: 'syntax_check', state: 'failed' + } + } + } + } + + post { + always { + cleanWs() + } + + success { + script { + createMergeRequest(source: "${gitlab_branch}", host: "${GIT_URL}", token: '${gitlab_token_PSW}') + } + } + } +} diff --git a/tasks/main.yml b/tasks/main.yml index 418c586..5aa5141 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,7 @@ apt: name: "{{ requiredpackages }}" state: "latest" + update_cache: true when: (requiredpackages is defined and requiredpackages | length > 0) and (ansible_os_family == "Debian") - name: users | Installing required packages -- GitLab