Skip to content

Commit

Permalink
Merge pull request #99 from LyraPhase/develop
Browse files Browse the repository at this point in the history
Release v3.4.0
  • Loading branch information
trinitronx authored May 26, 2022
2 parents a4dcf3e + 61679ee commit e521258
Show file tree
Hide file tree
Showing 22 changed files with 660 additions and 62 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
fail-fast: false

steps:
- name: What is GitHub IP?
run: |
curl -Ls ifconfig.co
- name: Check out code
uses: actions/checkout@v2
- name: Install Chef
Expand Down Expand Up @@ -72,10 +75,10 @@ jobs:
steps:
- name: check the jobs # get the matrix job status and combination info
run: |
job_status=$(curl -X GET -s --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq ".jobs[] | {job_status: .conclusion, matrix: .name}")
echo echo ::set-env JOB_STATUS=$job_status
job_status=$(curl -X GET -s --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq ".jobs[] | {job_status: .conclusion, matrix: .name} | select( .matrix | contains(\"integration\"))")
echo JOB_STATUS=$job_status | tee $GITHUB_ENV
- name: Set matrix job status
if: contains(env.JOB_STATUS, 'failed')
if: contains(env.JOB_STATUS, 'failure')
run: |
echo 'One or more integration matrix jobs failed!'
exit 1
19 changes: 15 additions & 4 deletions .kitchen.libvirt.ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ driver:
provider: libvirt
vagrantfiles:
- 'test/fixtures/Vagrantfile.libvirt-ssh'
synced_folders:
- [".", "/tmp/kitchen/soloist", "disabled: false, type: 'rsync'"]
#synced_folders:
# - [".", "/tmp/kitchen/soloist", "disabled: false, type: 'rsync'"]
# TODO: Find & fix bugs in Vagrant where it checks for vagrant-host path... needs to support remote NFS & 9p libvirt mounts
# TODO: Fix mount: false setting for 9p
# TODO: Fix auto-mount capability for Darwin / macOS... needs mount_9p support (see man mount_9p)
Expand Down Expand Up @@ -77,8 +77,11 @@ platforms:
- name: macos-12.1
lifecycle:
pre_converge:
- local: ssh saturn.local '[[ "$(docker ps -q --filter 'name=kitchen-installer-server-macos-12.1' | wc -l)" == '1' ]] || docker run --name=kitchen-installer-server-macos-12.1 --rm -d -v /media/terabyte/installers/:/var/www:ro -p 8888:8080 trinitronx/python-simplehttpserver'
- remote: sudo mkdir -p /tmp/kitchen
- remote: sudo chown -R vagrant:vagrant /tmp/kitchen
post_converge:
- local: ssh saturn.local '[ $(docker ps -aq --filter 'name=kitchen-installer-server-macos-12.1' | wc -l) -ge 1 ] && docker kill kitchen-installer-server-macos-12.1'
driver:
box: lyraphase-runner/macos-monterey-base
box_url: http://saturn.local:8888/lyraphase-runner-macos-monterey-base.box
Expand All @@ -87,9 +90,17 @@ platforms:
customize:
memory: 4096
# cpus: 2
attributes:
lyraphase_workstation:
ableton_live:
dmg:
source: http://saturn.local:8888/mac/ableton_live_suite_11.1.5_universal.dmg
bitfocus_companion:
dmg:
source: http://saturn.local:8888/mac/bitfocus-companion-2.2.0-ccea40c7-mac-x64.dmg

#suites:
# - name: default
# suites:
# - name: default
# run_list:
# - recipe[sprout-base::default]
# includes: [ubuntu-20.04, macos-latest]
9 changes: 9 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ suites:
- name: default
run_list:
- recipe[lyraphase_workstation::ableton_live]
- recipe[lyraphase_workstation::ableton_live_options]
- recipe[lyraphase_workstation::bashrc]
- recipe[lyraphase_workstation::bitfocus_companion]
attributes:
lyraphase_workstation:
ableton_live:
managed_versions:
- 10.0.1
- 10.1.35
options:
- EnableMapToSiblings
- AutoAdjustMacroMappingRange
- _PluginAutoPopulateThreshold=-1
bashrc:
user_fullname: 'vagrant'
user_email: '[email protected]'
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"chef-software.Chef"
]
}
8 changes: 8 additions & 0 deletions .vscode/lyraphase_workstation.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": ".."
}
],
"settings": {}
}
56 changes: 50 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"*",
"## Sponsor",
"*",
"## Migration",
"*",
"# Attributes",
"*",
"# Recipes",
Expand All @@ -23,9 +25,9 @@

