unit-test-job-lib: tags: - cm-official-runner stage: test needs: [] script: - cd poc_lib - cargo test build-job-lib: tags: - cm-official-runner stage: build needs: ["unit-test-job-lib"] script: - cd poc_lib - cargo build version-lib: stage: version needs: ["build-job-lib"] image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 script: - release next-version --allow-current > .next-version - cp /usr/bin/release ./ - cat .next-version artifacts: paths: - ./.next-version - ./release - ./api-manifest.json except: - tags release-lib: stage: release needs: ["version-lib"] image: artifactory.f5net.com/dockerhub-remote/debian:buster-slim script: - set -euo pipefail - chmod +x release - ./release -v # the next line will fail if no feature or fix changes are found # in commits since last release tag - ./release changelog - ( apt-get -y update && apt-get -y install curl ) &> /tmp/apt.log || { cat /tmp/apt.log; false; } - version="$(cat .next-version)" - echo $version - sed -i "s/version =.*/version = \"$version\"/" poc_lib/Cargo.toml - ./release commit-and-tag CHANGELOG.md poc_lib/Cargo.toml when: manual allow_failure: false # only: # - main publish-to-crate-reg: stage: publish needs: ["release-lib"] script: - cargo login "${CRATES_API_TOKEN}" - cd poc_lib && cargo publish when: manual # publish: # image: artifactory.f5net.com/dockerhub-remote/node:16-bullseye-slim # stage: publish # before_script: # - mkdir ~/.docker # - echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json # script: # - ( apt-get -y update && apt-get -y install make docker.io curl ) &> /tmp/apt.log || { cat /tmp/apt.log; false; } # - curl -sL https://aka.ms/InstallAzureCLIDeb | bash &>/tmp/az.log || { cat /tmp/az.log; false; } # - az login --verbose --service-principal --username "${AZURE_ACTIVE_DIRECTORY_ID}" --password "${AZURE_ACTIVE_DIRECTORY_ID_PW}" --tenant "${AZURE_ACTIVE_DIRECTORY_TENANT_ID}" --allow-no-subscriptions # - ACR_USERNAME=$(az keyvault secret show --id "${AZURE_KV_ACR_USERNAME_SECRET_ID}" -o tsv --query value) # - ACR_PASSWORD=$(az keyvault secret show --id "${AZURE_KV_ACR_PASSWORD_SECRET_ID}" -o tsv --query value) # - BRANCH_TAG="${CI_COMMIT_REF_NAME/\//_}" # - docker login "${AZURE_ACR_LOGIN_SERVER}" -u "${ACR_USERNAME}" -p "${ACR_PASSWORD}" # - make backstage-config-file-ci # - make build-docker-ci # - docker tag "${BACKSTAGE_CONTAINER_NAME}" "${AZURE_ACR_LOGIN_SERVER}/${BACKSTAGE_CONTAINER_NAME}:${BRANCH_TAG}" # - docker push "${AZURE_ACR_LOGIN_SERVER}/${BACKSTAGE_CONTAINER_NAME}:${BRANCH_TAG}" # - | # curl -u "${ACR_USERNAME}:${ACR_PASSWORD}" \ # -X GET \ # -H 'accept: application/vnd.docker.distribution.manifest.v2+json' \ # -o api-manifest.json \ # "https://${AZURE_ACR_LOGIN_SERVER}/v2/${BACKSTAGE_CONTAINER_NAME}/manifests/${BRANCH_TAG}" # artifacts: # paths: # - ./api-manifest.json