Giter Site home page Giter Site logo

Comments (6)

bittner avatar bittner commented on July 30, 2024
$ pdk new module software

References

from puppet-software.

edestecd avatar edestecd commented on July 30, 2024

Yea, I learned all about pdk at puppetconf! It looks nice and should solve some of our problems.

from puppet-software.

bittner avatar bittner commented on July 30, 2024

When you use PDK to generate an example Puppet module (e.g. pdk new module software) you can use the generated Gemfile with the generated Puppet version requirement. That will make pdk validate work immediately. I just tried it.

diff --git a/metadata.json b/metadata.json
index 1556c97..7bf2975 100644
--- a/metadata.json
+++ b/metadata.json
@@ -43,7 +43,7 @@
   "requirements": [
     {
       "name": "puppet",
-      "version_requirement": ">= 3.0.0 < 5.0.0"
+      "version_requirement": ">= 4.5.0 < 6.0.0"
     }
   ]
 }

The main complaint is "software not in autoload module layout", which goes away when I rename the puppet-software folder that I have cloned your repo into to just software. Then only a few validation complaints remain:

Linting

$ pdk validate
pdk (INFO): Running all available validators...
[✔] Checking metadata syntax (metadata.json tasks/*.json).
[✔] Checking module metadata style (metadata.json).
[✔] Checking Puppet manifest syntax (**/**.pp).
[✔] Checking Puppet manifest style (**/*.pp).
[✔] Checking Ruby code style (**/**.rb).
info: task-metadata-lint: ./: Target does not contain any files to validate (tasks/*.json).
warning: puppet-lint: manifests/social/skype.pp:37:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/social/slack.pp:31:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/virtualization/virtualbox.pp:48:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/virtualization/virtualbox.pp:50:27: arrow should be on the right operand's line
warning: puppet-lint: manifests/editors/atom.pp:46:9: arrow should be on the right operand's line
warning: puppet-lint: manifests/editors/atom.pp:68:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/browsers/chrome.pp:46:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/drivers/lanier_mpc5503.pp:32:9: arrow should be on the right operand's line
warning: puppet-lint: manifests/storage/drive.pp:39:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/utilities/iterm.pp:31:9: arrow should be on the right operand's line
warning: puppet-lint: manifests/utilities/alfred.pp:35:9: arrow should be on the right operand's line
warning: puppet-lint: manifests/utilities/alfred.pp:55:33: arrow should be on the right operand's line
warning: puppet-lint: manifests/utilities/controlplane.pp:31:9: arrow should be on the right operand's line
warning: puppet-lint: manifests/utilities/onyx.pp:30:11: arrow should be on the right operand's line

Tests

Tests work all out of the box: (A little more verbosity wouldn't hurt, but they all seem to be executed and pass.)

$ pdk test unit
[✔] Preparing to run the unit tests.
[✔] Running unit tests.
  Evaluated 165 tests in 5.57427871 seconds: 0 failures, 0 pending.
[✔] Cleaning up after running unit tests.

Travis CI

I have described in puppetlabs/pdk#324 (comment) how to download and install PDK for CI builds. Afterwards, all there is to do, clearly, is run the two commands pdk validate and pdk test unit, and optionally silence stderr (as discussed in puppetlabs/pdk#323).

from puppet-software.

bittner avatar bittner commented on July 30, 2024

NOTE: We're now using the mathow/centos-puppet-pdk Docker image for GitLab CI builds with PDK, as long as there is no official PDK Docker image yet, which is still in the making according to Puppetlabs officials:

# FILE: .gitlab-ci.yml

validate:
  stage: build
  image: mathow/centos-puppet-pdk
  script:
    - pdk validate 2> /dev/null

rspec:
  stage: test
  image: mathow/centos-puppet-pdk
  script:
    - pdk test unit 2> /dev/null

from puppet-software.

edestecd avatar edestecd commented on July 30, 2024

very cool! Were also using gitlab ci with docker and this would be great!

from puppet-software.

bittner avatar bittner commented on July 30, 2024

I've now added a similar configuration for Travis to PR #15. Would you mind merging?

from puppet-software.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.