Skip to content

Commit

Permalink
Api konstruct ci (#384)
Browse files Browse the repository at this point in the history
* test initial workflows for kubefirst-api

* trigger ci

* new template ref for output macro version

* fix template input value

* trigger ci after macro chart bump

* trigger ci after macro chart bump

* Update .github/workflows/main.yaml

---------

Co-authored-by: Jared Edwards <[email protected]>
  • Loading branch information
johndietz and jarededwards authored Jul 26, 2024
1 parent 74d5691 commit a884e9e
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 120 deletions.
53 changes: 9 additions & 44 deletions .argo/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
value: '{{steps.get-initial-chart-version.outputs.result}}-rc.{{workflow.parameters.shortSha}}'
- name: shortSha
value: '{{workflow.parameters.shortSha}}'
- - name: publish-helm-chart
- - name: publish-helm-chart #! mini chart
templateRef:
name: cwft-helm
template: publish-chart
Expand Down Expand Up @@ -127,70 +127,35 @@ spec:
- name: chartDir
value: 'charts/kubefirst'

- - name: output-current-chart-version
- - name: get-current-macro-chart-version
templateRef:
name: cwft-helm
template: output-macro-chart-version
template: get-macro-chart-version
clusterScope: true
arguments:
artifacts:
- name: repo-source
from: '{{steps.set-app-version-and-bump-macro-chartz.outputs.artifacts.repo-source}}'
parameters:
- name: appName
value: "charts"
- name: chartDir
value: "charts/kubefirst"
- name: version
value: "current"
- - name: pull-commit-push-charts

- - name: pull-commit-push-tag-charts
templateRef:
name: cwft-git
template: pull-commit-push
template: pull-commit-push-tag
clusterScope: true
arguments:
artifacts:
- name: repo-source
from: '{{steps.set-app-version-and-bump-macro-chartz.outputs.artifacts.repo-source}}'
parameters:
- name: commitMessage
value: 'prepared next macro chart for kubefirst - set {{workflow.parameters.appName}} to {{steps.get-initial-chart-version.outputs.result}}-rc.{{workflow.parameters.shortSha}}'
value: 'tagged {{workflow.parameters.appName}} in charts kubefirst-v{{steps.get-current-macro-chart-version.outputs.result}}'
- name: gitUrlNoProtocol
value: '{{workflow.parameters.gitUrlNoProtocol}}'
- name: repoName
value: 'charts'
- - name: pull-sign-commit-push-gitops-template
templateRef:
name: cwft-git
template: pull-sign-commit-push-gitops-template
clusterScope: true
arguments:
artifacts:
- name: repo-source
from: '{{steps.set-app-version-and-bump-macro-chartz.outputs.artifacts.repo-source}}'
parameters:
- name: appName
value: 'gitops-template'
- name: commitMessage
value: 'set next macro chart for kubefirst - {{steps.output-current-chart-version.outputs.result}}'
- name: nextChartVersion
value: "{{steps.output-current-chart-version.outputs.result}}"
- name: tag
value: 'kubefirst-v{{steps.get-current-macro-chart-version.outputs.result}}'

- - name: pull-sign-commit-push-gitops
templateRef:
name: cwft-git
template: pull-sign-commit-push-gitops
clusterScope: true
arguments:
artifacts:
- name: repo-source
from: '{{steps.set-app-version-and-bump-macro-chartz.outputs.artifacts.repo-source}}'
parameters:
- name: appName
value: 'gitops'
- name: commitMessage
value: 'set next macro chart for kubefirst - {{steps.output-current-chart-version.outputs.result}}'
- name: chartVersion
value: "{{steps.output-current-chart-version.outputs.result}}"
- name: environment
value: "development"
144 changes: 72 additions & 72 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,75 +43,75 @@ jobs:
-p shortSha="${GITHUB_SHA_SHORT}" \
--wait --log
- run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst"
development:
needs: publish
runs-on: self-hosted
steps:
- name: Setup Runner for Argo
run: |
cd $HOME
echo "Install argo"
# Download the binary
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz
# Unzip
gunzip argo-linux-amd64.gz
# Make binary executable
chmod +x argo-linux-amd64
# Move binary to path
sudo mv ./argo-linux-amd64 /usr/local/bin/argo
# Test installation
argo version --short
- name: Check out repository code
uses: actions/checkout@v3
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: development
run: |
echo "commit sha $GITHUB_SHA"
argo version --short
argo submit .argo/deploy.yaml \
--generate-name="${GITHUB_REPOSITORY_NAME_PART}-development-${GITHUB_SHA_SHORT}-" \
-p appName="${GITHUB_REPOSITORY_NAME_PART}" \
-p branch="${GITHUB_REF_NAME}" \
-p clusterName="mgmt-20-kubefirst-com" \
-p environment="development" \
-p gitUrlNoProtocol="[email protected]:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \
-p shortSha="${GITHUB_SHA_SHORT}" \
--wait --log
- run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst"
staging:
needs: development
runs-on: self-hosted
steps:
- name: Setup Runner for Argo
run: |
cd $HOME
echo "Install argo"
# Download the binary
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz
# Unzip
gunzip argo-linux-amd64.gz
# Make binary executable
chmod +x argo-linux-amd64
# Move binary to path
sudo mv ./argo-linux-amd64 /usr/local/bin/argo
# Test installation
argo version --short
- name: Check out repository code
uses: actions/checkout@v3
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: staging
run: |
echo "commit sha $GITHUB_SHA"
argo version --short
argo submit .argo/deploy.yaml \
--generate-name="${GITHUB_REPOSITORY_NAME_PART}-staging-${GITHUB_SHA_SHORT}-" \
-p appName="${GITHUB_REPOSITORY_NAME_PART}" \
-p branch="${GITHUB_REF_NAME}" \
-p clusterName="mgmt-20-kubefirst-com" \
-p environment="staging" \
-p gitUrlNoProtocol="[email protected]:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \
-p shortSha="${GITHUB_SHA_SHORT}" \
--wait --log
- run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst"
# development:
# needs: publish
# runs-on: self-hosted
# steps:
# - name: Setup Runner for Argo
# run: |
# cd $HOME
# echo "Install argo"
# # Download the binary
# curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz
# # Unzip
# gunzip argo-linux-amd64.gz
# # Make binary executable
# chmod +x argo-linux-amd64
# # Move binary to path
# sudo mv ./argo-linux-amd64 /usr/local/bin/argo
# # Test installation
# argo version --short
# - name: Check out repository code
# uses: actions/checkout@v3
# - name: Inject slug/short variables
# uses: rlespinasse/github-slug-action@v4
# - name: development
# run: |
# echo "commit sha $GITHUB_SHA"
# argo version --short
# argo submit .argo/deploy.yaml \
# --generate-name="${GITHUB_REPOSITORY_NAME_PART}-development-${GITHUB_SHA_SHORT}-" \
# -p appName="${GITHUB_REPOSITORY_NAME_PART}" \
# -p branch="${GITHUB_REF_NAME}" \
# -p clusterName="mgmt-20-kubefirst-com" \
# -p environment="development" \
# -p gitUrlNoProtocol="[email protected]:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \
# -p shortSha="${GITHUB_SHA_SHORT}" \
# --wait --log
# - run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst"
# staging:
# needs: development
# runs-on: self-hosted
# steps:
# - name: Setup Runner for Argo
# run: |
# cd $HOME
# echo "Install argo"
# # Download the binary
# curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz
# # Unzip
# gunzip argo-linux-amd64.gz
# # Make binary executable
# chmod +x argo-linux-amd64
# # Move binary to path
# sudo mv ./argo-linux-amd64 /usr/local/bin/argo
# # Test installation
# argo version --short
# - name: Check out repository code
# uses: actions/checkout@v3
# - name: Inject slug/short variables
# uses: rlespinasse/github-slug-action@v4
# - name: staging
# run: |
# echo "commit sha $GITHUB_SHA"
# argo version --short
# argo submit .argo/deploy.yaml \
# --generate-name="${GITHUB_REPOSITORY_NAME_PART}-staging-${GITHUB_SHA_SHORT}-" \
# -p appName="${GITHUB_REPOSITORY_NAME_PART}" \
# -p branch="${GITHUB_REF_NAME}" \
# -p clusterName="mgmt-20-kubefirst-com" \
# -p environment="staging" \
# -p gitUrlNoProtocol="[email protected]:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \
# -p shortSha="${GITHUB_SHA_SHORT}" \
# --wait --log
# - run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst"
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ Kubefirst API runtime implementation.
- [Authentication Credentials](#authentication-credentials)
- [Kubernetes Secret](#kubernetes-secret)
- [API Call Parameters](#api-call-parameters)
- [AWS](#aws)
- [Civo](#civo)
- [DigitalOcean](#digitalocean)
- [Vultr](#vultr)
- [Akamai](#akamai)
- [AWS](#aws)
- [Civo](#civo)
- [DigitalOcean](#digitalocean)
- [Google Cloud](#google-cloud)
- [Vultr](#vultr)
- [API Call](#api-call)
- [Akamai](#akamai-1)
- [AWS](#aws-1)
- [Civo](#civo-1)
- [DigitalOcean](#digitalocean-1)
- [Vultr](#vultr-1)
- [Deleting a Cluster](#deleting-a-cluster)
- [Authentication](#authentication)
- [Swagger UI](#swagger-ui)
Expand Down

0 comments on commit a884e9e

Please sign in to comment.