Skip to content

Commit

Permalink
Update CI tools and images (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
madddi authored and mrparkers committed Jan 20, 2020
1 parent 3673d4c commit a103c5f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 20 deletions.
45 changes: 33 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ workflows:
version: 2
test:
jobs:
- test
- test-7.0.1
- test-8.0.1
release:
jobs:
- test:
Expand All @@ -20,16 +21,19 @@ workflows:
only: /\d+\.\d+\.\d+(-rc.\d+)?/
branches:
ignore: /.*/
jobs:
test:
docker:
- image: circleci/golang:1.11.4
- image: jboss/keycloak:8.0.0
environment:
DB_VENDOR: H2
KEYCLOAK_LOGLEVEL: DEBUG
KEYCLOAK_USER: keycloak
KEYCLOAK_PASSWORD: password

defaults:
go_image: &go_image
- image: circleci/golang:1.13.5

keycloak_env: &keycloak_env
environment:
DB_VENDOR: H2
KEYCLOAK_LOGLEVEL: DEBUG
KEYCLOAK_USER: keycloak
KEYCLOAK_PASSWORD: password

testacc_job: &testacc_job
working_directory: /go/src/github.com/mrparkers/terraform-provider-keycloak
steps:
- checkout
Expand All @@ -53,9 +57,25 @@ jobs:
KEYCLOAK_URL: "http://localhost:8080"
KEYCLOAK_REALM: "master"
KEYCLOAK_TEST_PASSWORD_GRANT: "true"

jobs:
test-7.0.1:
docker:
- <<: *go_image
- image: jboss/keycloak:7.0.1
<<: *keycloak_env
<<: *testacc_job

test-8.0.1:
docker:
- <<: *go_image
- image: jboss/keycloak:8.0.1
<<: *keycloak_env
<<: *testacc_job

build-and-release:
docker:
- image: circleci/golang:1.11.4
- <<: *go_image
environment:
GO111MODULE: "on"
working_directory: /go/src/github.com/mrparkers/terraform-provider-keycloak
Expand All @@ -69,3 +89,4 @@ jobs:
command: |
./scripts/build-release.sh
./scripts/publish-release.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GO111MODULE=on go mod download && make build

## Supported Versions

Currently, this provider is tested against Terraform v0.12.1 and Keycloak v8.0.0. I personally use this provider with Terraform v0.11.x and Keycloak 4.8.3.Final.
Currently, this provider is tested against Terraform v0.12.1 and Keycloak v8.0.1. I personally use this provider with Terraform v0.11.x and Keycloak 4.8.3.Final.

In the future, it would be nice to [run acceptance tests using different versions of Terraform / Keycloak](https://github.com/mrparkers/terraform-provider-keycloak/issues/111). Please feel free to submit a PR if you believe you can help with this.

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ services:
- POSTGRES_DB=keycloak
- POSTGRES_USER=keycloak
- POSTGRES_PASSWORD=password
image: postgres:9.6
image: postgres:12
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql
openldap:
image: osixia/openldap:1.2.2
image: osixia/openldap:1.3.0
ports:
- 8389:389
keycloak:
image: jboss/keycloak:8.0.0
image: jboss/keycloak:8.0.1
depends_on:
- postgres
- openldap
Expand Down
4 changes: 2 additions & 2 deletions keycloak/openid_audience_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ func (keycloakClient *KeycloakClient) ValidateOpenIdAudienceProtocolMapper(mappe
}

if mapper.ClientId != "" && mapper.ClientScopeId != "" {
return fmt.Errorf("validataion error: ClientId and ClientScopeId cannot both be set")
return fmt.Errorf("validation error: ClientId and ClientScopeId cannot both be set")
}

if mapper.IncludedClientAudience == "" && mapper.IncludedCustomAudience == "" {
return fmt.Errorf("validation error: one of IncludedClientAudience or IncludedCustomAudience must be set")
}

if mapper.IncludedClientAudience != "" && mapper.IncludedCustomAudience != "" {
return fmt.Errorf("validataion error: IncludedClientAudience and IncludedCustomAudience cannot both be set")
return fmt.Errorf("validation error: IncludedClientAudience and IncludedCustomAudience cannot both be set")
}

protocolMappers, err := keycloakClient.listGenericProtocolMappers(mapper.RealmId, mapper.ClientId, mapper.ClientScopeId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func TestAccKeycloakOpenIdAudienceProtocolMapper_validateClientConflictsWithClie
Steps: []resource.TestStep{
{
Config: testKeycloakOpenIdAudienceProtocolMapper_validateClientConflictsWithClientScope(realmName, clientId, clientScopeId, mapperName),
ExpectError: regexp.MustCompile("validataion error: ClientId and ClientScopeId cannot both be set"),
ExpectError: regexp.MustCompile("validation error: ClientId and ClientScopeId cannot both be set"),
},
},
})
Expand All @@ -255,7 +255,7 @@ func TestAccKeycloakOpenIdAudienceProtocolMapper_validateClientAudienceConflicts
Steps: []resource.TestStep{
{
Config: testKeycloakOpenIdAudienceProtocolMapper_validateClientAudienceConflictsWithCustomAudience(realmName, clientId, mapperName),
ExpectError: regexp.MustCompile("validataion error: IncludedClientAudience and IncludedCustomAudience cannot both be set"),
ExpectError: regexp.MustCompile("validation error: IncludedClientAudience and IncludedCustomAudience cannot both be set"),
},
},
})
Expand Down

0 comments on commit a103c5f

Please sign in to comment.