-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create opslevel-deploy.yml #1
base: main
Are you sure you want to change the base?
Conversation
DEPLOYER_ID="$(Build.QueuedById)" | ||
DEPLOYER_ID="${DEPLOYER_ID:-$(Build.QueuedById)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works in AzureDevOps
|
||
# Payload for the OpsLevel API | ||
data="{ | ||
\"dedup_id\": \"$(uuidgen)\", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few "polish" things that need to be taken care of
No description provided.