Conversation
| DEPLOYER_ID="$(Build.QueuedById)" | ||
| DEPLOYER_ID="${DEPLOYER_ID:-$(Build.QueuedById)}" |
There was a problem hiding this comment.
| DEPLOYER_ID="$(Build.QueuedById)" | |
| DEPLOYER_ID="${DEPLOYER_ID:-$(Build.QueuedById)}" | |
| DEPLOYER_ID="$(Build.QueuedById)" |
| DEPLOYER_NAME="$(Build.RequestedFor)" | ||
| DEPLOY_NUMBER="$(Build.BuildNumber)" | ||
| DEPLOY_URL="$(Build.BuildUri)" | ||
| VERSION="${VERSION:-$(git rev-parse --short HEAD)}" # Default to the current git commit hash |
There was a problem hiding this comment.
| VERSION="${VERSION:-$(git rev-parse --short HEAD)}" # Default to the current git commit hash | |
| VERSION="$(git rev-parse --short HEAD)" |
| DEPLOY_NUMBER="$(Build.BuildNumber)" | ||
| DEPLOY_URL="$(Build.BuildUri)" | ||
| VERSION="${VERSION:-$(git rev-parse --short HEAD)}" # Default to the current git commit hash | ||
| DESCRIPTION="${DESCRIPTION:-"Deployed by CI Pipeline: Deploy #${DEPLOY_NUMBER}"}" |
There was a problem hiding this comment.
I don't think this works in AzureDevOps
|
|
||
| # Payload for the OpsLevel API | ||
| data="{ | ||
| \"dedup_id\": \"$(uuidgen)\", |
There was a problem hiding this comment.
This shouldn't be a unique ID per invocation - it should be the Build.BuildNumber or some sort of "pipeline" number. The purpose of the dedup_id is incase you need to retry the pipeline its considered the same event incase we received 2
| COMMIT_SHA="${COMMIT_SHA:-$(git rev-parse HEAD)}" | ||
| COMMIT_MESSAGE="${COMMIT_MESSAGE:-$(git log -1 --pretty=%B)}" | ||
| COMMIT_BRANCH="${COMMIT_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}" | ||
| COMMIT_DATE="${COMMIT_DATE:-$(git show --no-patch --format='%cd')}" | ||
| COMMITTER_NAME="${COMMITTER_NAME:-$(git show --no-patch --format='%cn')}" | ||
| COMMITTER_EMAIL="${COMMITTER_EMAIL:-$(git show --no-patch --format='%ce')}" | ||
| AUTHOR_NAME="${AUTHOR_NAME:-$(git show --no-patch --format='%an')}" | ||
| AUTHOR_EMAIL="${AUTHOR_EMAIL:-$(git show --no-patch --format='%ae')}" | ||
| AUTHORING_DATE="${AUTHORING_DATE:-$(git show --no-patch --format='%ad')}" |
There was a problem hiding this comment.
All of these have input environment variables - my understanding is they will always be blank.
So 2 things
- Should we expose all (or some) of these as parameters?
- Should we remove the variables and just run the git commands.
| - name: 'env' | ||
| default: 'Production' | ||
| type: string | ||
| - name: 'integrationId' | ||
| type: string | ||
| - name: 'serviceAlias' | ||
| type: string | ||
| - name: 'apiUrl' | ||
| default: 'https://app.opslevel.com/' | ||
| type: string |
There was a problem hiding this comment.
Alphabetize by parameters name
| - name: 'env' | |
| default: 'Production' | |
| type: string | |
| - name: 'integrationId' | |
| type: string | |
| - name: 'serviceAlias' | |
| type: string | |
| - name: 'apiUrl' | |
| default: 'https://app.opslevel.com/' | |
| type: string | |
| - name: 'apiUrl' | |
| default: 'https://app.opslevel.com/' | |
| type: string | |
| - name: 'env' | |
| default: 'Production' | |
| type: string | |
| - name: 'integrationId' | |
| type: string | |
| - name: 'serviceAlias' | |
| type: string |
rocktavious
left a comment
There was a problem hiding this comment.
There are a few "polish" things that need to be taken care of
No description provided.