Skip to content

Commit

Permalink
Merge branch 'main' into update-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tuladhar authored Sep 18, 2023
2 parents 3df7e7d + a383723 commit d3266fc
Show file tree
Hide file tree
Showing 77 changed files with 3,721 additions and 1,210 deletions.
5 changes: 5 additions & 0 deletions .abs/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
replace-chart-version-with-git: true
generate-metadata: true
chart-dir: ./helm/teleport-operator
destination: ./build
# ct-config: ./.circleci/ct-config.yaml
88 changes: 31 additions & 57 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,15 @@
version: 2.1
orbs:
architect: giantswarm/[email protected]

jobs:
unit-tests:
executor: architect/architect
steps:
- checkout
- run:
name: "Run unit tests"
command: CGO_ENABLED=0 make test-unit
integration-tests:
executor: architect/machine
machine:
image: 'ubuntu-2004:202010-01'
steps:
- checkout
- architect/machine-install-go
- run:
name: Install Docker Compose
environment:
COMPOSE_VERSION: '1.29.2'
command: |
curl -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/bin/docker-compose
- run:
name: "Run integration tests"
command: |
CGO_ENABLED=0 make test-integration
orbs:
architect: giantswarm/[email protected]

workflows:
package-and-push-chart-on-tag:
build:
jobs:
- unit-tests:
filters:
tags:
only: /^v.*/

- integration-tests:
filters:
tags:
only: /^v.*/

- architect/go-build:
context: architect
name: go-build
binary: teleport-operator
resource_class: xlarge
requires:
- unit-tests
- integration-tests
resource_class: large
filters:
tags:
only: /^v.*/
Expand All @@ -62,37 +21,52 @@ workflows:
username_envar: "QUAY_USERNAME"
password_envar: "QUAY_PASSWORD"
requires:
- go-build
- go-build
# Needed to trigger job also on git tag.
filters:
# Trigger the job also on git tag.
tags:
only: /^v.*/

- architect/push-to-docker:
context: "architect"
name: push-teleport-operator-to-docker
image: "docker.io/giantswarm/teleport-operator"
username_envar: "DOCKER_USERNAME"
password_envar: "DOCKER_PASSWORD"
requires:
- go-build
- go-build
# Needed to trigger job also on git tag.
filters:
tags:
only: /^v.*/

- architect/push-to-app-catalog:
context: "architect"
# executor: "app-build-suite" # uncomment this if you want automatic metadata generation and helm chart linting
name: push-to-app-catalog
executor: "app-build-suite" # uncomment this if you want automatic metadata generation and helm chart linting
name: push-teleport-operator-to-app-catalog
app_catalog: "control-plane-catalog"
app_catalog_test: "control-plane-test-catalog"
chart: "teleport-operator"
requires:
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
# Trigger job on git tag.
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
# Needed to trigger job also on git tag.
filters:
tags:
only: /^v.*/

- architect/push-to-app-collection:
name: aws-app-collection
context: "architect"
app_name: "teleport-operator"
app_namespace: "giantswarm"
app_collection_repo: "aws-app-collection"
requires:
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
- push-teleport-operator-to-app-catalog
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/

Expand All @@ -102,9 +76,9 @@ workflows:
app_name: "teleport-operator"
app_collection_repo: "capa-app-collection"
requires:
- push-teleport-operator-to-docker
- push-teleport-operator-to-quay
- push-to-app-catalog
- push-teleport-operator-to-quay
- push-teleport-operator-to-docker
- push-teleport-operator-to-app-catalog
filters:
branches:
ignore: /.*/
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/pre_commit_go.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.add-team-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
mkdir -p artifacts
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
-O artifacts/users.yaml \
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/user-mapping.yaml
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zz_generated.add-to-project-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
mkdir -p artifacts
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
-O artifacts/users.yaml \
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/user-mapping.yaml
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -28,7 +28,7 @@ jobs:
mkdir -p artifacts
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
-O artifacts/labels.yaml \
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/label-mapping.yaml
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/label-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/zz_generated.check_values_schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.19.0
# devctl@6.9.0
#
name: 'Values and schema'
on:
Expand All @@ -13,6 +13,8 @@ on:
- 'helm/**/values.schema.json' # schema
- 'helm/**/ci/ci-values.yaml' # overrides for CI (can contain required entries)

push: {}

