diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-11-11 13:40:45 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-11-11 13:40:45 -0400 |
| commit | 9c1e1512d071e2580b2f1f0645d9e865e741d4da (patch) | |
| tree | a8a56dd55d676169536f2a3ad5b3e4657ca7511e /src | |
| parent | 1fe817fe23c5639d0fe934251e0f18a31986f396 (diff) | |
| parent | f4ba7abb3a81629d70d0e051226aaee4ab765458 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/PropellorRepo.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Propellor/Property/PropellorRepo.hs b/src/Propellor/Property/PropellorRepo.hs new file mode 100644 index 00000000..20c13df1 --- /dev/null +++ b/src/Propellor/Property/PropellorRepo.hs @@ -0,0 +1,19 @@ +module Propellor.Property.PropellorRepo where + +import Propellor.Base +import Propellor.Git + +-- | Sets the url to use as the origin of propellor's git repository. +-- +-- When propellor --spin is used to update a host, the url is taken from +-- the repository that --spin is run in, and passed to the host. So, you +-- don't need to specifiy this property then. +-- +-- This property is useful when hosts are being updated without using +-- --spin, eg when using the `Propellor.Property.Cron.runPropellor` cron job. +hasUrl :: String -> Property NoInfo +hasUrl u = property ("propellor repo url " ++ u) $ do + curru <- liftIO getRepoUrl + if curru == Just u + then return NoChange + else makeChange $ setRepoUrl u |
