GithubHelp home page GithubHelp logo

afazekas / ci-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openstack-k8s-operators/ci-framework

0.0 0.0 0.0 1.06 MB

CI Framework - used for CI, QE and Devs to run jobs in a converged way

License: Apache License 2.0

Shell 20.08% Python 22.28% Go 35.07% Makefile 7.37% Jinja 15.21%

ci-framework's Introduction

CI-Framework

CodeQL

Still under heavy development - more info coming soon.

Use Makefile for your own CI

Container available for Prow

You can point to our container in your project:

build_root:
  cifmw:
    name: "ci-framework-image"
    tag: "latest"
    namespace: "openstack-k8s-operators"
tests:
- as: pre-commit
  from: cifmw
  clone: true
  commands: |
    export HOME=/tmp
    export ANSIBLE_LOCAL_TMP=/tmp
    export ANSIBLE_REMOTE_TMP=/tmp
    make -C ../ci-framework pre_commit_nodeps BASEDIR ./

Please refer to the make manpage for more fun! Please refer to the openshift CI doc as well as the ci-operator for more details.

Targets of interest

ci_ctx

That one will build you a container in order to run the checks

run_ctx_pre_commit

That one will run the pre-commit check in a container.

run_ctx_molecule

That one will run molecule against the role. Note That, if needed, you can pass different parameters:

$ make run_ctx_molecule BUILD_VENV_CTX=yes MOLECULE_CONFIG=.config/molecule/config_local.yml

Run molecule in a freshly built container, using the "config_local.yml" file. Note that this configuration file is mandatory for running molecule from within the container

molecule_nodeps

$ make molecule_nodeps BUILD_VENV_CTX=no \
    MOLECULE_CONFIG=.config/molecule/config_local.yml \
    ROLE_DIR=../my-repo/roles

This one is a bit more tricky: it means you are in a deployed env (for instance a container built using make ci_ctx) with a 3rd-party repository available in /opt/my-repo. You can get this by running the following:

$ podman run --rm -ti --security-opt label=disable \
    -v .:/opt/sources \
    -v ../my-repo:/opt/my-repo \
    cfwm:latest bash

Then, just run the make command with the right parameters.

Contribute

Add a new Ansible role

Run the following command to get your new role in:

$ make new_role ROLENAME=wonderful_role

Run tests

Makefile

Run make help to list the available targets. Usually, you'll want to run make run_ctx_pre_commit or make run_ctx_molecule to run the tests in a local container.

Using the framework

deploy-edpm.yml playbook

This playbook is the entrypoint in order to deploy EDPM on an infrastructure. Note that, later on, it won't allow to be launched from within the repository directly, but from the install_yamls one (there will be some new targets in their Makefile, but we're not there yet)

$ ansible-playbook \
    deploy-edpm.yml \
    -e @scenarios/centos-9/base.yml \
    -e @scenarios/centos-9/install_yamls

cleanup-edpm.yml

This playbook cleans everything deployed by the framework - from the deployed infrastructure to the various artifacts.

License

Copyright 2023.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.