Skip to content

Commit

Permalink
[#185500801] Updated cf-cli and fixed acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
malcgds committed Jul 7, 2023
1 parent 826b547 commit a04acc4
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 19 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build-image-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
default: linux/amd64
type: string
description: "Platforms to build for"
test_platform:
default: linux/amd64
type: string
description: "Platform to use for acceptance tests"

secrets:
CI_USER_USERNAME:
Expand Down Expand Up @@ -105,8 +109,8 @@ jobs:
files: "./${{ inputs.image }}/${{ inputs.image }}_spec.rb"

- name: Build for acceptance test
if: steps.check_for_tests.outputs.files_exist == 'true'
uses: docker/build-push-action@v3.2.0
if: steps.check_for_tests.outputs.files_exists == 'true'
uses: docker/build-push-action@v4
with:
context: ./${{ inputs.image }}
file: ./${{ inputs.image }}/${{inputs.dockerfile}}
Expand All @@ -115,21 +119,21 @@ jobs:
labels: ${{ steps.meta-ghcr.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ inputs.platforms }}
platforms: ${{ inputs.test_platform }}

- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
if: steps.check_for_tests.outputs.files_exist == 'true'
if: steps.check_for_tests.outputs.files_exists == 'true'
- name: Acceptance Tests
env:
DOCKER_IMAGE: "${{ env.TEST_TAG }}"
run: bundle exec rspec ./${{ inputs.image }}/${{ inputs.image }}_spec.rb
if: steps.check_for_tests.outputs.files_exist == 'true'
if: steps.check_for_tests.outputs.files_exists == 'true'

- name: Build and push to ghcr
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v4
with:
context: ./${{ inputs.image }}
platforms: ${{ inputs.platforms }}
Expand All @@ -147,7 +151,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push to docker hub
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v4.1.1
with:
context: ./${{ inputs.image }}
platforms: ${{ inputs.platforms }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/image_alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: alpine
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_awscli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: awscli
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_curl-ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: curl-ssl
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_git-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: git-ssh
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: golang
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_json-minify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: json-minify
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_node-chromium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: node-chromium
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: node
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_paas-prometheus-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: paas-prometheus-exporter
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_psql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: psql
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_ruby-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: ruby-base
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: ruby
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/image_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
with:
image: ubuntu
platforms: linux/amd64,linux/arm64
test_platform: linux/amd64
secrets: inherit
4 changes: 2 additions & 2 deletions bosh-cli-v2/bosh-cli-v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
require 'docker'
require 'serverspec'

BOSH_CLI_VERSION="6.4.4-3c1a893c-2021-06-11T20:26:27Z"
CREDHUB_VERSION='2.9.0'
BOSH_CLI_VERSION="6.4.17-f0454a75-2022-02-25T00:42:57Z"
CREDHUB_VERSION='2.9.14'

BOSH_ENV_DEPS = "build-essential zlibc zlib1g-dev openssl libxslt1-dev libxml2-dev \
libssl-dev libreadline7 libreadline-dev libyaml-dev libsqlite3-dev sqlite3"
Expand Down
4 changes: 2 additions & 2 deletions certstrap/certstrap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'serverspec'

CERTSTRAP_BIN = "/usr/local/bin/certstrap"
CERTSTRAP_VERSION = "1.2.0"
CERTSTRAP_VERSION = "1.3.0"
CERTSTRAP_PACKAGES = "openssl curl"

describe "certstrap image" do
Expand All @@ -12,7 +12,7 @@
}

it "installs the right version of Ubuntu Linux" do
expect(os_version).to include("Ubuntu 20.04")
expect(os_version).to include("Ubuntu 18.04.6")
expect(os_version).to include("LTS")
end

Expand Down
2 changes: 1 addition & 1 deletion cf-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/alphagov/paas/ruby-base:main

ENV PACKAGES "unzip curl openssl ca-certificates git libc6-compat bash jq gettext make"
ENV CF_CLI_VERSION "8.6.0"
ENV CF_CLI_VERSION "8.7.1"
ENV SPRUCE_VERSION "1.30.2"

RUN apk add --no-cache $PACKAGES
Expand Down
6 changes: 3 additions & 3 deletions cf-cli/cf-cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
require 'docker'
require 'serverspec'

CF_CLI_VERSION="8.6.0"
CF_CLI_VERSION="8.7.1"
SPRUCE_BIN = "/usr/local/bin/spruce"
SPRUCE_VERSION = "1.27.0"
SPRUCE_VERSION = "1.30.2"

describe "cf-cli image" do
before(:all) {
Expand Down Expand Up @@ -72,7 +72,7 @@

it "has the spruce version #{SPRUCE_VERSION}" do
spruce_version = command("spruce --version").stdout.strip
expect(spruce_version).to match(/spruce - Version #{SPRUCE_VERSION}( \(master\))?/)
expect(spruce_version).to match(/spruce - Version v#{SPRUCE_VERSION}/)
end

it "has `bash` available" do
Expand Down
2 changes: 1 addition & 1 deletion cf-uaac/cf-uaac_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'docker'
require 'serverspec'

UAAC_VERSION="4.7.0"
UAAC_VERSION="4.14.0"

describe "cf-uaac image" do
before(:all) {
Expand Down
2 changes: 1 addition & 1 deletion psql/psql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'docker'
require 'serverspec'

PSQL_PACKAGE = 'postgresql-client'
PSQL_PACKAGE = 'postgresql14-client'
ALPINE_VERSION = "3.16"

describe "psql image" do
Expand Down
4 changes: 2 additions & 2 deletions spruce/spruce_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'serverspec'

SPRUCE_BIN = "/usr/local/bin/spruce"
SPRUCE_VERSION = "1.27.0"
SPRUCE_VERSION = "1.30.2"
ALPINE_VERSION = "3.16"

describe "spruce image" do
Expand All @@ -28,7 +28,7 @@ def os_version
end

it "has the spruce version #{SPRUCE_VERSION}" do
expect(spruce_version).to match(/spruce - Version #{SPRUCE_VERSION}( \(master\))?/)
expect(spruce_version).to match(/spruce - Version v#{SPRUCE_VERSION}/)
end

def spruce_version
Expand Down

0 comments on commit a04acc4

Please sign in to comment.