Skip to content

Commit

Permalink
Update centos to centos-stream-8
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Webb <[email protected]>
  • Loading branch information
damacus committed Oct 11, 2023
1 parent 57465ee commit 0c0b666
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
matrix:
os:
- "centos-7"
- "centos-8"
- "ubuntu-1804"
- "centos-stream-8"
- "ubuntu-2004"
- "ubuntu-2204"
suite:
- "default"
fail-fast: false
Expand Down
16 changes: 8 additions & 8 deletions documentation/resource_atlantis_installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

## Properties

| name | Type | Default | Description |
| --------------------------- | --------------- | ------------------------------------------------------------------ | ------------- |
| checksum | String | `a236e7c9df159f8787b143c670f1899dd4bc4349f23ed696468600280fa1266e` | Required |
| download_base_url | String | `https://github.com/runatlantis/atlantis/releases/download` | |
| group | String, Integer | `atlantis` | |
| owner | String | `atlantis` | |
| mode | String, Integer | `0755` | |
| version | String | `0.15.0` | Required |
| name | Type | Default | Description |
| --------------------------- | --------------- | ------------------------------------------------------------------ | ----------- |
| checksum | String | `cc6e7f018de56d4d6e9b580e025da44a8e13d533b47fac73ca36acbeb8531d12` | |
| download_base_url | String | `https://github.com/runatlantis/atlantis/releases/download` | |
| group | String, Integer | `atlantis` | |
| owner | String | `atlantis` | |
| mode | String, Integer | `0755` | |
| version | String | `0.25.0` | |

## Examples

Expand Down
4 changes: 2 additions & 2 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ verifier:

platforms:
- name: centos-7
- name: centos-8
- name: ubuntu-18.04
- name: centos-stream-8
- name: ubuntu-20.04
- name: ubuntu-22.04

suites:
- name: default
Expand Down
18 changes: 16 additions & 2 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@
module AtlantisCookbook
module Helpers
def cpu_arch
if node['kernel']['processor'].match?(/x86_64/)
case node['kernel']['processor']
when /x86_64/
'amd64'
when /armv8/
'arm64'
else
'386'
end
end

def platform
case node['platform']
when 'windows'
'windows'
when 'mac_os_x'
'darwin'
else
'linux'
end
end

def github_download_url(base_url, version)
# https://github.com/runatlantis/atlantis/releases/download/v0.4.4/atlantis_linux_amd64.zip
"#{base_url}/v#{version}/atlantis_linux_#{cpu_arch}.zip"
"#{base_url}/v#{version}/atlantis_$#{platform}_#{cpu_arch}.zip"
end

def hashicorp_download_url(base_url, product, version)
Expand Down
5 changes: 3 additions & 2 deletions resources/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
property :owner, String, default: 'atlantis'

property :mode, [String, Integer], default: '0755'
property :version, String, default: '0.15.0'
property :version, String, default: '0.25.0'
property :ignore_checksum, [true, false], default: false

default_action :install

Expand All @@ -21,7 +22,7 @@
ark 'atlantis' do
url github_download_url(new_resource.download_base_url, new_resource.version)
version new_resource.version
checksum new_resource.checksum unless new_resource.checksum.nil?
checksum new_resource.checksum unless new_resource.ignore_checksum
prefix_root '/opt/atlantis'
prefix_home '/opt/atlantis'
has_binaries ['atlantis']
Expand Down
3 changes: 2 additions & 1 deletion resources/terraform_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
property :append_version_to_file, [true, false], default: false
property :checksum, String, regex: /^[a-zA-Z0-9]{64}$/, default: '35c662be9d32d38815cde5fa4c9fa61a3b7f39952ecd50ebf92fd1b2ddd6109b'
property :download_base_url, String, default: 'https://releases.hashicorp.com'
property :ignore_checksum, [true, false], default: false

property :group, [String, Integer], default: 'atlantis'
property :owner, String, default: 'atlantis'
Expand All @@ -27,7 +28,7 @@
new_resource.version
)
version new_resource.version
checksum new_resource.checksum unless new_resource.checksum.nil?
checksum new_resource.checksum unless new_resource.ignore_checksum
prefix_root '/opt/atlantis'
prefix_home '/opt/atlantis'
owner new_resource.owner
Expand Down
4 changes: 2 additions & 2 deletions resources/terragrunt_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

property :checksum, String, regex: /^[a-zA-Z0-9]{64}$/, default: '3b033389977ca6e7d10bad10514f22fa767c85b76db92befe83e67bafa2c8413'
property :download_base_url, String, default: 'https://github.com/gruntwork-io/terragrunt/releases/download'
property :ignore_checksum, [true, false], default: false

property :group, [String, Integer], default: 'root'
property :owner, [String, Integer], default: 'root'
Expand All @@ -19,8 +20,7 @@
action :install do
remote_file '/usr/local/bin/terragrunt' do
source terragrunt_github_download_url(new_resource.download_base_url, new_resource.version)
checksum new_resource.checksum unless new_resource.checksum.nil?

checksum new_resource.checksum unless new_resource.ignore_checksum
owner new_resource.owner
group new_resource.group
mode new_resource.mode
Expand Down
13 changes: 10 additions & 3 deletions test/cookbooks/test/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@
# install required dependencies
package %w(unzip git)

atlantis_installer 'atlantis'
terraform_installer 'terraform'
atlantis_installer 'atlantis' do
ignore_checksum true
end

terraform_installer 'terraform' do
ignore_checksum true
end

terragrunt_repo_config = {
'repos' => [
Expand Down Expand Up @@ -77,7 +82,9 @@
template_variables terragrunt_repo_config
end

terragrunt_installer 'terragrunt'
terragrunt_installer 'terragrunt' do
ignore_checksum true
end

if node['platform_version'] == '14.04'
atlantis_service_upstart 'atlantis'
Expand Down
4 changes: 2 additions & 2 deletions test/integration/default/atlantis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# if needed you may have to install `coreutils` (package name for deb derivitives)
# root@dokken:/# sha256sum /usr/local/bin/atlantis/atlantis
# c094def53949d658bb3ead360b86a432e3cc48609252621da7855f7fc7f0d136 /usr/local/bin/atlantis/atlantis
its('sha256sum') { should eq 'e4169fdad7cd01809565b723b0c3a30f8119481e1cee79be20cf577f6607865e' }
its('sha256sum') { should eq 'cc6e7f018de56d4d6e9b580e025da44a8e13d533b47fac73ca36acbeb8531d12' }
end

describe command("#{atlantis_bin} version") do
its('stdout') { should match(/(atlantis)\s0.15.0/) }
its('stdout') { should match(/(atlantis)\s0.25.0/) }
its('exit_status') { should eq 0 }
end

Expand Down

0 comments on commit 0c0b666

Please sign in to comment.