|
| 1 | +artifactory_build: &artifactory_build |
| 2 | + ARTIFACTORY_DEPLOY_USERNAME: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer username] |
| 3 | + ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token] |
| 4 | + |
| 5 | +artifactory_private: &artifactory_private |
| 6 | + ARTIFACTORY_PRIVATE_USERNAME: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader username] |
| 7 | + ARTIFACTORY_PRIVATE_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token] |
| 8 | + |
| 9 | +container_definition: &CONTAINER_DEFINITION |
| 10 | + dockerfile: .cirrus/poetry.Dockerfile |
| 11 | + cluster_name: ${CIRRUS_CLUSTER_NAME} |
| 12 | + region: eu-central-1 |
| 13 | + namespace: default |
| 14 | + builder_image_name: POETRY_VM |
| 15 | + builder_role: cirrus-builder |
| 16 | + builder_image: docker-builder-v* |
| 17 | + builder_instance_type: t3.small |
| 18 | + builder_subnet_id: ${CIRRUS_AWS_SUBNET} |
| 19 | + |
| 20 | +only_sonarsource_qa: &ONLY_SONARSOURCE_QA |
| 21 | + only_if: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master") |
| 22 | + |
| 23 | +env: |
| 24 | + CIRRUS_SHELL: bash |
| 25 | + ARTIFACTORY_URL: VAULT[development/kv/data/repox data.url] |
| 26 | + ARTIFACTORY_DEPLOY_REPO: sonarsource-pypi-public-qa |
| 27 | + |
| 28 | + |
| 29 | +build_task: |
| 30 | + eks_container: |
| 31 | + <<: *CONTAINER_DEFINITION |
| 32 | + cpu: 2 |
| 33 | + memory: 2G |
| 34 | + env: |
| 35 | + <<: *artifactory_build |
| 36 | + build_script: |
| 37 | + - poetry install |
| 38 | + - poetry version $(poetry version -s).${CI_BUILD_NUMBER} |
| 39 | + - poetry build |
| 40 | + - poetry config repositories.sonarsource https://repox.jfrog.io/artifactory/api/pypi/${ARTIFACTORY_DEPLOY_REPO} |
| 41 | + - poetry publish -r sonarsource --username ${ARTIFACTORY_DEPLOY_USERNAME} --password ${ARTIFACTORY_DEPLOY_PASSWORD} --verbose |
| 42 | + |
| 43 | +promote_task: |
| 44 | + <<: *ONLY_SONARSOURCE_QA |
| 45 | + eks_container: |
| 46 | + <<: *CONTAINER_DEFINITION |
| 47 | + cpu: 2 |
| 48 | + memory: 2G |
| 49 | + env: |
| 50 | + ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token] |
| 51 | + promote_script: |
| 52 | + # Temporary hack script until https://sonarsource.atlassian.net/browse/BUILD-4592 is completed |
| 53 | + # Artifact is copied to sonarsource-pypi-public-builds repo for testing the release workflow as part of https://sonarsource.atlassian.net/browse/BUILD-4501 |
| 54 | + - export VERSION=$(poetry version -s).$CI_BUILD_NUMBER |
| 55 | + - jfrog config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PROMOTE_ACCESS_TOKEN" |
| 56 | + - jfrog rt cp sonarsource-pypi-public-qa/sonar_dummy_python_oss/$VERSION/ sonarsource-pypi-public-builds/sonar_dummy_python_oss/$VERSION/ |
0 commit comments