feat: Add functions to get ephemeral environment by ID and Partial Na… #1330
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| SA_PASSWORD: ${{ secrets.DB_IMAGE_SA_PASSWORD }} | |
| ADMIN_API_KEY: ${{ secrets.OD_IMAGE_ADMIN_API_KEY }} | |
| SERVER_URL: 'http://localhost:8080' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| sqlserver: | |
| image: mcr.microsoft.com/mssql/server:2019-latest | |
| env: | |
| ACCEPT_EULA: Y | |
| SA_PASSWORD: ${{ env.SA_PASSWORD }} | |
| MSSQL_PID: Developer | |
| options: >- | |
| --health-cmd "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P \"$SA_PASSWORD\" -Q \"SELECT 1\" || exit 1" | |
| --health-interval 10s | |
| --health-timeout 3s | |
| --health-retries 10 | |
| --health-start-period 10s | |
| octopusserver: | |
| image: docker.packages.octopushq.com/octopusdeploy/octopusdeploy | |
| env: | |
| ACCEPT_EULA: Y | |
| DB_CONNECTION_STRING: 'Server=sqlserver;Database=OctopusDeploy;User Id=sa;Password=${{ env.SA_PASSWORD }};' | |
| ADMIN_API_KEY: ${{ env.ADMIN_API_KEY }} | |
| ENABLE_USAGE: N | |
| OCTOPUS_SERVER_BASE64_LICENSE: ${{ secrets.OCTOPUS_SERVER_BASE64_LICENSE }} | |
| OCTOPUS__FeatureToggles__EphemeralEnvironmentsManualDeploymentsFeatureToggle: 'true' | |
| OCTOPUS__FeatureToggles__EphemeralEnvironmentsFeatureToggle: 'true' | |
| ports: | |
| - 8080:8080 | |
| # https://github.com/dorny/test-reporter/issues/168 | |
| permissions: | |
| statuses: write | |
| checks: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: '>=1.19.0' | |
| - name: Build | |
| run: go build -a -race -v ./... | |
| - name: Vet | |
| run: go vet -v ./... | |
| - run: | | |
| curl '${{ env.SERVER_URL }}/api/configuration/webportal/values' -X 'PUT' -H 'Content-Type: application/json' -H 'X-Octopus-ApiKey: ${{ env.ADMIN_API_KEY }}' --data-binary '{"Security":{"CorsWhitelist":"http://localhost,${{ env.SERVER_URL }}","ReferrerPolicy":"no-referrer","ContentSecurityPolicyEnabled":true,"HttpStrictTransportSecurityEnabled":false,"HttpStrictTransportSecurityMaxAge":31556926,"XOptions":{"XFrameOptionAllowFrom":null,"XFrameOptions":"None"}}}' -o /dev/null -s -w "%{http_code}\n" | |
| name: Add server url to CORS | |
| - run: go test -v ./... | |
| env: | |
| OCTOPUS_HOST: ${{ env.SERVER_URL }} | |
| OCTOPUS_API_KEY: ${{ env.ADMIN_API_KEY }} |