From 2408f1d437bf96b841a87e957b8c7a5ed28801a8 Mon Sep 17 00:00:00 2001 From: Quintush <2246480+quintush@users.noreply.github.com> Date: Mon, 31 Aug 2020 20:46:03 +0200 Subject: [PATCH] Update docker deployment and versioning order, newest version will be deployed as last. --- .circleci/config.yml | 2 +- Makefile | 4 ++++ docker-build.sh | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82c137569..0613b660f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ jobs: - setup_remote_docker - run: name: Build and push docker images - command: docker-build.sh + command: make dockerdist orbs: sonarcloud: sonarsource/sonarcloud@1.0.1 diff --git a/Makefile b/Makefile index 5ead66dc1..583ed5c1b 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,10 @@ dist: .PHONY: bootstrap bootstrap: +.PHONY: dockerdist +dockerdist: + ./docker-build.sh + .PHONY: dockerimage dockerimage: docker build -t $(DOCKER):$(VERSION) . diff --git a/docker-build.sh b/docker-build.sh index e366cc199..96d906301 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -40,11 +40,11 @@ helmRepo="helm/helm" pluginRepo="quintush/helm-unittest" if [[ ${CI} == 'true' ]]; then - helmLatest=`curl -sL -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/${helmRepo}/tags?per_page=50 |jq -r ".[].name"|sort -Vr|sed 's/^v//'` - pluginLatest=`curl -sL -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/${pluginRepo}/tags?per_page=2 |jq -r ".[].name"|sort -Vr|sed 's/^v//'` + helmLatest=`curl -sL -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/${helmRepo}/tags?per_page=50 |jq -r ".[].name"|sed 's/^v//'|sort -V |grep -v -` + pluginLatest=`curl -sL -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/${pluginRepo}/tags?per_page=2 |jq -r ".[].name"|sed 's/^v//'|sort -V |grep -v -` else - helmLatest=`curl -sL https://api.github.com/repos/${helmRepo}/tags?per_page=50 |jq -r ".[].name"|sort -Vr|sed 's/^v//'|grep -v -` - pluginLatest=`curl -sL https://api.github.com/repos/${pluginRepo}/tags?per_page=2 |jq -r ".[].name"|sort -Vr|sed 's/^v//'|grep -v -` + helmLatest=`curl -sL https://api.github.com/repos/${helmRepo}/tags?per_page=50 |jq -r ".[].name"| sed 's/^v//'| sort -V |grep -v -` + pluginLatest=`curl -sL https://api.github.com/repos/${pluginRepo}/tags?per_page=2 |jq -r ".[].name"| sed 's/^v//'| sort -V |grep -v -` fi for helmVersion in ${helmLatest}