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

Make deploy optional in .travis.yml #32

Merged
merged 2 commits into from
May 17, 2018
Merged

Make deploy optional in .travis.yml #32

merged 2 commits into from
May 17, 2018

Conversation

ardrigh
Copy link
Contributor

@ardrigh ardrigh commented Mar 3, 2018

Deployments from CI to the Puppet Forge should be configured as opt-in. A lot of internal or private modules will not want these lines is the CI configuration.

Also add the option to specify a valid username along with the secure password.

For any users wanting to add the deploy section, adding the deploy keys to .sync.yml and running pdk update works.

❱ cat .sync.yml

.travis.yml:
  deploy: true
  user: deploy_user
  secure: deploy_password

❱ cat update_report.txt

/* Report generated by PDK at 2018-03-07 11:17:49 +1300 */


--- .travis.yml	2018-03-07 11:17:46.306683603 +1300
+++ .travis.yml.pdknew	2018-03-07 11:17:49.138287398 +1300
@@ -37,4 +37,13 @@
     - /^v\d/
 notifications:
   email: false
+deploy:
+  provider: puppetforge
+  user: deploy_user
+  password:
+    secure: "deploy_password"
+  on:
+    tags: true
+    all_branches: true
+    condition: "$DEPLOY_TO_FORGE = yes"⏎ 

@edestecd
Copy link

👍 Please merge this...

@edestecd
Copy link

edestecd commented May 8, 2018

@bmjen
Copy link
Contributor

bmjen commented May 16, 2018

@ardrigh I like these changes, but I think the defaulting needs to be to true and the username to puppet, so that we can maintain compatibility for those PDK users that currently rely on this setting.

Copy link
Contributor

@bmjen bmjen left a comment

Choose a reason for hiding this comment

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

Needs defaults to maintain backward compatibility.

@ardrigh
Copy link
Contributor Author

ardrigh commented May 17, 2018

@bmjen I added the defaults to config_defaults.yml and did some brief testing.

A new module is created with the deploy section.

If the deploy section is deleted, pdk update will add it again with the defaults.

If a user creates .sync.yml:

  • pdk update will add the section with the default user: puppet if deploy: true
.travis.yml:
  deploy: true
  • pdk update will add the section if user name is specified
.travis.yml:
  user: 'foo'
  • pdk update will remove the deploy section if deploy: false
.travis.yml:
  deploy: false

Is that suitable, or would you prefer to have the defaults in the template?

Note: I rebased the branch from the current master to fix conflict on config_defaults.yml

@edestecd
Copy link

👍

@bmjen
Copy link
Contributor

bmjen commented May 17, 2018

Thanks @ardrigh ! That's perfect. I just wanted to make sure previous behavior is maintained, which is... a PDK user that created a new module with the older templates, does not need to add a .sync.yml update in order to keep their module configuration the same.

@bmjen bmjen merged commit 7207466 into puppetlabs:master May 17, 2018
@ardrigh ardrigh deleted the optional_deploy branch May 21, 2018 05:36
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