Skip to content

Commit

Permalink
add reconfigure when server and supermarket are updated (#2)
Browse files Browse the repository at this point in the history
* add reconfigure when server and supermarket are updated
add github actions ci/cd pipelines and testing
  • Loading branch information
Stromweld authored Aug 3, 2022
1 parent 4bce8be commit 93f9c0c
Show file tree
Hide file tree
Showing 24 changed files with 481 additions and 411 deletions.
32 changes: 0 additions & 32 deletions .delivery/project.toml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
* text eol=lf
19 changes: 19 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- WIP
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: This issue has been closed due to no activity please reopen if you believe this is still an issue.
13 changes: 13 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
on:
push:
branches:
- main

jobs:
supermarket-deploy:
uses: Stromweld/github-workflows/.github/workflows/cookbook-supermarket-deploy.yml@main
secrets: inherit
with:
SUPERMARKET_USER: "stromweld"
SUPERMARKET_URL: "https://supermarket.chef.io"
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
on:
pull_request:

jobs:
markdownlint:
uses: Stromweld/github-workflows/.github/workflows/markdownlint.yml@main

yamllint:
uses: Stromweld/github-workflows/.github/workflows/yamllint.yml@main

jsonlint:
uses: Stromweld/github-workflows/.github/workflows/jsonlint.yml@main

cookstylelint:
uses: Stromweld/github-workflows/.github/workflows/cookstylelint.yml@main

integration-dokken:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- amazonlinux-2
# - amazonlinux-2022
- centos-7
- centos-8
- almalinux-8
# - almalinux-9 # TODO: uncomment this when almalinux-9 dokken image is fixed
- ubuntu-2004
- ubuntu-2204
suite:
- default
- automate
- supermarket
exclude:
- os: centos-7
suite: default
- os: ubuntu-2204
suite: default
- os: ubuntu-2204
suite: supermarket
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@main
- name: Install Chef
uses: actionshub/chef-install@main
- name: Test-Kitchen Converge
uses: actionshub/test-kitchen@main
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
action: converge
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
continue-on-error: false
- name: Test-Kitchen Verify
uses: actionshub/test-kitchen@main
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
action: verify
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml

check:
if: always()
needs:
- markdownlint
- yamllint
- jsonlint
- cookstylelint
- integration-dokken
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@main
with:
allowed-failures:
allowed-skips:
jobs: ${{ toJSON(needs) }}
2 changes: 1 addition & 1 deletion .mdlrc
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rules "~MD013"
rules "~MD013", "~MD034"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file is used to list changes made in each version of the chef_software cookbook.

## 1.1.1 (2022-08-02)

- [Corey Hemminger] - Fix server and supermarket's to run reconfigure after an update
- [Corey Hemminger] - Add github actions CI/CD pipelines and testing

## 1.1.0 (2020-08-07)

Expand Down
106 changes: 1 addition & 105 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,105 +1 @@
# Contributing to the chef_software cookbook

We are glad you want to contribute to the chef_software cookbook! The first
step is the desire to improve the project.

## Quick-contribute

* Create an issue on the github [issue tracker](https://github.com/Stromweld/chef_software/issues)
* Link to your patch as a rebased git branch or pull request from the ticket

We regularly review contributions and will get back to you if we have
any suggestions or concerns.

### Branches and Commits

You should submit your patch as a git branch named after the change.

It is a best practice to have your commit message have a _summary
line_, followed by an empty line and then a brief description of
the commit. This also helps other contributors understand the
purpose of changes to the code.

Remember that not all users use Chef in the same way or on the same
operating systems as you, so it is helpful to be clear about your use
case and change so they can understand it even when it doesn't apply
to them.

### Github and Pull Requests

We don't require you to use Github, and we will even take patch diffs
attached to tickets on the issue tracker. However Github has a lot of
convenient features, such as being able to see a diff of changes
between a pull request and the main repository quickly without
downloading the branch.

## Functional and Unit Tests

This cookbook is set up to run tests under
[Test Kitchen](http://kitchen.ci/). It uses serverspec to run
integration tests after the node has been converged to verify that
the state of the node.

Test kitchen should run completely without exception using the default
[baseboxes provided by Chef](http://chef.github.io/bento/).
Because Test Kitchen creates VirtualBox machines and runs through
every configuration in the .kitchen.yml file, it may take some time for
these tests to complete.

If your changes are only for a specific recipe, run only its
configuration with Test Kitchen. If you are adding a new recipe, or
other functionality such as a LWRP or definition, please add
appropriate tests and ensure they run with Test Kitchen.

If any don't pass, investigate them before submitting your patch.

Any new feature should have unit tests included with the patch with
good code coverage to help protect it from future changes. Similarly,
patches that fix a bug or regression should have a _regression test_.
Simply put, this is a test that would fail without your patch but
passes with it. The goal is to ensure this bug doesn't regress in the
future. Consider a regular expression that doesn't match a certain
pattern that it should, so you provide a patch and a test to ensure
that the part of the code that uses this regular expression works as
expected. Later another contributor may modify this regular expression
in a way that breaks your use cases. The test you wrote will fail,
signalling to them to research your ticket and use case and accounting
for it.

If you need help writing tests, please ask on the Chef Developer's
mailing list, or https://community-slack.chef.io/

## Cookbook Contribution Do's and Don't's

Please do include tests for your contribution. If you need help, ask
on the
[chef-dev mailing list](http://lists.chef.io/sympa/info/chef-dev)
or the https://community-slack.chef.io/

Not all platforms that a cookbook supports may be supported by Test
Kitchen. Please provide evidence of testing your contribution if it
isn't trivial so we don't have to duplicate effort in testing. Chef
10.14+ "doc" formatted output is sufficient.

Please do indicate new platform (families) or platform versions in the
commit message, and update the relevant ticket. If a contribution adds
new platforms or platform versions, indicate such in the body of the commit message(s).

Please do use [foodcritic](http://www.foodcritic.io/) to
lint-check the cookbook. Except FC007, it should pass all correctness
rules. FC007 is okay as long as the dependent cookbooks are *required*
for the default behavior of the cookbook, such as to support an
uncommon platform, secondary recipe, etc.

Please do ensure that your changes do not break or modify behavior for
other platforms supported by the cookbook. For example if your changes
are for Debian, make sure that they do not break on CentOS.

Please do not modify the version number in the metadata.rb, the maintainer
will select the appropriate version based on the release cycle
information above.

Please do not update the CHANGELOG.md for a new version. Not all
changes to a cookbook may be merged and released in the same versions.
We will update the CHANGELOG.md when releasing a new version of
the cookbook.
Please refer to <https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD>
Loading

0 comments on commit 93f9c0c

Please sign in to comment.