From ce91d1ea4c323004b1e431f4146b35b6d64d4971 Mon Sep 17 00:00:00 2001 From: Diego Lendoiro Date: Mon, 30 Dec 2024 14:07:35 +0000 Subject: [PATCH 1/3] PB-37351: Fix test mounts --- .github/workflows/push_pr_main.yaml | 40 +++++++++++++++++++ .github/workflows/release.yaml | 10 +++-- RELEASE_NOTES.md | 3 ++ .../runtime_no_envs_spec.rb | 23 ++++++----- .../docker_runtime_with_passbolt_php_spec.rb | 6 ++- 5 files changed, 66 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/push_pr_main.yaml create mode 100644 RELEASE_NOTES.md diff --git a/.github/workflows/push_pr_main.yaml b/.github/workflows/push_pr_main.yaml new file mode 100644 index 0000000..2133f39 --- /dev/null +++ b/.github/workflows/push_pr_main.yaml @@ -0,0 +1,40 @@ +name: Push & PR to the main branch + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + lint: + name: Passbolt CE Rootless-${{ matrix.rootless}} ${{ matrix.test_name }} + runs-on: ubuntu-latest + strategy: + matrix: + test_name: + [ + "docker_image", + "docker_runtime", + "docker_runtime_no_envs", + "docker_runtime_with_passbolt_php", + ] + rootless: [true, false] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3.5" + bundler-cache: true + - env: + PASSBOLT_COMPONENT: "stable" + PASSBOLT_FLAVOUR: "ce" + ROOTLESS: ${{ matrix.rootless }} + TEST_NAME: ${{ matrix.test_name }} + run: | + bundle exec rake spec:$TEST_NAME diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 380c06d..1454c64 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,7 @@ on: push: tags: - - '*' + - "*" jobs: create-shasums: runs-on: ubuntu-latest @@ -15,6 +15,8 @@ jobs: sha512sum docker-compose-pro.yaml > docker-compose-pro-SHA512SUM.txt && sha512sum ../dev/docker-compose-dev.yaml > docker-compose-dev-SHA512SUM.txt && sha512sum docker-compose-ce-postgresql.yaml > docker-compose-ce-postgresql-SHA512SUM.txt - - uses: ncipollo/release-action@v1 - with: - artifacts: "docker-compose/docker-compose-*.yaml, docker-compose/*SHA512SUM.txt" + - env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + name: Create Release + run: | + gh release create "${GITHUB_REF#refs/*/}" -t "${GITHUB_REF#refs/*/}" --notes-file RELEASE_NOTES.md docker-compose/docker-compose-*.yaml docker-compose/*SHA512SUM.txt diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..2eb8b66 --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,3 @@ +Announcing the immediate availability of passbolt's docker image 4.1.0. + +This is a minor change that fixes a logging issue where 500 errors where not redirected to standard output. Also, it fixed issues on image testing and added the release notes automation on github. diff --git a/spec/docker_runtime_no_envs/runtime_no_envs_spec.rb b/spec/docker_runtime_no_envs/runtime_no_envs_spec.rb index dbedcef..6ef4223 100644 --- a/spec/docker_runtime_no_envs/runtime_no_envs_spec.rb +++ b/spec/docker_runtime_no_envs/runtime_no_envs_spec.rb @@ -41,11 +41,14 @@ 'Env' => [ "DATASOURCES_DEFAULT_HOST=#{@mysql.json['NetworkSettings']['IPAddress']}" ], - 'Binds' => $binds.append( - "#{FIXTURES_PATH + '/passbolt.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}", - "#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}", - "#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}" - ), + 'HostConfig' => { + 'Binds' => $binds.append( + "#{FIXTURES_PATH + '/passbolt.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}", + "#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}", + "#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}" + ) + }, + 'Image' => @image.id ) @@ -61,9 +64,7 @@ @container.kill end - let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] } - let(:uri) { '/install' } - let(:curl) { "curl -skL -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" } + let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] } describe 'php service' do it 'is running supervised' do @@ -91,9 +92,11 @@ end end - describe 'passbolt install' do + describe 'passbolt healthcheck' do + 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}" } it 'shows correctly' do - expect(command(curl).stdout).to match(/.*Passbolt is not configured yet!.*/) + expect(command(curl).stdout).to eq '200' end end diff --git a/spec/docker_runtime_with_passbolt_php/docker_runtime_with_passbolt_php_spec.rb b/spec/docker_runtime_with_passbolt_php/docker_runtime_with_passbolt_php_spec.rb index 878b242..467865f 100644 --- a/spec/docker_runtime_with_passbolt_php/docker_runtime_with_passbolt_php_spec.rb +++ b/spec/docker_runtime_with_passbolt_php/docker_runtime_with_passbolt_php_spec.rb @@ -58,11 +58,13 @@ 'PASSBOLT_HEALTHCHECK_ERROR=true' ], 'Image' => @image.id, - 'Binds' => $binds.append( + 'HostConfig' => { + 'Binds' => $binds.append( "#{FIXTURES_PATH + '/passbolt-no-fingerprint.php'}:#{PASSBOLT_CONFIG_PATH + '/passbolt.php'}", "#{FIXTURES_PATH + '/public-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure.key'}", "#{FIXTURES_PATH + '/private-test.key'}:#{PASSBOLT_CONFIG_PATH + 'gpg/unsecure_private.key'}" - ) + ) + }, ) @container.start From f9b26e9797fe2bdc2aab5ca7d390731386b38e72 Mon Sep 17 00:00:00 2001 From: Diego Lendoiro Date: Mon, 30 Dec 2024 16:18:54 +0100 Subject: [PATCH 2/3] Typos --- RELEASE_NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2eb8b66..86c1134 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,4 @@ Announcing the immediate availability of passbolt's docker image 4.1.0. -This is a minor change that fixes a logging issue where 500 errors where not redirected to standard output. Also, it fixed issues on image testing and added the release notes automation on github. +This is a minor change that fixes a logging issue where 500 errors were not redirected to standard output. +Also, it fixes issues on image testing and added the release notes automation on GitHub. From 083e4187853a688462ce52e541609ab61628ebdd Mon Sep 17 00:00:00 2001 From: Diego Lendoiro Date: Mon, 30 Dec 2024 16:19:59 +0100 Subject: [PATCH 3/3] Use master branch --- .github/workflows/push_pr_main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_pr_main.yaml b/.github/workflows/push_pr_main.yaml index 2133f39..27571fc 100644 --- a/.github/workflows/push_pr_main.yaml +++ b/.github/workflows/push_pr_main.yaml @@ -3,10 +3,10 @@ name: Push & PR to the main branch on: push: branches: - - main + - master pull_request: branches: - - main + - master workflow_dispatch: jobs: