Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring go version and many fixes for e2e tests #530

Merged
merged 8 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 52 additions & 177 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,114 +17,25 @@ version: 2.1
orbs:
rok8s: fairwinds/rok8s-scripts@11

executors:
python-3-7:
docker:
- image: circleci/python:3.7
python-3-8:
docker:
- image: circleci/python:3.8
python-3-9:
docker:
- image: cimg/python:3.9

references:
e2e_configuration_python: &e2e_configuration_python
pre_script: end_to_end_testing/pre_python.sh
script: end_to_end_testing/run_python.sh
command_runner_image: quay.io/reactiveops/ci-images:v11-buster
enable_docker_layer_caching: false
store-test-results: /tmp/test-results
kind_version: 0.10.0
requires:
- build-3-7
- build-3-8
- build-3-9
filters:
branches:
only: /.*/
tags:
ignore: /.*/
e2e_configuration_go: &e2e_configuration_go
e2e_configuration: &e2e_configuration
attach-workspace: true
workspace-location: /
pre_script: end_to_end_testing/pre_go.sh
script: end_to_end_testing/run_go.sh
command_runner_image: quay.io/reactiveops/ci-images:v11-buster
enable_docker_layer_caching: false
store-test-results: /tmp/test-results
kind_version: 0.10.0
requires:
- test-go
- snapshot-go
- test
- snapshot
filters:
branches:
only: /.*/
tags:
ignore: /.*/
install_goreleaser: &install_goreleaser
run:
name: Install Goreleaser
command: |
curl -fsSLo goreleaser_amd64.deb https://github.com/goreleaser/goreleaser/releases/download/v0.164.0/goreleaser_amd64.deb
echo "577c88019cca787161ee1ff853d45be7f635ad7d8a204bd7a2735ab04abcc255 goreleaser_amd64.deb" | sha256sum -c -
sudo dpkg -i goreleaser_amd64.deb
rm goreleaser_amd64.deb
install_go: &install_go
run:
name: Install Golang
command: |
curl -LO https://golang.org/dl/go1.17.7.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.17.7.linux-amd64.tar.gz
echo "PATH=$PATH:/usr/local/go/bin" >> ${BASH_ENV}
jobs:
build-3-7:
executor: python-3-7
working_directory: ~/reckoner
steps:
- run:
name: Setup PATH to support pip user installs
command: echo 'export PATH=$PATH:/home/circleci/.local/bin' >> $BASH_ENV
- checkout
- run:
name: Unit Tests
command: |
pip install --user -r development-requirements.txt
pip install --user -e .
reckoner --version
pytest --cov ./

build-3-8:
executor: python-3-8
working_directory: ~/reckoner
steps:
- run:
name: Setup PATH to support pip user installs
command: echo 'export PATH=$PATH:/home/circleci/.local/bin' >> $BASH_ENV
- checkout
- run:
name: Unit Tests
command: |
pip install --user -r development-requirements.txt
pip install --user -e .
reckoner --version
pytest --cov ./
build-3-9:
executor: python-3-9
working_directory: ~/reckoner
steps:
- run:
name: Setup PATH to support pip user installs
command: echo 'export PATH=$PATH:/home/circleci/.local/bin' >> $BASH_ENV
- checkout
- run:
name: Unit Tests
command: |
pip install --user -r development-requirements.txt
pip install --user -e .
reckoner --version
pytest --cov ./
test-go:
test:
working_directory: /go/src/github.com/fairwindsops/reckoner
docker:
- image: circleci/golang:1.17
Expand All @@ -133,45 +44,23 @@ jobs:
steps:
- checkout
- run: make test
snapshot-go:
snapshot:
working_directory: /go/src/github.com/fairwindsops/reckoner
docker:
- image: quay.io/reactiveops/ci-images:v11-buster
- image: goreleaser/goreleaser:v1.5.0
steps:
- checkout
- *install_go
- *install_goreleaser
- setup_remote_docker
- run:
name: Goreleaser Snapshot
command: goreleaser --snapshot
command: goreleaser --snapshot --skip-sign
- store_artifacts:
path: dist
destination: snapshot
- persist_to_workspace:
root: /go/src/github.com/fairwindsops/reckoner
paths:
- dist
release:
executor: python-3-9
environment:
GITHUB_ORGANIZATION: $CIRCLE_PROJECT_USERNAME
GITHUB_REPOSITORY: $CIRCLE_PROJECT_REPONAME
working_directory: ~/reckoner
steps:
- checkout
- run:
name: init .pypirc
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run:
name: package and upload
command: |
pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*
publish_docs:
docker:
- image: cimg/node:15.5.1
Expand All @@ -186,89 +75,75 @@ jobs:
npm run check-links
npm run build
- run:
name: Install AWS CLI
name: Install Tools
command: |
cd /tmp
echo "Installing AWS CLI"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
echo "Installing Hashicorp Vault"
curl -LO https://releases.hashicorp.com/vault/1.9.3/vault_1.9.3_linux_amd64.zip
unzip vault_1.9.3_linux_amd64.zip
sudo mv vault /usr/bin/vault
sudo chmod +x /usr/bin/vault
vault --version
echo "Installing yq"
curl -LO https://github.com/mikefarah/yq/releases/download/v4.16.2/yq_linux_amd64.tar.gz
tar -zxvf yq_linux_amd64.tar.gz
sudo mv yq_linux_amd64 /usr/bin/yq
sudo chmod +x /usr/bin/yq
yq --version
- rok8s/get_vault_env:
vault_path: repo/reckoner/env
- run:
name: Publish Docs Site to S3
command: |
cd ./dist
aws s3 sync ./ s3://reckoner.docs.fairwinds.com --delete


