diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 534725d5319..cbc49240630 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -196,6 +196,14 @@ jobs: with: fetch-depth: 1 + - name: Checkout of tyk-automated-tests + uses: actions/checkout@v3 + with: + repository: TykTechnologies/tyk-automated-tests + token: ${{ secrets.ORG_GH_TOKEN }} + ref: ${{ startsWith(github.ref_name, 'release-') && github.ref_name || 'master' }} + path: tyk-automated-tests + - uses: aws-actions/configure-aws-credentials@v2 with: role-to-assume: arn:aws:iam::754489498669:role/ecr_rw_tyk @@ -218,8 +226,11 @@ jobs: - name: env up shell: bash + working-directory: tyk-automated-tests/ci/auto + id: env_up env: t: ${{ needs.goreleaser.outputs.tags }} + pull_policy: 'if_not_present' # gw and dash use the same branch names gw_dash_image_tag: ${{ ( (github.repository == 'TykTechnologies/tyk' || github.repository == 'TykTechnologies/tyk-analytics') && startsWith(github.ref_name, 'release-') ) && github.ref_name || 'master' }} pump_image_tag: ${{ ( github.repository == 'TykTechnologies/tyk-pump' && startsWith(github.ref_name, 'release-') ) && github.ref_name || 'master' }} @@ -228,13 +239,8 @@ jobs: TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }} GH_TOKEN: ${{ secrets.ORG_GH_TOKEN }} run: | - echo CI tags: $t tags=($t) echo First tag: ${tags[0]} - # Get the ci test env in a temp dir - cd $(mktemp -d autoXXX) - gh release download v1 --pattern '*.tgz' -R TykTechnologies/tyk-ci - tar --strip-components=1 -xvf ci-env.tgz # Start customising env echo "registry=${{ steps.ecr.outputs.registry }} tyk_image=\${registry}/tyk:${gw_dash_image_tag} @@ -243,21 +249,26 @@ jobs: tyk_pump_image=\${registry}/tyk-pump:${pump_image_tag} # override default with just built tag tyk_image=${tags[0]} + tyk_alfa_image=${tags[0]} + tyk_beta_image=${tags[0]} # base dir for config files - confs_dir=./pro + confs_dir=./pro-ha # pick database env_file=local-${{ matrix.db }}.env " > versions.env # Add Tyk component config variations to $env_file cat confs/${{ matrix.conf }}.env >> local-${{ matrix.db }}.env # bring up env, the project name is important - docker compose -p auto -f pro.yml -f deps.yml -f ${{ matrix.db }}.yml --env-file versions.env up --quiet-pull -d + docker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${{ matrix.db }}.yml --env-file versions.env --profile master-datacenter up --quiet-pull -d + ./dash-bootstrap.sh http://localhost:3000 + docker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${{ matrix.db }}.yml --env-file versions.env --profile slave-datacenter up --quiet-pull -d - name: Run tests + working-directory: tyk-automated-tests/ci/auto run: | - docker run --rm --network auto_default \ + docker run --rm --network auto_default --env-file pytest.env \ 754489498669.dkr.ecr.eu-central-1.amazonaws.com/tyk-automated-tests:${{ startsWith(github.ref_name, 'release-') && github.ref_name || 'master' }} \ - pytest -c pytest_ci.ini -m "not local and not mdcb and not dind ${{ matrix.markers }}" + pytest -c pytest_ci.ini --ci -m "not local and not dind ${{ matrix.markers }}" # TODO: PR comment, using just one comment and updating, not a new comment each time @@ -422,4 +433,3 @@ jobs: cd - fi done - diff --git a/config/config.go b/config/config.go index d69ebec4afa..22841e1a8be 100644 --- a/config/config.go +++ b/config/config.go @@ -76,8 +76,9 @@ type PoliciesConfig struct { // Set this to the URL of your Tyk Dashboard installation. The URL needs to be formatted as: http://dashboard_host:port. PolicyConnectionString string `json:"policy_connection_string"` - // This option is required if `policies.policy_source` is set to `file`. - // Specifies the path of your JSON file containing the available policies. + // This option only applies in OSS deployment when the `policies.policy_source` is either set + // to `file` or an empty string. If `policies.policy_path` is not set, then Tyk will load policies + // from the JSON file specified by `policies.policy_record_name`. PolicyRecordName string `json:"policy_record_name"` // In a Pro installation, Tyk will load Policy IDs and use the internal object-ID as the ID of the policy. @@ -87,8 +88,10 @@ type PoliciesConfig struct { // // This option should only be used when moving an installation to a new database. AllowExplicitPolicyID bool `json:"allow_explicit_policy_id"` - // This option is used for storing a policies if `policies.policy_source` is set to `file`. - // it should be some existing directory path on hard drive + // This option only applies in OSS deployment when the `policies.policy_source` is either set + // to `file` or an empty string. If `policies.policy_path` is set, then Tyk will load policies + // from all the JSON files under the directory specified by the `policies.policy_path` option. + // In this configuration, Tyk Gateway will allow policy management through the Gateway API. PolicyPath string `json:"policy_path"` }