diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2fe756d7936d75d35dbde7b3827abd7a3a2d9e4..b76c343d2b06b37118f059f97ca1fdc11e000834 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,27 +1,11 @@ - -deploy_example: - stage: deploy - tags: - - vagrant - - develop19216822423 +check_validity: + stage: test script: - - vagrant box remove henrietta/example || true - - vagrant box add henrietta/example file:///var/www/html/dev/vagrant/example.box -build_example: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh example/ - - cp SkeletonVagrantfile example/Vagrantfile - - cd example + - python make.py newbox test + - cd test - python ../make.py meta - script: + - grep "1.0" metadata.json + - grep "example" metadata.json - vagrant up - - vagrant package --out example.box - - mv -f example.box /var/www/html/dev/vagrant/example.box - - cd .. - after_script: - vagrant destroy -f - cd .. diff --git a/example/README.md b/example/README.md index e3ae34d05a0f5efb20bb5ae3ead4c31e2547d122..35431264f45b34371ba010b437737d579709c8d4 100644 --- a/example/README.md +++ b/example/README.md @@ -11,6 +11,13 @@ This section will be automatically replaced by `python make.py` with auto-genera content of Vagrantfile that will refer to this box --- +Usage in Vagrantfile: +``` +config.vm.box = "henrietta/example" +config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/example.box" +`` +--- + Usage in Vagrantfile: ``` config.vm.box = "henrietta/example" diff --git a/make.py b/make.py index 1bd38425ed05f7545537b0e4bf25eb997cde6437..cef41990c48c22e1fef158009e9aacc345750c43 100644 --- a/make.py +++ b/make.py @@ -42,7 +42,7 @@ def writefile(content, path, prefix=None): if __name__ == '__main__': - dirs = [dir for dir in os.listdir('.') if os.path.isdir(dir) or (dir != '.git')] + dirs = [dir for dir in os.listdir('.') if os.path.isdir(dir) and (dir not in ('.git', 'example'))] exi = lambda box, sup: os.path.exists(os.path.join(box, 'build%s.sh' % (sup,))) boxes = [box for box in dirs if exi(box, '') or exi(box, '_as_vagrant')]