Skip to content

Commit

Permalink
v8 - Major changes and versioning decisions
Browse files Browse the repository at this point in the history
Removing npm and pip test references in run.sh

Adding a design doc.  Fixes FairwindsOps#227
  • Loading branch information
Andrew Suderman committed Mar 20, 2019
1 parent 1ead3a8 commit 9bd3870
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 174 deletions.
9 changes: 0 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ references:
echo "Skipping the docker push because '\$DOCKER_BASE_TAG: $DOCKER_BASE_TAG' does not start with dev- or v[0-9]+."
fi
npm_release: &npm_release
run:
name: NPM release
command: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo $CIRCLE_TAG | xargs npm version --no-git-tag-version
npm publish
github_release: &github_release
run:
name: GitHub release
Expand Down Expand Up @@ -99,7 +91,6 @@ jobs:
- *docker_login
- *docker_build
- *docker_push
- *npm_release


workflows:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
package-lock.json
*egg-info
.vscode
.DS_Store
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# How to contribute

Issues, whether bugs, tasks, or feature requests are essential for keeping rok8s-scripts (and ReactiveOps in general) great.
We believe it should be as easy as possible to contribute changes that
get things working in your environment. There are a few guidelines that we
need contributors to follow so that we can have a chance of keeping on
top of things.

## Getting Started

* Submit an issue, assuming one does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Apply the appropriate labels, whether it is bug, feature, or task.

## Making Changes

* Create a feature branch from where you want to base your work.
* This is usually the master branch.
* To quickly create a topic branch based on master; `git checkout -b
feature master`. Please avoid working directly on the
`master` branch.
* Try to make commits of logical units.
* Make sure you have added the necessary tests for your changes if applicable.
* Make sure you have added any required documentation changes.

## Making Trivial Changes

### Documentation

For changes of a trivial nature to comments and documentation, it is not
always necessary to create a new issue in GitHub. In these cases, a branch with pull request is sufficient.

## Submitting Changes

* Push your changes to a topic branch.
* Submit a pull request.
* Mention the issue in your PR description. I.E. `Fixes #42`. This will ensure that your issue gets tagged with the PR.


