shalb / cluster.dev

Cloud-native infrastructure templating. Creating cloud installers for SaaS. Replication of complex cloud-native infrastructures.
https://docs.cluster.dev/
GNU Affero General Public License v3.0
401 stars 36 forks source link

GitLab Support: Pipelines #50

Closed voatsap closed 4 years ago

voatsap commented 4 years ago

We need to create same workflow pipeline GitHub Action: https://github.com/voatsap/testrepo/blob/master/.github/workflows/main.yml in GitLab .gitlab-ci.yml That would pull and build cluster.dev repo.

To test - run AWS cluster with same manifest.

voatsap commented 4 years ago

.gitlab-ci.yml:

image: docker:19.03.0

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: "/certs"
  CLUSTER_DEV_BRANCH: "GitHub-dependency-removement"

services:
  - docker:19.03.0-dind

before_script:
  - apk update
  - apk upgrade
  - apk add --no-cache bash git

stages:
  - build_cluster-dev

build_cluster-dev:
  script:
    - git clone -b "$CLUSTER_DEV_BRANCH" https://github.com/shalb/cluster.dev.git
    - cd cluster.dev
    - docker build --no-cache -t "cluster.dev:${CLUSTER_DEV_BRANCH}" .
    - docker run --name cluster.dev-${CLUSTER_DEV_BRANCH} --workdir /gitlab/workspace --rm -e CI_PROJECT_PATH -e CI_PROJECT_DIR -e VERBOSE_LVL=DEBUG -v "${CI_PROJECT_DIR}:/gitlab/workspace" cluster.dev:${CLUSTER_DEV_BRANCH} "./.cluster.dev/" "AWSUSER" "AWSPASS"
  stage: build_cluster-dev
voatsap commented 4 years ago

Gitlab Support implemented: https://github.com/shalb/cluster.dev/blob/master/docs/OPTIONS.md#gitlab-cicd-pipeline-configuration