Skip to content

Commit

Permalink
Merge branch 'release/v3.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlen committed Jan 18, 2023
2 parents fb4f97b + 587a461 commit c69ddb4
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci/Jobs/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ publish-pro-non-root:
- *docker-authentication
- *publish-command
rules:
- if: '$PASSBOLT_VERSION && $CI_COMMIT_BRANCH == "master" && $PASSBOLT_FLAVOUR == "pro"'
- if: '$PASSBOLT_VERSION && $CI_COMMIT_BRANCH == "master" && $PASSBOLT_PUBLISH == "pro"'
when: on_success

8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v3.8.0...HEAD)
## [Unreleased](https://github.com/passbolt/passbolt_docker/compare/v3.8.1...HEAD)

## [3.8.1](https://github.com/passbolt/passbolt_docker/compare/v3.8.0...v3.8.1) - 2023-01-18

### Changed

- Minor changes on the internal publishing process

## [3.8.0](https://github.com/passbolt/passbolt_docker/compare/v3.7.5...v3.8.0) - 2023-01-13

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ group :test do
gem 'serverspec'
gem 'pry'
end

33 changes: 25 additions & 8 deletions spec/docker_image/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@
'PASSBOLT_GPG_KEYRING' => '/var/lib/passbolt/.gnupg'
}

@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile, 'buildargs' => JSON.generate($buildargs) } )
if ENV['GITLAB_CI']
Docker.authenticate!(
'username' => ENV['CI_REGISTRY_USER'].to_s,
'password' => ENV['CI_REGISTRY_PASSWORD'].to_s,
'serveraddress' => 'https://registry.gitlab.com/'
)
if ENV['ROOTLESS']
@image = Docker::Image.create('fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-rootless-latest")
else
@image = Docker::Image.create('fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-root-latest")
end
else
@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile, 'buildargs' => JSON.generate($buildargs) } )
end
set :docker_image, @image.id
set :docker_container_create_options, { 'Cmd' => '/bin/sh' }
end
Expand Down Expand Up @@ -67,14 +80,18 @@
expect(file(wait_for)).to exist and be_executable
end
end

describe 'entrypoint' do
it 'is installed' do
expect(file('/docker-entrypoint.sh')).to exist and be_executable
expect(file('/passbolt/entrypoint.sh')).to exist and be_owned_by(passbolt_owner)
expect(file('/passbolt/env.sh')).to exist and be_owned_by(passbolt_owner)
expect(file('/passbolt/entropy.sh')).to exist and be_owned_by(passbolt_owner)
expect(file('/passbolt/deprecated_paths.sh')).to exist and be_executable
expect(file('/docker-entrypoint.sh')).to exist and be_executable.by(passbolt_owner)
if ENV['ROOTLESS'] == 'true'
expect(file('/passbolt/entrypoint-rootless.sh')).to exist and be_readable.by(passbolt_owner)
else
expect(file('/passbolt/entrypoint.sh')).to exist and be_readable.by(passbolt_owner)
end
expect(file('/passbolt/env.sh')).to exist and be_readable.by(passbolt_owner)
expect(file('/passbolt/entropy.sh')).to exist and be_readable.by(passbolt_owner)
expect(file('/passbolt/deprecated_paths.sh')).to exist and be_readable.by(passbolt_owner)
end
end

Expand Down Expand Up @@ -137,7 +154,7 @@
describe 'ports exposed' do
it 'exposes port' do
exposed_ports.each do |port|
expect(@image.json['ContainerConfig']['ExposedPorts']).to include("#{port}/tcp")
expect(@image.json['Config']['ExposedPorts']).to include("#{port}/tcp")
end
end
end
Expand Down
26 changes: 20 additions & 6 deletions spec/docker_runtime/runtime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
before(:all) do
if ENV['GITLAB_CI']
@mysql_image = Docker::Image.create('fromImage' => 'registry.gitlab.com/passbolt/passbolt-ci-docker-images/mariadb-10.3:latest')
else
else
@mysql_image = Docker::Image.create('fromImage' => 'mariadb:latest')
end

Expand All @@ -16,10 +16,10 @@
'MYSQL_USER=passbolt',
'MYSQL_PASSWORD=±!@#$%^&*()_+=-}{|:;<>?'
],
"Healthcheck" => {
'Healthcheck' => {
"Test": [
"CMD-SHELL",
"mysqladmin ping --silent"
'CMD-SHELL',
'mysqladmin ping --silent'
]
},
'Image' => @mysql_image.id)
Expand All @@ -29,7 +29,21 @@
sleep 1
end

@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile, 'buildargs' => JSON.generate($buildargs) } )
if ENV['GITLAB_CI']
Docker.authenticate!(
'username' => ENV['CI_REGISTRY_USER'].to_s,
'password' => ENV['CI_REGISTRY_PASSWORD'].to_s,
'serveraddress' => 'https://registry.gitlab.com/'
)
if ENV['ROOTLESS']
@image = Docker::Image.create('fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-rootless-latest")
else
@image = Docker::Image.create('fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-root-latest")
end
else
@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile, 'buildargs' => JSON.generate($buildargs) } )
end

@container = Docker::Container.create(
'Env' => [
"DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}",
Expand All @@ -54,7 +68,7 @@
end

let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] }
let(:uri) { "/healthcheck/status.json" }
let(:uri) { '/healthcheck/status.json' }
let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" }

describe 'php service' do
Expand Down
17 changes: 15 additions & 2 deletions spec/docker_runtime_no_envs/runtime_no_envs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
before(:all) do
if ENV['GITLAB_CI']
@mysql_image = Docker::Image.create('fromImage' => 'registry.gitlab.com/passbolt/passbolt-ci-docker-images/mariadb-10.3:latest')
else
else
@mysql_image = Docker::Image.create('fromImage' => 'mariadb:latest')
end
@mysql = Docker::Container.create(
Expand All @@ -28,7 +28,20 @@
sleep 1
end

@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile, 'buildargs' => JSON.generate($buildargs) } )
if ENV['GITLAB_CI']
Docker.authenticate!(
'username' => ENV['CI_REGISTRY_USER'].to_s,
'password' => ENV['CI_REGISTRY_PASSWORD'].to_s,
'serveraddress' => 'https://registry.gitlab.com/'
)
if ENV['ROOTLESS']
@image = Docker::Image.create('fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-rootless-latest")
else
@image = Docker::Image.create('fromImage' => "#{ENV['CI_REGISTRY_IMAGE']}:#{ENV['PASSBOLT_FLAVOUR']}-root-latest")
end
else
@image = Docker::Image.build_from_dir(ROOT_DOCKERFILES, { 'dockerfile' => $dockerfile, 'buildargs' => JSON.generate($buildargs) } )
end

@container = Docker::Container.create(
'Env' => [
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
)
end

if ENV['ROOTLESS'] == true
if ENV['ROOTLESS'] == 'true'
$cron_binary = '/usr/local/bin/supercronic'
$dockerfile = 'debian/Dockerfile.rootless'
$http_port = '8080'
Expand Down

0 comments on commit c69ddb4

Please sign in to comment.