Attribution
===========
Portions of this text are copied from the [Puppet Contributing](https://github.com/puppetlabs/puppet/blob/master/CONTRIBUTING.md) documentation.
21 changes: 21 additions & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# rok8s-scripts Design Doc

## Introduction

This is a set of opinionated scripts for managing application development and deployment lifecycle using Kubernetes. These simplify secure secrets management, environment specific config, Docker build caching, and much more. The opinionated nature of the scripts reflects the collective experience and observed best-practices that ReactiveOps has accumulated.

## Guiding Principles

There are several things that are to be kept in mind while maintaining rok8s-scripts.. They should act as baseline from which to make decisions.

**Ease of Use**
It should be relatively trivial to take an existing Dockerized application and construct a pipleline to build and deploy it using rok8s-scripts.

**Backward Compatibility**
When introducing a new feature to rok8s-scripts, it should be backward-compatible. If it might break something, we prefer to contain it inside of an environment variable feature flag in order to make the feature optional. If this is not possible, sufficient care should be taken to notify customers and increment version accordingly.

**Scope**
As maintainers of rok8s-scripts, ReactiveOps is not in the business of catering to every single hand-crafted bespoke pipeline in existence. This means that some changes may be out of scope for the intended purpose. The intended purpose is to build, push, and deploy containers.

**Pull Requests Welcom**
Please don't hesistate to reach out and file a PR or an Issue if you would like to see something implemented. See [CONTRIBUTING](CONTRIBUTING.md)
File renamed without changes.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Each new release of rok8s-scripts comes with a new set of CI images for simple w

We currently include a variety of CI Images, including Alpine and Debian Stretch as our recommended starting points. In certain cases you may want to use our images that include Node.js or Golang.

The latest Debian Stretch release can be pulled from `quay.io/reactiveops/ci-images:v7-stretch`. A full list of the latest image tags is available on our [Quay repository](https://quay.io/repository/reactiveops/ci-images).
The latest Debian Stretch release can be pulled from `quay.io/reactiveops/ci-images:v8-stretch`. A full list of the latest image tags is available on our [Quay repository](https://quay.io/repository/reactiveops/ci-images).

## Examples

Expand All @@ -25,11 +25,31 @@ Most notably, the CI example includes sample configuration for the following pla

On their own, these examples may not make a lot of sense. There's a lot more documentation below that should cover everything included in these examples and more.

## Versioning v8.0.0 and beyond

Rok8s-scripts contains a number of dependencies that have various ways of versioning themselves. Most notably, Helm tends to break backward compatibility with every minor release. We have decided that post v8 of rok8s-scripts, we will update our versions according to the version change of the underlying tool. For example, if Helm changes from `2.13.0` to `2.14.0`, we will change the version of rok8s scripts by one minor version. This will be clearly mentioned in the release notes. This means that a minor version of rok8s-scripts could introduce breaking changes to the CI/CD pipelines that are using it.

Please note that we will still commit to any patch version releases being backward-compatible. We will never release a patch version that upgrades an underlying tool beyond a patch version, and we will not release any patch versions of rok8s-scripts that introduce a breaking change.

Here is a set of guidelines to follow when deciding what version of ci-images (and thus rok8s-scripts) to use:

#### You are very risk-averse

You want rok8s-scripts to be stable, and just keep working until you decide to upgrade.

In this scenario, you should pin to a minor version of rok8s-scripts such as `v8.0-alpine`.

#### You like to live dangerously

You are okay with your pipeline breaking occasionally and having to upgrade things as they break.

In this case, go ahead and pin to a major version such as `v8-alpine`

## Further Reading

- [Building and Pushing Docker Images](/docs/docker.md)
- [Deploying to Kubernetes with Helm](/docs/helm.md)
- [Deploying to Kubernetes without Helm](/docs/without_helm.md)
- [Deploying to Kubernetes with Helm](/docs/Helm.md)
- [Deploying to Kubernetes without Helm](/docs/without_Helm.md)
- [Managing Kubernetes Secrets Securely](/docs/secrets.md)

### Cloud Specific Documentation
Expand Down
6 changes: 3 additions & 3 deletions bin/install-rok8s-requirements
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ else
PKG_INSTALL="${PKG_MANAGER} install -y"
fi

KUBECTL_VERSION="${KUBECTL_VERSION:-v1.11.6}"
HELM_VERSION="${HELM_VERSION:-v2.12.2}"
SOPS_VERSION="${SOPS_VERSION:-3.0.5}"
KUBECTL_VERSION="${KUBECTL_VERSION:-v1.12.6}"
HELM_VERSION="${HELM_VERSION:-v2.13.0}"
SOPS_VERSION="${SOPS_VERSION:-3.2.0}"

# make sure sudo is installed
if ! hash sudo 2>/dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Each new release of rok8s-scripts comes with a new set of CI images for simple w

We currently include a variety of CI Images, including Alpine and Debian Stretch as our recommended starting points. In certain cases you may want to use our images that include Node.js or Golang.

The latest Debian Stretch release can be pulled from `quay.io/reactiveops/ci-images:v7-stretch`. A full list of the latest image tags is available on our [Quay repository](https://quay.io/repository/reactiveops/ci-images).
The latest Debian Stretch release can be pulled from `quay.io/reactiveops/ci-images:v8-stretch`. A full list of the latest image tags is available on our [Quay repository](https://quay.io/repository/reactiveops/ci-images).

## Examples

Expand Down
3 changes: 0 additions & 3 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Releasing New Versions of rok8s-scripts

## Before Merging the Pull Request!
Please be sure to update `./setup.py` and `./package.json` to reflect the new version you wish to release. CODEOWNERS should be able to answer what the next version to release should be.

## Creating the Tag

Create an annotated tag on the commit you would like to release
Expand Down
4 changes: 2 additions & 2 deletions examples/ci/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ references:
deploy_steps: &deploy_steps
docker:
- image: quay.io/reactiveops/ci-images:v7-alpine
- image: quay.io/reactiveops/ci-images:v8-alpine
steps:
- checkout
- *set_environment_variables
Expand All @@ -24,7 +24,7 @@ references:
jobs:
imagebuild:
docker:
- image: quay.io/reactiveops/ci-images:v7-alpine
- image: quay.io/reactiveops/ci-images:v8-alpine
steps:
- checkout
- setup_remote_docker
Expand Down
4 changes: 2 additions & 2 deletions examples/ci/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variables:
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay2

image: quay.io/reactiveops/ci-images:v7-alpine
image: quay.io/reactiveops/ci-images:v8-alpine
services:
- docker:dind

Expand Down Expand Up @@ -75,4 +75,4 @@ deploy_production:
- helm-deploy -f $ROK8S_CONFIG
only:
- /^v.*/
when: manual
when: manual
2 changes: 1 addition & 1 deletion examples/ci/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: quay.io/reactiveops/ci-images:v7-stretch
image: quay.io/reactiveops/ci-images:v8-stretch

aliases:
- &initialize-env |
Expand Down
46 changes: 0 additions & 46 deletions package.json

This file was deleted.

60 changes: 0 additions & 60 deletions setup.py

This file was deleted.

4 changes: 0 additions & 4 deletions test/npm.sh

This file was deleted.

16 changes: 0 additions & 16 deletions test/pip.sh

This file was deleted.

22 changes: 0 additions & 22 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,6 @@ else
EXIT_CODE=1
fi

echo "------------------------"
echo "Running NPM Tests"
echo "------------------------"

if test/npm.sh ; then
echo "✅ NPM Tests Passed"
else
echo "⛔️ NPM Tests Failed"
EXIT_CODE=1
fi

echo "------------------------"
echo "Running Pip Tests"
echo "------------------------"

if test/pip.sh ; then
echo "✅ Pip Tests Passed"
else
echo "⛔️ Pip Tests Failed"
EXIT_CODE=1
fi

echo "------------------------"
echo "Running K8S Lint Tests"
echo "------------------------"
Expand Down

0 comments on commit 9bd3870

Please sign in to comment.