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

Add release automation #234

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Add release automation #234

merged 1 commit into from
Oct 19, 2020

Conversation

sigalsax
Copy link
Contributor

@sigalsax sigalsax commented Sep 24, 2020

This PR is part of a bigger effort in automating our release process

  • Package helm chart on every build
  • Add ability to push an edge tag on every master build
  • Update tag and release process in docs

See generated helm package here: https://jenkins.conjur.net/blue/organizations/jenkins/cyberark--secrets-provider-for-k8s/detail/automate-release/31/artifacts

What ticket does this PR close?

Connected to #233

Checklists

Change log

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR, and/or there is a follow-on issue to update docs, or
  • This PR does not require updating any documentation

@sigalsax sigalsax requested a review from eladkug September 24, 2020 11:43
@sigalsax sigalsax self-assigned this Sep 24, 2020
@sigalsax sigalsax force-pushed the automate-release branch 28 times, most recently from b6bfbf2 to 9094bc9 Compare September 29, 2020 12:06
@sigalsax sigalsax force-pushed the automate-release branch 2 times, most recently from 5c2ee4b to cd7b53e Compare September 29, 2020 12:53
Copy link
Collaborator

@hughsaunders hughsaunders left a comment

Choose a reason for hiding this comment

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

Would be good to see a test of the package/release stages, maybe comment out then when clause for a test?

I missed this build which does test the package stage: jenkins.conjur.net/blue/organizations/jenkins/cyberark--secrets-provider-for-k8s/detail/automate-release/31/pipeline/39

stage('Push Images') {
steps {
script {
BRANCH_NAME=env.BRANCH_NAME
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure what this for, may as well use ${env.BRANCH_NAME} on L102?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need the BRANCH_NAME inside publish to determine when to push our edge tag. We want to only push when on master so I need the BRANCH_NAME=env.BRANCH_NAME from the script and output the result. I tried via scripts but I would also get HEAD instead of the actual branch

@sigalsax sigalsax marked this pull request as ready for review September 29, 2020 13:00
@sigalsax sigalsax force-pushed the automate-release branch 3 times, most recently from 795a6d8 to 6d36e08 Compare September 30, 2020 08:10
CONTRIBUTING.md Outdated
@@ -210,6 +203,14 @@ follow the instructions in this section.
1. Push the tag: `git push vx.y.z` (or `git push origin vx.y.z` if you are working
from your local machine).

### Push Helm package
1. The tagged build will package the Secrets Provider Helm chart for us. The package will appear under the 'Artifacts' tab of the Jenkins build and will resemble `secrets-provider-<version>.tgz`.
Save this file you will need it for the next step.
Copy link
Contributor

Choose a reason for hiding this comment

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

comma is missing i think.
Save this file , you will need it for the next step.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great catch! I added a "because"

@@ -43,4 +43,8 @@ if [ "$GIT_DESCRIPTION" = "v${VERSION}" ]; then
echo 'Failed to log in to scan.connect.redhat.com'
exit 1
fi
elif [ "$BRANCH_NAME" = "master" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Its not relevant for redhat registry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point but I don't think so. I don't know if we would want to be pushing edge tags to RH because the publishing of tags is not an automated process. Our current policy for RH registry is that someone needs to push "publish" for tags to be public facing

@sigalsax sigalsax force-pushed the automate-release branch 2 times, most recently from 142188c to 527e185 Compare September 30, 2020 12:22
@sigalsax sigalsax requested a review from eladkug October 18, 2020 08:26
@sigalsax sigalsax force-pushed the automate-release branch 2 times, most recently from 3bd1b15 to c3c659a Compare October 18, 2020 10:44
ci/jenkins_build Outdated
-v $PWD/helm/secrets-provider:/root/helm/secrets-provider \
-v $PWD/helm-artifacts/:/root/helm-artifacts \
--workdir /root/helm-artifacts \
alpine/helm:${helm_version} package ../helm/secrets-provider
Copy link
Contributor

Choose a reason for hiding this comment

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

need to align

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be fixed now

@sigalsax sigalsax requested a review from eladkug October 18, 2020 11:08
@sigalsax sigalsax force-pushed the automate-release branch 2 times, most recently from e99eb6f to 5a4800a Compare October 18, 2020 11:16
Copy link
Contributor

@eranha eranha left a comment

Choose a reason for hiding this comment

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

LGTM, well done.

Copy link
Contributor

@eladkug eladkug left a comment

Choose a reason for hiding this comment

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

LGTM

Make CONJUR_APPLIANCE_IMAGE tag configurable
Add release automation

- Package helm chart on every build
- Add ability to push an edge tag on every master build
- Update tag and release process in docs
@codeclimate
Copy link

codeclimate bot commented Oct 18, 2020

Code Climate has analyzed commit e8ab473 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 87.5% (0.0% change).

View more on Code Climate.

-v $PWD/helm/secrets-provider:/root/helm/secrets-provider \
-v $PWD/helm-artifacts/:/root/helm-artifacts \
--workdir /root/helm-artifacts \
alpine/helm:${helm_version} package ../helm/secrets-provider
Copy link
Contributor

Choose a reason for hiding this comment

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

that's the stuff!
😉

@sigalsax sigalsax merged commit a6366d5 into master Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants