saltstack-formulas / docker-formula

Install and set up Docker
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
136 stars 330 forks source link

fix(suse): Fix support to install compose from PackageHub on SLES 15 #296

Open ypid-geberit opened 3 years ago

ypid-geberit commented 3 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

To actually install the packages, you need to set the following in your pillar because the PackageHub repos are not enabled by default on SLES.

docker:
  pkg:
    docker:
      use_upstream: 'package'
    compose:
      use_upstream: 'package'
noelmcloughlin commented 3 years ago

Thanks, very much @ypid-geberit Two Suse checks are failing.

     ×  File /usr/local/bin/docker-compose is expected to be symlink
     expected `File /usr/local/bin/docker-compose.symlink?` to be truthy, got false
     ×  File /usr/local/bin/docker-compose is expected to be file
     expected `File /usr/local/bin/docker-compose.file?` to be truthy, got false

On SUSE this should be /usr/local/bin/python-docker-compose so you may need an IF condition and variable.

Can you update https://github.com/saltstack-formulas/docker-formula/blob/master/test/integration/archive/controls/archive_spec.rb and can be merged afterwards.

ypid-geberit commented 3 years ago

Thanks looking at this! I am new to Test Kitchen and tried to see how to do this now. I found https://kitchen.ci/docs/getting-started/writing-test/ and https://github.com/ssplatt/filebeat-formula/blob/master/test/integration/helpers/serverspec/spec_helper.rb

I am not sure how to best test for the openSUSE version. I found https://docs.chef.io/inspec/resources/os/. Can you give me a hint?

noelmcloughlin commented 3 years ago

I can never remember syntax. I looked at prometheus-formula as reference and suggest this example is probably close to what is needed. Hopefully 'suse' is valid.

control 'docker components' do
  title 'this is just example'

  case platform[:family]
  when 'suse'
    compose_bin = '/usr/local/bin/python-docker-compose'
  else
    compose_bin = '/usr/local/bin/docker-compose'
  end

  describe file("#{compose_bin}") do
    it { should exist }
    its('group') { should eq 'root' }
    its('mode') { should cmp '0644' }
  end
noelmcloughlin commented 3 years ago

My mistake, I see "opensuse" is used in nginx-formula.

# Override by OS
case os[:name]
when 'redhat', 'centos', 'fedora'
  server_available = '/etc/nginx/conf.d'
  server_enabled   = '/etc/nginx/conf.d'
when 'opensuse'
  server_available = '/etc/nginx/vhosts.d'
  server_enabled   = '/etc/nginx/vhosts.d'
end
noelmcloughlin commented 2 years ago

Hi @ypid-geberit Can you amend the commit to lowercase as commitlint is complaining

fix(suse): fix support to install compose from PackageHub on SLES 15

noelmcloughlin commented 2 years ago

Try disabling Suse in .gitlab-ci due to https://github.com/saltstack-formulas/docker-formula/issues/313

ypid-geberit commented 2 years ago

Can you amend the commit to lowercase as commitlint is complaining

All right.

Try disabling Suse in .gitlab-ci due to

I tried that.

PS: Note that I switched jobs and archived this account. I might be slow to respond and it might be quicker when you make those changes directly.