-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #281 from kbst/test-refactor-pipeline
Stop building pre Terraform module artifacts
- Loading branch information
Showing
8 changed files
with
64 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,12 @@ on: | |
branches: | ||
- "*" # run for branches | ||
tags: | ||
- "*" # run for tags | ||
- "!*" # do not run for tags | ||
|
||
env: | ||
TERRAFORM_VERSION: "1.3.4" | ||
TERRAFORM_VERSION: "1.5.7" | ||
|
||
jobs: | ||
|
||
|
||
# | ||
# | ||
# Build artifacts | ||
|
@@ -36,7 +34,7 @@ jobs: | |
|
||
# | ||
# | ||
# Test `kustomize build` | ||
# Run `terraform test` | ||
test-terraform: | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -46,7 +44,7 @@ jobs: | |
|
||
# Setup Terraform | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v1.3.2 | ||
uses: hashicorp/setup-terraform@v2.0.3 | ||
with: | ||
terraform_wrapper: false | ||
terraform_version: "${{ env.TERRAFORM_VERSION }}" | ||
|
@@ -56,38 +54,6 @@ jobs: | |
run: make test-terraform | ||
|
||
|
||
# | ||
# | ||
# Test `kustomize build` | ||
test-kustomize: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
kustomize-version: ["4.5.2"] | ||
needs: build | ||
|
||
steps: | ||
# Checkout | ||
- uses: actions/[email protected] | ||
|
||
# Download build artifacts | ||
- name: 'Download build-artifacts' | ||
uses: actions/[email protected] | ||
with: | ||
name: _dist | ||
path: _dist | ||
|
||
# Build image | ||
- name: Build image | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
run: docker build --build-arg KUSTOMIZE_VERSION=${{ matrix.kustomize-version }} -t test-kustomize:${{ matrix.kustomize-version }} test/kustomize/ | ||
|
||
# Run tests | ||
- name: Run tests | ||
run: docker run -v `pwd`/_dist:/_dist test-kustomize:${{ matrix.kustomize-version }} | ||
|
||
|
||
# | ||
# | ||
# Test deploy to k3d | ||
|
@@ -101,7 +67,7 @@ jobs: | |
|
||
# Setup k3d | ||
- name: Setup k3d | ||
uses: rinx/[email protected].3 | ||
uses: rinx/[email protected].4 | ||
with: | ||
skipClusterCreation: true | ||
|
||
|
@@ -129,7 +95,7 @@ jobs: | |
# | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [test-kustomize, test-k3d, test-terraform] | ||
needs: [test-k3d, test-terraform] | ||
|
||
steps: | ||
# Download build artifacts | ||
|
@@ -149,35 +115,14 @@ jobs: | |
|
||
# | ||
# | ||
# Promote tagged releases | ||
# from `dev.catalog.kubestack.com` to `catalog.kubestack.com` | ||
promote: | ||
# trigger promotion by tagging release | ||
trigger-promote: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
# promote only for tags | ||
if: startsWith(github.ref, 'refs/tags/') | ||
if: startsWith(github.ref, 'refs/heads/release-') | ||
|
||
steps: | ||
# Setup gcloud CLI | ||
- uses: google-github-actions/[email protected] | ||
with: | ||
service_account_key: ${{ secrets.GCLOUD_AUTH }} | ||
|
||
# Promote archive | ||
- uses: actions/[email protected] | ||
- run: | | ||
export NAME=$(echo $GITHUB_REF | sed -e "s#^refs/tags/##") | ||
set +e | ||
while true | ||
do | ||
gsutil cp gs://dev.catalog.kubestack.com/${NAME}.zip gs://catalog.kubestack.com/${NAME}.zip &&\ | ||
gsutil cp gs://dev.catalog.kubestack.com/module-${NAME}.zip gs://catalog.kubestack.com/module-${NAME}.zip &&\ | ||
break | ||
sleep 15 | ||
done | ||
# Check promotion | ||
- name: Check promotion | ||
run: | | ||
export NAME=$(echo $GITHUB_REF | sed -e "s#^refs/tags/##") | ||
wget https://storage.googleapis.com/catalog.kubestack.com/${NAME}.zip | ||
wget https://storage.googleapis.com/catalog.kubestack.com/module-${NAME}.zip | ||
export TAG=$(echo $GITHUB_REF | sed -e "s#^refs/heads/release-##") | ||
git tag $TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Promote | ||
|
||
on: | ||
push: | ||
branches: | ||
- "!*" # do not run for branches | ||
tags: | ||
- "*" # run for tags | ||
|
||
jobs: | ||
# | ||
# | ||
# Promote tagged releases | ||
# from `dev.catalog.kubestack.com` to `catalog.kubestack.com` | ||
promote: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
# promote only for tags | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
# Setup gcloud CLI | ||
- uses: google-github-actions/[email protected] | ||
with: | ||
service_account_key: ${{ secrets.GCLOUD_AUTH }} | ||
|
||
# Promote archive | ||
- run: | | ||
export TAG=$(echo $GITHUB_REF | sed -e "s#^refs/tags/##") | ||
export NAME=$(echo $TAG | sed -r 's#-v[0-9]+.*$##') | ||
set +e | ||
while true | ||
do | ||
gsutil cp gs://dev.catalog.kubestack.com/module-${NAME}-${GITHUB_SHA}.zip gs://catalog.kubestack.com/module-${TAG}.zip &&\ | ||
break | ||
sleep 15 | ||
done | ||
# Check promotion | ||
- name: Check promotion | ||
run: | | ||
export TAG=$(echo $GITHUB_REF | sed -e "s#^refs/tags/##") | ||
wget https://storage.googleapis.com/catalog.kubestack.com/module-${TAG}.zip |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.