Skip to content
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

Dtspo 13916 terraform format implementation #1106

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

narinder17
Copy link
Contributor

Resolves # . (This is applicable only if this pull request relates to a GitHub issue, delete the line otherwise)

Notes:

https://tools.hmcts.net/jira/browse/DTSPO-13916
Adding a auto terraform formatting updater for branches and warning message.

@narinder17 narinder17 requested a review from a team as a code owner July 17, 2023 14:41
vars/spinInfra.groovy Outdated Show resolved Hide resolved
Comment on lines 12 to 14
USER_NAME=${1}
BEARER_TOKEN=${2}
EMAIL_ID=${3}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this? it will be breaking it

sh 'terraform fmt -recursive'

// Commit the formatting changes
git fetch origin $BRANCH:$BRANCH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be in an sh step

git fetch origin $BRANCH:$BRANCH
sh 'git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${USER_NAME}:${BEARER_TOKEN}@github.com/g ")'

sh "git config --global user.name ${USER_NAME}:"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these sh steps should be combined into one and they probably should be in an external script in the resources folder, see an example:

steps.writeFile(file: 'save-pods-logs.sh', text: steps.libraryResource('uk/gov/hmcts/helm/save-pods-logs.sh'))

rm -f save-pods-logs.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants