diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9705d3d9dfafe6ebea4bee123edd51a267fa1020..c7b08003dbf113c2261f9cdeb839a6e93977d726 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -163,8 +163,8 @@ include: stages: - build - - create-vps - - setup-cluster + - install-cluster + - install-stackspin - configure-cluster - kustomization - install-apps @@ -262,13 +262,14 @@ report-ci-image-tag: interruptible: true -# Stage: create-vps -# ================= +# Stage: install-cluster +# ====================== # -# Creates the vps for the pipeline +# * Creates the vps for the pipeline +# * Installs k8s with ansible create-vps: - stage: create-vps + stage: install-cluster variables: SUBDOMAIN: "${CI_COMMIT_REF_SLUG}.ci" DOMAIN: "stackspin.net" @@ -290,14 +291,8 @@ create-vps: auto_stop_in: 1 week interruptible: true - -# Stage: setup-cluster -# ==================== -# -# Installs Stackspin - test-dns: - stage: setup-cluster + stage: install-cluster needs: - job: create-vps script: @@ -308,8 +303,10 @@ test-dns: - .general_rules interruptible: true -setup-stackspin: - stage: setup-cluster +install-k8s: + stage: install-cluster + needs: + - job: test-dns script: - *debug_information # Copy inventory files to ansible folder for use in install-apps step @@ -317,6 +314,23 @@ setup-stackspin: - cp ${CLUSTER_DIR}/inventory.yml ansible/ # Set up cluster - python3 -m stackspin $HOSTNAME install + extends: + - .ssh_setup + - .report_artifacts + - .general_rules + interruptible: true + +# Stage: install-stackspin +# ======================== +# +# Installs flux and stackspin with it + +install-stackspin: + stage: install-stackspin + needs: + - job: install-k8s + script: + - *debug_information # Customize env file, remove all comments and empty lines - sed "s/1.2.3.4/$IP_ADDRESS/; s/example.org/$FQDN/; s/acme_staging=false/acme_staging=true/; s/acme-v02/acme-staging-v02/; /^\s*#.*$/d; /^\s*$/d" install/.flux.env.example >> ${CLUSTER_DIR}/.flux.env # Deploy secret/stackspin-cluster-variables @@ -334,15 +348,12 @@ setup-stackspin: - .general_rules interruptible: true - -# Stage: configure-cluster -# ==================== -# # Configure cluster after basic installation # i.e. CI-related config like zerossl clusterIssuer - configure-stackspin: - stage: configure-cluster + stage: install-stackspin + needs: + - job: install-stackspin script: - *debug_information # Install custom ClusterIssuer for ZeroSSL production certificates @@ -353,8 +364,6 @@ configure-stackspin: interruptible: true - - # Stage: kustomization # ==================== #