workflows:
version: 2
build_and_test:
jobs:
- test-go:
filters:
tags:
ignore: /.*/
branches:
only: /.*/
- build-3-7:
filters:
tags:
ignore: /.*/
branches:
only: /.*/
- build-3-8:
- test:
filters:
tags:
ignore: /.*/
branches:
only: /.*/
- build-3-9:
filters:
tags:
ignore: /.*/
branches:
only: /.*/
- snapshot-go:
- snapshot:
requires:
- test-go
- test
filters:
tags:
ignore: /.*/
branches:
only: /.*/
- rok8s/kubernetes_e2e_tests:
name: "End-To-End Kubernetes 1.19 - Python"
kind_node_image: "kindest/node:v1.19.7@sha256:a70639454e97a4b733f9d9b67e12c01f6b0297449d5b9cbbef87473458e26dca"
<<: *e2e_configuration_python
- rok8s/kubernetes_e2e_tests:
name: "End-To-End Kubernetes 1.20 - Python"
kind_node_image: "kindest/node:v1.20.2@sha256:8f7ea6e7642c0da54f04a7ee10431549c0257315b3a634f6ef2fecaaedb19bab"
<<: *e2e_configuration_python
name: "End-To-End Kubernetes 1.20.2"
kind_node_image: "kindest/node:v1.20.2@sha256:15d3b5c4f521a84896ed1ead1b14e4774d02202d5c65ab68f30eeaf310a3b1a7"
<<: *e2e_configuration
- rok8s/kubernetes_e2e_tests:
name: "End-To-End Kubernetes 1.19 - Go"
kind_node_image: "kindest/node:v1.19.7@sha256:a70639454e97a4b733f9d9b67e12c01f6b0297449d5b9cbbef87473458e26dca"
<<: *e2e_configuration_go
name: "End-To-End Kubernetes 1.21.1"
kind_node_image: "kindest/node:v1.21.2@sha256:9d07ff05e4afefbba983fac311807b3c17a5f36e7061f6cb7e2ba756255b2be4"
<<: *e2e_configuration
- rok8s/kubernetes_e2e_tests:
name: "End-To-End Kubernetes 1.20 - Go"
kind_node_image: "kindest/node:v1.20.2@sha256:8f7ea6e7642c0da54f04a7ee10431549c0257315b3a634f6ef2fecaaedb19bab"
<<: *e2e_configuration_go
release:
jobs:
- release:
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- publish_docs:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
- rok8s/github_release:
requires:
- release
filters:
branches:
ignore: /.*/
tags:
only: /.*/
name: "End-To-End Kubernetes 1.22.0"
kind_node_image: "kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047"
<<: *e2e_configuration
# release:
# jobs:
# - publish_docs:
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /.*/
# - rok8s/github_release:
# requires:
# - release
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /.*/
Loading