Skip to content
This repository has been archived by the owner on Nov 20, 2021. It is now read-only.

Commit

Permalink
init
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Nordhoff <[email protected]>
Co-authored-by: Andrew Alexander <[email protected]>
Co-authored-by: Bill Young <[email protected]>
Co-authored-by: brandonastell <[email protected]>
Co-authored-by: Carl B. Jones <[email protected]>
Co-authored-by: chris <[email protected]>
Co-authored-by: christina <[email protected]>
Co-authored-by: Ege <[email protected]>
Co-authored-by: Jeremy Fleitz <[email protected]>
Co-authored-by: Kyle Travis <[email protected]>
Co-authored-by: mbhatia <[email protected]>
Co-authored-by: Michael Chun <[email protected]>
Co-authored-by: Nathan French <[email protected]>
Co-authored-by: Paul Halliday <[email protected]>
Co-authored-by: rbtr <[email protected]>
Co-authored-by: Seith Miller <[email protected]>
Co-authored-by: Wendy Huang <[email protected]>
Co-authored-by: YenHernandez <[email protected]>
Co-authored-by: ZacKracht22 <[email protected]>
  • Loading branch information
19 people committed Nov 13, 2020
0 parents commit f690fc2
Show file tree
Hide file tree
Showing 545 changed files with 83,440 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
client/node_modules
node_modules
hack/
docs/
.charts/
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a bug report to report an existing issue

---

### Description
> A clear and concise description of what the issue is.
### Expected Behavior
> A clear and concise description of what you expected to happen.
### Reproduction
> Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.
>
> Where applicable, please include:
>
> - Code sample to reproduce the issue
> - Log files (redact/remove sensitive information)
> - Application settings (redact/remove sensitive information)
> - Screenshots
### Environment
> Please complete the following information
- OS [e.g. _iOS_]:
- Browser [e.g. _chrome v4.2_]:
- UI Version [e.g. _master.039bf4349_]:
> Note: The UI Version can be found on the UI in the hamburger dropdown menu
### Additional Context
> Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest new functionality for this project

---


### Context
> What are you trying to do and how would you want to do it differently? Is it something you currently you cannot do? Is this related to an issue/problem?
### Describe the ideal solution
> A clear and concise description of what you want to happen.
## Alternatives and current work-arounds
> A clear and concise description of any alternatives you've considered or any work-arounds that are currently in place.
### Additional context
> Add any other context or screenshots about the feature request here.
40 changes: 40 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Description

> Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

> Please describe the tests that you ran to verify your changes. Please include any manual steps for testing end-to-end or functionality not covered by unit/integration/e2e tests.
- [ ] E2E tests added for new functionality
- [ ] Unit tests added for new functionality
- [ ] Existing tests complete without errors

## Additional Information
> Describe any additional resources or components required for testing
# Checklist:

- [ ] Code can be automatically merged (no conflicts)
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] Placeholder code is flagged / future todos are captured in issues and comments

If you have any outstanding TODO items before this PR can be merged, note them here

- [ ] TODO 1
- [ ] TODO 2
33 changes: 33 additions & 0 deletions .github/workflows/chart_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Package tagged charts

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'chart/v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare
id: prep
run: |
echo ::set-output name=version::${GITHUB_REF#refs/tags/chart/}
echo ::set-output name=app::$(git describe --match "v*" --abbrev=0 --tags $(git rev-list --tags --max-count=1))
- name: Install helm
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- name: Generate chart
run: |
mkdir -p dist
helm dependency update ./chart
helm package --version ${{ steps.prep.outputs.version }} --app-version ${{ steps.prep.outputs.app }} --destination ./dist ./chart
- uses: criticalstack/upsert-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: ${{ github.ref }}
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish docs
on:
push:
branches:
- main
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build
run: make -C docs/ build
- name: Deploy
run: |
git config user.name "$(git log -1 --format=%an)"
git config user.email "$(git log -1 --format=%ae)"
git checkout docs --
mv docs/book book
rm -r docs
mv book docs
git add docs
git diff --quiet && git diff --staged --quiet || (git commit -m "Update docs"; git push)
129 changes: 129 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: pr-main
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: Clean up
run: |
df -h
rm -rf /usr/share/dotnet/
df -h
- name: Checkout
uses: actions/checkout@v2

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.9'

- name: Install helm
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

- name: Go cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Install cinder
run: curl -sSfL https://get.crit.sh | sh

- name: Create cinder cluster
run: |
cinder version
cinder create cluster -v -c hack/cinder-e2e.yaml --name ui-dev
- name: Failure logs
if: ${{ failure() }}
run: docker exec ui-dev journalctl -xu kubelet

- name: Version
run: echo "::set-output name=VERSION::$(make version)"
id: get-version

- name: Docker Build
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
load: true
build-args: VERSION=${{ steps.get-version.outputs.VERSION }}
tags: criticalstack/ui:${{ steps.get-version.outputs.VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Test e2e
run: |
cinder load --name ui-dev criticalstack/ui:${{ steps.get-version.outputs.VERSION }}
kubectl apply -f chart/crds/
helm template chart --namespace critical-stack --name-template cs-ui \
--set identity.issuerOverride="http://$(cinder get ip --name ui-dev):30000" \
--set identity.issuerCAFile="" \
--set tls.enabled=false \
--set healthcheck.enabled=false \
--set users.admin.initialPassword.value=admin \
--set users.admin.template.type=local \
--set users.admin.template.active=true \
--set users.admin.template.username=admin \
--set [email protected] \
--set image.tag=${{ steps.get-version.outputs.VERSION }} | kubectl apply -f -
kubectl rollout -n critical-stack status deployment/cs-ui -w
kubectl wait userrequests admin --for condition=Ready
make test-e2e
- name: e2e failure logs
if: ${{ failure() }}
run: |
docker exec ui-dev kubectl --kubeconfig /etc/kubernetes/admin.conf -n critical-stack get pods -o yaml -l app.kubernetes.io/name=ui
docker exec ui-dev kubectl --kubeconfig /etc/kubernetes/admin.conf -n critical-stack get all
- name: Cypress Tests
id: cypress
run: |
cd client
npm install
npx cypress verify
npx cypress run --config baseUrl=http://$(cinder get ip --name ui-dev):30000
- uses: actions/upload-artifact@v2
if: ${{ steps.cypress.outcome == 'failure' }}
with:
name: cypress-results
path: client/cypress/results/**/*

chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install helm
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- name: Package chart
run: helm package --app-version $(make version) ./chart
- uses: actions/upload-artifact@v2
with:
name: chart
path: ui-*.tgz
33 changes: 33 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: push
on: push
jobs:
go-test-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.9'
- name: Go cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: make test
- name: Go Lint
run: make lint

helm-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install helm
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- name: Helm Lint
run: helm lint chart
Loading

0 comments on commit f690fc2

Please sign in to comment.