# lyraphase_workstation cookbook

[![ci](https://github.com/trinitronx/lyraphase_workstation/actions/workflows/ci.yml/badge.svg)](https://github.com/trinitronx/lyraphase_workstation/actions/workflows/ci.yml)
[![ci](https://github.com/LyraPhase/lyraphase_workstation/actions/workflows/ci.yml/badge.svg)](https://github.com/LyraPhase/lyraphase_workstation/actions/workflows/ci.yml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pre-commit](https://github.com/LyraPhase/sprout-wrap/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/LyraPhase/sprout-wrap/actions/workflows/pre-commit.yml)
[![pre-commit](https://github.com/LyraPhase/lyraphase_workstation/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/LyraPhase/lyraphase_workstation/actions/workflows/pre-commit.yml)

A cookbook including various recipes for installing tools used by myself.
This includes Ableton Live [DAW][1], VSTs, and other various tools and
Expand Down Expand Up @@ -208,6 +210,48 @@ and help me continue?

Every little bit is appreciated! Thank you! 🙏

## Migration

**Note:** This Chef Cookbook has migrated from the old location
(`trinitronx/lyraphase_workstation`) to `LyraPhase/lyraphase_workstation`.
It has **NOT** changed ownership or maintainers at this time. It has been moved
to benefit from GitHub's CI/CD automation features that are available to a
GitHub Organization.

While all links to the previous repository location are automatically redirected
to the new location by GitHub, it is recommended to migrate any references you
may have, or previously cloned `git` repos to use the new URL.

To avoid confusion, we strongly recommend updating any existing local clones to
point to the new repository URL.

cd path/to/trinitronx/lyraphase_workstation
git remote -vv # List remote repos
# Find the named remote URL with 'trinitronx/lyraphase_workstation'
# (usually 'origin' by default)
# If you checked this repo out as a fork
# or named the remote repo something other than 'origin',
# then use that in the following command
git remote set-url origin https://github.com/LyraPhase/lyraphase_workstation.git
git remote -vv # Check that the remote repo URL now contains 'LyraPhase/lyraphase_workstation'

The cookbook and recipe names have not changed. While generally repo names are
not as important to Chef Infra or Cinc Client, they may appear in dependency
manager files such as:

- `Policyfile`s
- `Berksfile`s
- `Cheffile`s

You can do this easily in your codebase using the following commands:

grep -rin -l 'trinitronx/lyraphase_workstation' ./ | \
xargs -I{} sed -i '' -e 's#trinitronx/lyraphase_workstation#LyraPhase/lyraphase_workstation#g' '{}'
grep -rin -l 'LyraPhase/lyraphase_workstation' ./ | xargs -I{} git add '{}'
git commit -m 'Migrating Cookbook trinitronx/lyraphase_workstation => LyraPhase/lyraphase_workstation'

Then, run your dependency manager tool commands appropriately.

# Attributes

Too many to list! Please see the appropriate recipe's
Expand Down Expand Up @@ -306,7 +350,7 @@ Some general rules of thumb:
- `lyraphase_workstation::korg_kontrol_editor`: Install [Korg Kontrol Editor](http://www.korg.com/us/support/download/software/1/253/1355/)
([Manual](http://www.korg.com/us/support/download/manual/1/253/1843/)
[Archived DL](https://web.archive.org/web/20150919212752/http://www.korg.com/filedl/61a78cbcf754384af8104114d7cde1c7/840/download.php))
- `lyraphase_workstation::loopback_alias_ip`: Install [loopback alias IP LaunchDaemon](https://github.com/trinitronx/lyraphase_workstation/blob/master/templates/default/com.runlevel1.lo0.alias.plist.erb)
- `lyraphase_workstation::loopback_alias_ip`: Install [loopback alias IP LaunchDaemon](https://github.com/LyraPhase/lyraphase_workstation/blob/master/templates/default/com.runlevel1.lo0.alias.plist.erb)
for [SSH Tunneled Proxy Access to VPC / Private Network from a Docker Container][ssh-tunnel-docs]
- Adds support for local [SSH tunnel port forwarding across Docker bridge networks](https://gist.github.com/trinitronx/6427d6454fb3b121fc2ab5ca7ac766bc)
- Use case for `terraform` [explained here](https://github.com/hashicorp/terraform/issues/17754#issuecomment-383227407)
Expand Down Expand Up @@ -388,7 +432,7 @@ Some general rules of thumb:
- `lyraphase_workstation::root_bootstrap_ssh_config`: Installs a minimal
`.ssh/config` + `known_hosts` file for GitHub & Homebrew bootstrap
- `lyraphase_workstation::ssh_tunnel_port_override`: Install
[`ssh-tunnel-port-override.sh` script](https://github.com/trinitronx/lyraphase_workstation/blob/master/templates/default/ssh-tunnel-port-override.sh.erb)
[`ssh-tunnel-port-override.sh` script](https://github.com/LyraPhase/lyraphase_workstation/blob/master/templates/default/ssh-tunnel-port-override.sh.erb)
& `LaunchDaemon` to allow killing some process
(_cough_ McAfee -Anti-virus _cough_ 🦠😷) that claims your favorite SSH tunnel
port (Default: `8081`) on login.
Expand Down Expand Up @@ -432,7 +476,7 @@ Author:: James Cuzella ([@trinitronx][keybase-id])

[1]: https://en.wikipedia.org/wiki/Digital_audio_workstation
[keybase-id]: https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694
[sprout-wrap]: https://github.com/trinitronx/sprout-wrap/
[sprout-wrap]: https://github.com/LyraPhase/sprout-wrap/
[dmg-cookbook]: https://github.com/chef-cookbooks/dmg
[data-bags]: https://docs.chef.io/data_bags.html
[knife-solo_data_bag]: https://github.com/thbishop/knife-solo_data_bag
Expand All @@ -442,4 +486,4 @@ Author:: James Cuzella ([@trinitronx][keybase-id])
[iterm2-shell]: https://www.iterm2.com/documentation-shell-integration.html
[bash-it]: https://github.com/Bash-it/bash-it
[sprout-base]: https://github.com/pivotal-sprout/sprout-base
[ssh-tunnel-docs]: https://github.com/trinitronx/lyraphase_workstation/blob/master/docs/SSH%20Tunneled%20Proxy%20Access%20to%20VPC%20from%20Docker%20Container.md
[ssh-tunnel-docs]: https://github.com/LyraPhase/lyraphase_workstation/blob/master/docs/SSH%20Tunneled%20Proxy%20Access%20to%20VPC%20from%20Docker%20Container.md
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ Good Day Sir! [🟣🎩😬🍫][1]
... So shines a good deed in a weary world ... [😌🙂😄😁][2] <!-- You did it! 🙌 You won! 😁🎏🎊🎉🛗🎶 [You passed the test!][you-passed-the-test] -->

[1]: https://web.archive.org/web/20200512084230/https://www.youtube.com/watch?v=fpK36FZmTFY
[2]: https://raw.githubusercontent.com/trinitronx/lyraphase_workstation/master/SECURITY.md
[2]: https://raw.githubusercontent.com/LyraPhase/lyraphase_workstation/master/SECURITY.md
[you-passed-the-test]: https://web.archive.org/web/20200512094026/https://www.youtube.com/watch?v=dOu2NpXXgiI&lc=UgxfSAyhy6gW4koFlpB4AaABAg
10 changes: 5 additions & 5 deletions attributes/ableton_live.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
default['lyraphase_workstation']['ableton_live'] = {}
default['lyraphase_workstation']['ableton_live']['dmg'] = {}
default['lyraphase_workstation']['ableton_live']['dmg']['source'] = 'http://www.lyraphase.com/doc/installers/mac/ableton_live_suite_10.0.1_64.dmg'
default['lyraphase_workstation']['ableton_live']['dmg']['checksum'] = '73f8b7d9c2e058639466cbb765e6e1610f97f542745e2c69567d7bf55a407e11'
default['lyraphase_workstation']['ableton_live']['dmg']['volumes_dir'] = 'Ableton Live 10 Suite Installer'
default['lyraphase_workstation']['ableton_live']['dmg']['dmg_name'] = 'ableton_live_suite_10.0.1_64'
default['lyraphase_workstation']['ableton_live']['dmg']['app'] = 'Ableton Live 10 Suite'
default['lyraphase_workstation']['ableton_live']['dmg']['source'] = 'http://www.lyraphase.com/doc/installers/mac/ableton_live_suite_11.1.5_universal.dmg'
default['lyraphase_workstation']['ableton_live']['dmg']['checksum'] = 'bbce5e7a5c5632f88fb319df2daaf7ba1b9b0a1af0e94f60ee21d9dd059bf1a7'
default['lyraphase_workstation']['ableton_live']['dmg']['volumes_dir'] = 'Ableton Live 11 Suite Installer'
default['lyraphase_workstation']['ableton_live']['dmg']['dmg_name'] = 'ableton_live_suite_11.1.5_universal'
default['lyraphase_workstation']['ableton_live']['dmg']['app'] = 'Ableton Live 11 Suite'
default['lyraphase_workstation']['ableton_live']['dmg']['type'] = 'app'
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ There is an [upstream bug in Golang to ask for `socks5h://` support in
If this is ever fixed, perhaps Golang code that uses standard `x/net/proxy`
library will _just work_!

[1]: https://github.com/trinitronx/lyraphase_workstation/blob/master/recipes/loopback_alias_ip.rb
[1]: https://github.com/LyraPhase/lyraphase_workstation/blob/master/recipes/loopback_alias_ip.rb
6 changes: 3 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
license "GPL-3.0+"
description "Recipes to Install & Configure my workstation"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "3.3.0"
version "3.4.0"
chef_version ">= 12.0" if respond_to?(:chef_version)

source_url 'https://github.com/trinitronx/lyraphase_workstation' if respond_to?(:source_url)
issues_url 'https://github.com/trinitronx/lyraphase_workstation/issues' if respond_to?(:issues_url)
source_url 'https://github.com/LyraPhase/lyraphase_workstation' if respond_to?(:source_url)
issues_url 'https://github.com/LyraPhase/lyraphase_workstation/issues' if respond_to?(:issues_url)

require 'chef/version_constraint'

Expand Down
8 changes: 7 additions & 1 deletion recipes/ableton_live_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@
Chef::Log.info("Ableton Live Managed Versions: #{ableton_live_managed_versions}")

unless ableton_live_managed_versions.nil? || ableton_live_managed_versions.empty?
# Ensure directories exist if Ableton has never been started yet (installed first time)
directory ableton_preferences_path do
owner node['lyraphase_workstation']['user']
group 'staff'
mode '0755'
action :create
end
ableton_live_managed_versions.each do |ableton_live_version|
# Ensure directory exists if Ableton has never been started yet (installed first time)
directory "#{ableton_preferences_path}/Live #{ableton_live_version}" do
owner node['lyraphase_workstation']['user']
group 'staff'
Expand Down
49 changes: 41 additions & 8 deletions recipes/bashrc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,39 @@

bashrc_path = Pathname.new(File.join(node['lyraphase_workstation']['home'], '.bashrc'))
bash_logout_path = Pathname.new(File.join(node['lyraphase_workstation']['home'], '.bash_logout'))
bash_profile_path = Pathname.new(File.join(node['lyraphase_workstation']['home'], '.bash_profile'))

homebrew_github_api_token = begin
data_bag_item('lyraphase_workstation', 'bashrc')['homebrew_github_api_token']
rescue
nil
end
# Gather Homebrew GitHub token from encrypted data bag
homebrew_github_api_token_data = begin
data_bag_item('lyraphase_workstation', 'bashrc')
rescue
nil
end

if homebrew_github_api_token.nil? && !node['lyraphase_workstation']['bashrc']['homebrew_github_api_token'].nil? && !node['lyraphase_workstation']['bashrc']['homebrew_github_api_token'].nil?
homebrew_github_api_token = node['lyraphase_workstation']['bashrc']['homebrew_github_api_token']
loaded_data = !homebrew_github_api_token_data.nil? ? homebrew_github_api_token_data.to_hash : Hash.new()
homebrew_github_api_token_hash = Hash.new()
['homebrew_github_api_token', 'homebrew_github_api_token_comment'].each do |data_bag_key|
if !homebrew_github_api_token_data.nil? && loaded_data.has_key?(node.name) && loaded_data[node.name].has_key?(data_bag_key)
Chef::Log.info("Loading Homebrew GitHub API token for Node Name: #{node.name}")
homebrew_github_api_token_hash[data_bag_key] = begin
homebrew_github_api_token_data[node.name][data_bag_key]
rescue
nil
end
end

if homebrew_github_api_token_hash[data_bag_key].nil? && !node['lyraphase_workstation']['bashrc'][data_bag_key].nil?
homebrew_github_api_token_hash[data_bag_key] = node['lyraphase_workstation']['bashrc'][data_bag_key]
end

if homebrew_github_api_token_hash[data_bag_key].nil? && !homebrew_github_api_token_data.nil?
Chef::Log.warn("Could not find Homebrew GitHub API token attribute #{data_bag_key} in data bag item lyraphase_workstation:bashrc for Node Name: #{node.name}")
Chef::Log.warn("Expected Data Bag Item Schema: {\"id\": \"bashrc\", \"#{node.name}\": {\"homebrew_github_api_token\": \"gh_f00dcafevagrant\", \"homebrew_github_api_token_comment\": \"some optional comment\"}}")
end
end

if !node['lyraphase_workstation']['bashrc']['homebrew_no_cleanup_formulae'].nil?
homebrew_no_cleanup_formulae = node['lyraphase_workstation']['bashrc']['homebrew_no_cleanup_formulae']
end

template bashrc_path do
Expand All @@ -42,7 +66,9 @@
user_fullname: node['lyraphase_workstation']['bashrc']['user_fullname'],
user_email: node['lyraphase_workstation']['bashrc']['user_email'],
user_gpg_keyid: node['lyraphase_workstation']['bashrc']['user_gpg_keyid'],
homebrew_github_api_token: homebrew_github_api_token
homebrew_github_api_token: homebrew_github_api_token_hash['homebrew_github_api_token'],
homebrew_github_api_token_comment: homebrew_github_api_token_hash['homebrew_github_api_token_comment'],
homebrew_no_cleanup_formulae: homebrew_no_cleanup_formulae
)
end

Expand All @@ -52,3 +78,10 @@
mode '0644'
# No vars needed for now
end

template bash_profile_path do
source 'bash_profile.erb'
user node['lyraphase_workstation']['user']
mode '0644'
variables(user_home: node['lyraphase_workstation']['home'])
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
config.alias_example_group_to :describe_recipe, type: :recipe
config.alias_example_group_to :describe_helpers, type: :helpers
config.alias_example_group_to :describe_resource, type: :resource
config.alias_example_group_to :describe_recipe_with_expected_logs, type: :recipe_with_expected_logs
config.alias_it_behaves_like_to :it_outputs, 'outputs'
config.alias_example_to :it_logs

config.before { stub_const('ENV', ENV.to_hash.merge('SUDO_USER' => 'brubble')) }
config.filter_run_when_matching :focus
Expand Down
Loading

0 comments on commit e521258

Please sign in to comment.