From 50b7072c783eca44e683545dcb485ab7c50f95a4 Mon Sep 17 00:00:00 2001 From: Rosiney Gomes Pereira Date: Mon, 17 Feb 2020 22:00:32 -0300 Subject: [PATCH] chore: remove generator for mkdkr (#75) - simplify docker image --- Dockerfile | 13 ++----------- Makefile | 7 ------- generator/gitlab-ci | 21 --------------------- generator/templates/.gitlab-ci.yml.j2 | 27 --------------------------- 4 files changed, 2 insertions(+), 66 deletions(-) delete mode 100755 generator/gitlab-ci delete mode 100644 generator/templates/.gitlab-ci.yml.j2 diff --git a/Dockerfile b/Dockerfile index 5461952..ea07673 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,3 @@ -# this dockerfile is an example -FROM python:3.6-alpine +FROM alpine:3 -RUN pip install jinja2-cli[yaml] \ - && apk --no-cache add bash \ - && rm -rf /var/cache/apk/* - -COPY generator /generator - -WORKDIR /generator - -RUN ln -sf /generator/gitlab-ci /usr/local/bin/ \ No newline at end of file +RUN echo "just a test" \ No newline at end of file diff --git a/Makefile b/Makefile index b62ffd2..f84449c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ shellcheck: @$(.) ... koalaman/shellcheck-alpine:v0.4.6 .. shellcheck -e SC1088 -e SC2068 -e SC2086 .mkdkr - .. shellcheck generator/gitlab-ci .. shellcheck -e SC2181 test/unit_job_name .. shellcheck -e SC2181 -e SC2086 test/unit_create_instance .. shellcheck -e SC2181 -e SC2086 -e SC1091 test/unit_branch_or_tag_name @@ -79,12 +78,6 @@ brainfuck: .. apk add make bash .. make pipeline -generator/gitlab: - @$(.) - ... rosineygp/mkdkr - .. gitlab-ci lint=shellcheck \ - scenarios=small,service,dind > .gitlab-ci.yml - pipeline: make --silent commitlint make --silent shellcheck diff --git a/generator/gitlab-ci b/generator/gitlab-ci deleted file mode 100755 index 5f40aee..0000000 --- a/generator/gitlab-ci +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -#Generate yaml data file for jinja template - -DATA_FILE_TMP="/tmp/generator_gitlab_$(date +%Y%m%d%H%M%S).yml" -echo "jobs:" > "$DATA_FILE_TMP" - -PARAMS=("${@:1}") -for PARAM in "${PARAMS[@]}"; do - - STAGE=$(echo "${PARAM}" | cut -d"=" -f1 ) - JOBS=($(echo "${PARAM}" | sed 's/^.*\=//g;s/\ /_/g;s/,/\ /g')) - - for JOB in "${JOBS[@]}"; do - echo " - name: ${JOB}" >> "$DATA_FILE_TMP" - echo " stage: ${STAGE}" >> "$DATA_FILE_TMP" - done - -done - -jinja2 --format=yml /generator/templates/.gitlab-ci.yml.j2 "$DATA_FILE_TMP" \ No newline at end of file diff --git a/generator/templates/.gitlab-ci.yml.j2 b/generator/templates/.gitlab-ci.yml.j2 deleted file mode 100644 index bf4c2ab..0000000 --- a/generator/templates/.gitlab-ci.yml.j2 +++ /dev/null @@ -1,27 +0,0 @@ -# pipeline autogenerated by mkdkr -# https://gitlab.com/rosiney.gp/mkdkr - -stages: - {%- for stage in jobs|map(attribute='stage')|unique|list %} - - {{ stage }} - {%- endfor %} - -services: - - docker:19.03.1-dind - -variables: - DOCKER_HOST: tcp://docker:2376 - DOCKER_TLS_CERTDIR: "/certs" - -image: docker:19 - -before_script: - - apk add make - - apk add bash - -{% for job in jobs %} -{{ job.name }}: - stage: {{ job.stage | escape }} - script: - - make {{ job.name }} -{% endfor %} \ No newline at end of file