-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
174 changed files
with
22,061 additions
and
19,115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
--- | ||
version: 2.1 | ||
|
||
orbs: | ||
ruby: circleci/[email protected] | ||
|
||
executors: | ||
skaffold: | ||
docker: | ||
- image: gcr.io/k8s-skaffold/skaffold:latest | ||
|
||
jobs: | ||
test: | ||
parallelism: 1 | ||
docker: | ||
- image: ruby:2.6.5-alpine3.10 | ||
environment: | ||
BUNDLE_JOBS: 10 | ||
BUNDLE_RETRY: 5 | ||
BUNDLE_PATH: vendor/bundle | ||
KRANE_ENV: test | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install system deps | ||
command: apk add --update --no-cache git bash curl make gcc libc-dev tzdata g++ npm | ||
- run: | ||
name: Which bundler? | ||
command: bundle -v | ||
- run: | ||
name: Configure Bundler | ||
command: gem install bundler -v $(cat Gemfile.lock | tail -1 | tr -d " ") | ||
- ruby/load-cache | ||
- ruby/install-deps | ||
- ruby/save-cache | ||
- ruby/run-tests | ||
|
||
build_only: | ||
executor: skaffold | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
version: 18.06.0-ce | ||
- run: | ||
name: Build artifacts w/ Skaffold | ||
command: | | ||
mkdir -p build | ||
skaffold build -p build-no-push --file-output build/${CIRCLE_SHA1}.json | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- build | ||
|
||
build_and_push: | ||
executor: skaffold | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
version: 18.06.0-ce | ||
- run: | ||
name: Build & Push artifacts w/ Skaffold | ||
command: | | ||
mkdir -p build | ||
docker login quay.io --username $DOCKER_USER --password $DOCKER_PASSWORD | ||
skaffold build -p build-and-push --file-output build/${CIRCLE_SHA1}.json | ||
# re-tag :latest | ||
skaffold_tag=$(cat build/${CIRCLE_SHA1}.json | jq -r '.builds[0].tag | split("@")[0]') | ||
skaffold_image=$(cat build/${CIRCLE_SHA1}.json | jq -r '.builds[0].imageName') | ||
docker tag ${skaffold_tag} ${skaffold_image}:latest | ||
docker push ${skaffold_image}:latest | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- build | ||
|
||
deploy: | ||
executor: skaffold | ||
parameters: | ||
skaffold_kube_context: | ||
type: string | ||
default: "" | ||
skaffold_namespace: | ||
type: string | ||
default: "" | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
version: 18.06.0-ce | ||
- attach_workspace: | ||
at: ~/project | ||
- run: | ||
name: Build & Push artifacts and Deploy w/ Skaffold | ||
command: | | ||
# ACCESS_CONFIG env variable contains KUBECONFIG with access to deployment environments | ||
echo $ACCESS_CONFIG | base64 -d > ./kubeconfig | ||
# Prepare skaffold for deployment to correct environment | ||
export SKAFFOLD_KUBECONFIG=./kubeconfig | ||
export SKAFFOLD_CACHE_ARTIFACTS=true | ||
export SKAFFOLD_STATUS_CHECK=false | ||
export SKAFFOLD_LABEL="io.appvia.krane/git-sha=${CIRCLE_SHA1}" | ||
export SKAFFOLD_KUBE_CONTEXT=<<parameters.skaffold_kube_context>> | ||
export SKAFFOLD_NAMESPACE=<<parameters.skaffold_namespace>> | ||
# Deploy with Skaffold - refers to artefacts built in previous step | ||
skaffold deploy --build-artifacts build/${CIRCLE_SHA1}.json | ||
workflows: | ||
version: 2 | ||
run_build: | ||
jobs: | ||
- test | ||
|
||
- build_only: | ||
requires: | ||
- test | ||
filters: | ||
branches: | ||
ignore: master | ||
tags: | ||
ignore: /.*/ | ||
|
||
- build_and_push: | ||
requires: | ||
- test | ||
filters: | ||
branches: | ||
only: master | ||
|
||
# - deploy: | ||
# skaffold_kube_context: qa | ||
# skaffold_namespace: krane | ||
# requires: | ||
# - build_and_push | ||
# filters: | ||
# branches: | ||
# only: master | ||
# tags: | ||
# only: /^v\d+\.\d+\.\d+$/ |
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,17 @@ | ||
.DS_Store | ||
.bundle | ||
.circleci/ | ||
.vscode | ||
.git | ||
.gitignore | ||
.dockerignore | ||
.rspec | ||
.DS_Store | ||
kubeconfig | ||
Dockerfile | ||
docker-compose.yml | ||
skaffold.yaml | ||
/cache | ||
/k8s | ||
/spec | ||
/tmp |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
.DS_Store | ||
/cache | ||
/dashboard/data | ||
/tmp | ||
/dashboard/data | ||
/dashboard/node_modules | ||
/dashboard/vendor | ||
/dashboard/compiled | ||
/dashboard/src/js/*.min.js | ||
/dashboard/src/css/*.min.css | ||
.bundle | ||
.vscode |
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.5.1 | ||
2.6.5 |
This file was deleted.
Oops, something went wrong.
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,54 @@ | ||
# Contributing | ||
|
||
When contributing to this repository, please first discuss the change you wish to make via issue, | ||
email, or any other method with the owners of this repository before making a change. | ||
|
||
Please note we have a code of conduct, please follow it in all your interactions with the project. | ||
|
||
## Pull Request Process | ||
|
||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a | ||
build. | ||
2. Update the README.md with details of changes to the interface, this includes new environment | ||
variables, exposed ports, useful file locations and container parameters. | ||
3. Increase the version numbers in any examples files and the README.md to the new version that this | ||
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). | ||
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you | ||
do not have permission to do that, you may request the second reviewer to merge it for you. | ||
|
||
## Contributor Code of Conduct | ||
|
||
As contributors and maintainers of this project, and in the interest of fostering an open and | ||
welcoming community, we pledge to respect all people who contribute through reporting issues, | ||
posting feature requests, updating documentation, submitting pull requests or patches, and other | ||
activities. | ||
|
||
We are committed to making participation in this project a harassment-free experience for everyone, | ||
regardless of level of experience, gender, gender identity and expression, sexual orientation, | ||
disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery | ||
* Personal attacks | ||
* Trolling or insulting/derogatory comments | ||
* Public or private harassment | ||
* Publishing other's private information, such as physical or electronic addresses, without explicit | ||
permission | ||
* Other unethical or unprofessional conduct. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, | ||
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By | ||
adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently | ||
applying these principles to every aspect of managing this project. Project maintainers who do not | ||
follow or enforce the Code of Conduct may be permanently removed from the project team. | ||
|
||
This code of conduct applies both within project spaces and in public spaces when an individual is | ||
representing the project or its community. | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an | ||
issue or contacting one or more of the project maintainers. | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), | ||
version 1.2.0, available at | ||
[http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) |
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,66 @@ | ||
# Copyright 2020 Appvia Ltd <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
############################################################## | ||
# Stage: builder | ||
FROM ruby:2.6.5-alpine3.10 AS builder | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --update --no-cache git bash curl make gcc libc-dev tzdata g++ npm | ||
|
||
# copy app | ||
COPY . /app | ||
|
||
# install gems | ||
RUN bundle install --jobs 20 --retry 5 --deployment --without development test | ||
|
||
# build the UI | ||
RUN cd dashboard && npm install --no-optional && npm rebuild node-sass && node_modules/.bin/gulp release | ||
|
||
############################################################## | ||
# Stage: final | ||
FROM ruby:2.6.5-alpine3.10 | ||
|
||
LABEL org="Appvia Ltd" | ||
LABEL website="appvia.io" | ||
LABEL maintainer="[email protected]" | ||
LABEL source="https://github.com/appvia/krane" | ||
|
||
ENV APP_PATH /app | ||
|
||
RUN apk add --update --no-cache git bash curl npm yarn | ||
|
||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/linux/amd64/kubectl && \ | ||
chmod +x ./kubectl && \ | ||
mv ./kubectl /usr/local/bin/kubectl | ||
|
||
RUN addgroup -g 1000 -S appuser \ | ||
&& adduser -u 1000 -S appuser -G appuser | ||
|
||
USER 1000 | ||
|
||
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/ | ||
COPY --from=builder --chown=1000:1000 /app $APP_PATH | ||
|
||
WORKDIR $APP_PATH | ||
|
||
ENV HOME $APP_PATH | ||
ENV PORT 8000 | ||
ENV KRANE_ENV production | ||
ENV PATH $APP_PATH/bin:$PATH | ||
|
||
ENTRYPOINT ["bin/krane"] | ||
CMD ["report", "--incluster"] |
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 |
---|---|---|
@@ -1,6 +1,20 @@ | ||
# Copyright 2020 Appvia Ltd <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
# Specify your gem's dependencies in rbacvis.gemspec | ||
# Specify your gem's dependencies in krane.gemspec | ||
gemspec |
Oops, something went wrong.