Skip to content

Commit

Permalink
chore: [FX-4058] update jira deployment (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaklygin authored Jul 26, 2023
1 parent 13eadaa commit 6996874
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-trainers-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'davinci-github-actions': major
---

- use jenkins to create jira deployment
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
GITHUB_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
DEVBOT_TOKEN: ${{ secrets.TOPTAL_DEVBOT_TOKEN }}
JENKINS_USER: ${{ secrets.TOPTAL_TRIGGERBOT_USERNAME }}
JENKINS_BUILD_TOKEN: ${{ secrets.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
PROXY: http://${{ secrets.HTTP_PROXY }}

jobs:
release:
Expand Down Expand Up @@ -100,10 +103,11 @@ jobs:
run: |
echo LATEST_TAG=$(git describe --tags --abbrev=0) >> $GITHUB_OUTPUT
- uses: toptal/davinci-github-actions/[email protected]
name: Create Production Jira deployment
if: ${{ steps.changesets.outputs.published == 'true' }}
- name: Create Jira Deployment
uses: toptal/davinci-github-actions/create-jira-deployment@master
with:
token: ${{ env.DEVBOT_TOKEN }}
environment: production
environment-url: https://github.com/toptal/davinci-github-actions/releases/tag/${{ steps.tag-version.outputs.LATEST_TAG }}
transient-environment: false
auto-inactive: false
9 changes: 8 additions & 1 deletion create-jira-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ Not specified

### ENV Variables

Not specified
All ENV Variables, defined in a GH Workflow are also passed to a GH Action. It means, the might be reused as is.
This is a list of ENV Variables that are used in GH Action:

| name | description |
| --------------------- | -------------------------------------------------------------------------------- |
| `JENKINS_USER` | Jenkins user |
| `JENKINS_BUILD_TOKEN` | Jenkins build token. Keep in mind that tokens for `temploy` and `staging` differ |
| `PROXY` | Proxy to use for Jenkins |

### Usage

Expand Down
29 changes: 29 additions & 0 deletions create-jira-deployment/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Create new Jira Deployment
description: |
It creates and engages a new Jira Deployment. Notice: Jira App must be installed in the repository.
****
envInputs:
JENKINS_USER: Jenkins user
JENKINS_BUILD_TOKEN: Jenkins build token. Keep in mind that tokens for `temploy` and `staging` differ
PROXY: Proxy to use for Jenkins
inputs:
token:
Expand Down Expand Up @@ -54,3 +59,27 @@ runs:
deployment-id: ${{ steps.gh-deployment.outputs.deployment_id }}
log-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
state: 'failure'

- name: Set appName
id: repo
if: ${{ always() }}
shell: bash
run: |
echo APP_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2) >> $GITHUB_OUTPUT
- name: Trigger `Create JIRA` deployment
uses: toptal/[email protected]
if: ${{ always() }}
with:
jenkins_url: https://jenkins-build.toptal.net/
jenkins_user: ${{ env.JENKINS_USER }}
jenkins_token: ${{ env.JENKINS_BUILD_TOKEN }}
proxy: ${{ env.PROXY }}
job_name: create-jira-deployment
job_params: |
{
"appName": "${{ steps.repo.outputs.APP_NAME }}",
"envName": "${{ inputs.environment }}",
"sha": "${{ github.sha }}"
}
job_timeout: '3600'

0 comments on commit 6996874

Please sign in to comment.