jobs:
check:
name: 'validate values.yaml against values.schema.json'
Expand All @@ -30,15 +32,22 @@ jobs:
- name: 'Check if values.yaml is a valid instance of values.schema.json'
run: |
HELM_DIR=$(git diff --name-only origin/${GITHUB_BASE_REF} ${GITHUB_SHA} \
| grep 'helm/[-a-z].*\/' | head -1 | awk -F '/' '{print $1"/"$2}')
VALUES=${HELM_DIR}/values.yaml
if [ -f ${HELM_DIR}/ci/ci-values.yaml ]; then
# merge ci-values.yaml into values.yaml (providing required values)
echo -e "\nMerged values:\n=============="
yq '. *= load("'${HELM_DIR}'/ci/ci-values.yaml")' ${HELM_DIR}/values.yaml | tee ${HELM_DIR}/combined-values.yaml
echo -e "\n==============\n"
VALUES=${HELM_DIR}/combined-values.yaml
fi
for chart_yaml in helm/*/Chart.yaml; do
helm_dir="${chart_yaml%/Chart.yaml}"
if [ ! -f ${helm_dir}/values.schema.json ]; then
echo "Skipping validation for '${helm_dir}' folder, because 'values.schema.json' does not exist..."
continue
fi
values=${helm_dir}/values.yaml
if [ -f ${helm_dir}/ci/ci-values.yaml ]; then
# merge ci-values.yaml into values.yaml (providing required values)
echo -e "\nMerged values:\n=============="
yq '. *= load("'${helm_dir}'/ci/ci-values.yaml")' ${helm_dir}/values.yaml | tee ${helm_dir}/combined-values.yaml
echo -e "\n==============\n"
values=${helm_dir}/combined-values.yaml
fi
${HOME}/yajsv -s ${HELM_DIR}/values.schema.json ${VALUES}
${HOME}/yajsv -s ${helm_dir}/values.schema.json ${values}
done
30 changes: 15 additions & 15 deletions .github/workflows/zz_generated.create_release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.19.0
# devctl@6.9.0
#
name: Create Release
on:
Expand All @@ -15,7 +15,7 @@ on:
jobs:
debug_info:
name: Debug info
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Print github context JSON
run: |
Expand All @@ -24,7 +24,7 @@ jobs:
EOF
gather_facts:
name: Gather facts
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
project_go_path: ${{ steps.get_project_go_path.outputs.path }}
ref_version: ${{ steps.ref_version.outputs.refversion }}
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
echo "refversion=${refversion}" >> $GITHUB_OUTPUT
update_project_go:
name: Update project.go
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: ${{ needs.gather_facts.outputs.version != '' && needs.gather_facts.outputs.project_go_path != '' && needs.gather_facts.outputs.ref_version != 'true' }}
needs:
- gather_facts
Expand All @@ -93,7 +93,7 @@ jobs:
uses: giantswarm/[email protected]
with:
binary: "architect"
version: "6.10.0"
version: "6.11.0"
- name: Install semver
uses: giantswarm/[email protected]
with:
Expand Down Expand Up @@ -122,22 +122,22 @@ jobs:
fi
- name: Set up git identity
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "[email protected]"
git config --local user.name "taylorbot"
- name: Commit changes
run: |
file="${{ needs.gather_facts.outputs.project_go_path }}"
git add $file
git commit -m "Bump version to ${{ steps.update_project_go.outputs.new_version }}"
- name: Push changes
env:
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git"
branch: "${{ github.ref }}-version-bump"
run: |
git push "${REMOTE_REPO}" HEAD:${{ env.branch }}
- name: Create PR
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
base: "${{ github.ref }}"
branch: "${{ github.ref }}-version-bump"
version: "${{ needs.gather_facts.outputs.version }}"
Expand All @@ -146,7 +146,7 @@ jobs:
hub pull-request -f -m "${{ env.title }}" -b ${{ env.base }} -h ${{ env.branch }} -r ${{ github.actor }}
create_release:
name: Create release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs:
- gather_facts
if: ${{ needs.gather_facts.outputs.version }}
Expand All @@ -171,30 +171,30 @@ jobs:
path: ./CHANGELOG.md
- name: Set up git identity
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "[email protected]"
git config --local user.name "taylorbot"
- name: Create tag
run: |
version="${{ needs.gather_facts.outputs.version }}"
git tag "v$version" ${{ github.sha }}
- name: Push tag
env:
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git"
run: |
git push "${REMOTE_REPO}" --tags
- name: Create release
id: create_gh_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}"
with:
body: ${{ steps.changelog_reader.outputs.changes }}
tag_name: "v${{ needs.gather_facts.outputs.version }}"
release_name: "v${{ needs.gather_facts.outputs.version }}"

create-release-branch:
name: Create release branch
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs:
- gather_facts
if: ${{ needs.gather_facts.outputs.version }}
Expand Down
Loading

0 comments on commit d3266fc

Please sign in to comment.