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

Secure spring boot pipeline #73

Merged
merged 24 commits into from
Mar 24, 2019

Conversation

sherl0cks
Copy link
Contributor

What does this PR do?

Add's a new pipeline for a secure pipeline line for Spring Boot. Relies on labs-ci-cd tooling, so the applier inventory only contains the spring boot app.

How should this be tested?

Just follow the readme

Is there a relevant Issue open for this?

Resolves #5

Who would you like to review this?

cc: @redhat-cop/containers-approvers

@pcarney8
Copy link
Contributor

Nice work! Yes, I like this because it reduces the amount of copy pasta, and definitely encourages reuse + ansible variables. My main concern will be that this does feel more complex. But I will definitely put those feelings on pause because I am hoping the next iteration of the applier or "IaC at Labs" uses a bit more technology native pieces to reduce complexity.

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

@sherl0cks Environment provisioned successfully, however, hitting the following error in the pipeline

[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Code Analysis)
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: sonar
[Pipeline] {
[Pipeline] echo
Validating webhook with name jenkins exists...
[Pipeline] sh
+ grep jenkins
+ curl -k -u ******: http://sonarqube:9000/api/webhooks/list
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    15  100    15    0     0    419      0 --:--:-- --:--:-- --:--:--   428
[Pipeline] echo
Return Value is 1
[Pipeline] error
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?

## Advisories

- Running the pipeline for the first time will take ~10 minutes because all maven dependencies and NIST DB need to be downloaded. Subsequent builds will be faster. Also see https://github.com/redhat-cop/container-pipelines/issues/71
- If you have issues with Nexus certificate like seen [here](https://github.com/redhat-cop/infra-ansible/issues/342), then you can set the ansible var `nexus_validate_certs: false` as a work around.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want provide the -e nexus_validate_certs=false instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed per your request

@sherl0cks
Copy link
Contributor Author

@haithamshahin333 see above from @sabre1041

@haithamshahin333
Copy link

haithamshahin333 commented Mar 20, 2019

@sabre1041 @sherl0cks I just provisioned the tooling to my environment and no issues. Your error is related to the jenkins webhook not being created in sonarqube. It should be run as a post-hook in the deployment.

@sabre1041 Can you re-provision and check out why that post-hook did not work / send the logs over for review?

Screen Shot 2019-03-20 at 11 48 06 AM (2)

@sherl0cks
Copy link
Contributor Author

sherl0cks commented Mar 20, 2019

OK - we need to provide some guidance as to why its failing @haithamshahin333 and potentially offer a fix. At minimum, I need you to help debug this.

@sherl0cks
Copy link
Contributor Author

Aaaand it looks like that's exactly our ask, I just missed it. That's my bad Haitham. My apologies.

@sherl0cks
Copy link
Contributor Author

@sabre1041 any word on this?

@sabre1041
Copy link
Contributor

@sherl0cks @haithamshahin333 reprovisioned environment. got past webhook error. new one

Checking status of SonarQube task 'AWmj004_yolX75t2M0Vh' on server 'sonar'
SonarQube task 'AWmj004_yolX75t2M0Vh' status is 'IN_PROGRESS'
SonarQube task 'AWmj004_yolX75t2M0Vh' status is 'SUCCESS'
SonarQube task 'AWmj004_yolX75t2M0Vh' completed. Quality gate is 'OK'
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build Container Image)
[Pipeline] echo

[Pipeline] _OcContextInit
[Pipeline] _OcContextInit
[Pipeline] readFile
[Pipeline] _OcAction
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Promote from Build to Dev)
Stage "Promote from Build to Dev" skipped due to earlier failure(s)

@haithamshahin333
Copy link

@sabre1041 @sherl0cks Per the changes made in labs-ci-cd and [container-quickstarts] (redhat-cop/containers-quickstarts@9ccc44b) the maven slave image has been updated and it has a newer version of the OC client which fixes your issue above, which was a result of trying to instantiate the build by using the /oapi endpoint.

@sherl0cks
Copy link
Contributor Author

@haithamshahin333 we probably need to cut a tag in Labs CI/CD and update the galaxy requirements here

Copy link

@haithamshahin333 haithamshahin333 left a comment

Choose a reason for hiding this comment

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

@sherl0cks @sabre1041 With this change included, this has been tested and successful in a v4.0 and v3.11 environment. @sabre1041 you can view the test in your environment in the 'secure-spring-boot-hs-ci-cd' namespace.

# This is the Ansible Galaxy requirements file to pull in the correct roles
- src: https://github.com/rht-labs/labs-ci-cd
scm: git
version: v3.11.4

Choose a reason for hiding this comment

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

This needs to be updated to v3.11.5 or master @sherl0cks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

@sherl0cks @haithamshahin333 Redeployed entire environment and pipeline succeeded.

Great work all!

@sabre1041 sabre1041 merged commit 1085388 into redhat-cop:master Mar 24, 2019
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.

None yet

4 participants