Skip to content

Commit

Permalink
Merge pull request #289 from dev-sec/release-workflow
Browse files Browse the repository at this point in the history
CI: supermarket upload workflow
  • Loading branch information
artem-sidorenko authored Jun 5, 2023
2 parents 4032847 + 8f56ad3 commit 496f248
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/supermarket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish new supermarket release

env:
cinc_workstation_version: 23
cookbook_name: os-hardening

on:
push:
tags:
- 'v*'

jobs:
supermarket-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
.cache
key: ${{ runner.os }}-${{ env.cinc_workstation_version }}
- name: setup environment
run: |
mkdir -p .cache
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-workstation -d .cache -v ${{ env.cinc_workstation_version }}
- name: setup knife environment
run: |
mkdir -p .cinc cookbooks
cat > .cinc/config.rb <<EOF
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "${{ secrets.SUPERMARKET_LOGIN }}"
client_key "#{current_dir}/key.pem"
chef_server_url "https://api.chef.io/organizations/${{ secrets.SUPERMARKET_LOGIN }}"
cookbook_path ["#{current_dir}/../cookbooks"]
EOF
cat > .cinc/key.pem <<EOF
${{ secrets.SUPERMARKET_KEY }}
EOF
- name: checkout cookbook
uses: actions/checkout@v3
with:
path: cookbooks/${{ env.cookbook_name }}
- name: TEMP change the metadata.rb
run: |
cat > cookbooks/${{ env.cookbook_name }}/metadata.rb <<EOF
name 'artem-test-cookbook'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'All Rights Reserved'
description 'Installs/Configures artem-test-cookbook'
version '0.1.2'
chef_version '>= 16.0'
EOF
- name: upload to the supermarket
run: |
knife supermarket share ${{ env.cookbook_name }}

0 comments on commit 496f248

Please sign in to comment.