diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index b8e556a..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) Rolando Santamaria Maso - All Rights Reserved -# -# Unauthorized copying of this file, via any medium is strictly prohibited -# Proprietary and confidential -# -# Written by Rolando Santamaria Maso , December 2022 -# - -stages: - - test - - build - - deploy - - deploy-production - -before_script: - - export BASE_HELM=helm - - unset LC_ALL && export LANG=en_US.UTF-8 && export LC_ALL=en_US.UTF-8 - - export IMAGE=$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG - - export VERSION=${CI_COMMIT_SHA:0:8} - - - export CHART_NAME=$CI_PROJECT_NAME - - export CHART_VERSION=1.0.0-1${CI_COMMIT_SHA:0:8} - - - sed -i -e "s|{{ .Chart.Name }}|$CHART_NAME|g" $BASE_HELM/Chart.yaml - - sed -i -e "s|{{ .Chart.Version }}|$CHART_VERSION|g" $BASE_HELM/Chart.yaml - -variables: - DOCKER_HOST: tcp://localhost:2375 - -lint-and-test: - variables: - KUBERNETES_CPU_LIMIT: 2 - KUBERNETES_MEMORY_LIMIT: 4Gi - stage: test - image: node:18 - script: - - apt-get update - - apt-get install openssl - - mkdir -p keys - - npm ci - - npx standard - - npm run test - -build: - stage: build - image: docker:latest - services: - - docker:18.09-dind - only: - - main - script: - # sanitize docker container before building - - echo "helm" >> .dockerignore - - echo ".env" >> .dockerignore - - # build - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - - docker pull $IMAGE:latest || true - - docker build --pull --cache-from $IMAGE:latest -t $IMAGE:$VERSION -t $IMAGE:latest . - - docker push $IMAGE:$VERSION - - docker push $IMAGE:latest - -development: - variables: - NAMESPACE: development - stage: deploy - image: dtzar/helm-kubectl:3.9.0 - script: - - sed -i -e "s|{{ .Docker.Image }}|$IMAGE:$VERSION|g" $BASE_HELM/values-$NAMESPACE.yaml - - helm repo add stable https://charts.helm.sh/stable - - helm repo update - - helm upgrade --install --version $CHART_VERSION --force --atomic --debug -f ./$BASE_HELM/values-$NAMESPACE.yaml --namespace $NAMESPACE $CI_PROJECT_NAME ./$BASE_HELM - environment: - name: development - only: - - main - -production: - variables: - NAMESPACE: production - stage: deploy-production - image: dtzar/helm-kubectl:3.9.0 - script: - - sed -i -e "s|{{ .Docker.Image }}|$IMAGE:$VERSION|g" $BASE_HELM/values-$NAMESPACE.yaml - - helm repo add stable https://charts.helm.sh/stable - - helm repo update - - helm upgrade --install --version $CHART_VERSION --force --atomic --debug -f ./$BASE_HELM/values-$NAMESPACE.yaml --namespace $NAMESPACE $CI_PROJECT_NAME ./$BASE_HELM - environment: - name: production - when: manual - only: - - main