From c654c777cd727bec9d54ab8045f9484c81adf21a Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Mon, 27 Mar 2017 00:29:10 +0200 Subject: [PATCH] ``` --- .gitlab-ci.yml | 28 ++++++++++++++++++++++------ example/README.md | 18 ++++++++++++++++++ example/build.sh | 5 +++++ example/build_as_vagrant.sh | 5 +++++ 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 example/README.md create mode 100644 example/build.sh create mode 100644 example/build_as_vagrant.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b76c343..c2fe756 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,27 @@ -check_validity: - stage: test + +deploy_example: + stage: deploy + tags: + - vagrant + - develop19216822423 script: - - python make.py newbox test - - cd test + - 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 meta - - grep "1.0" metadata.json - - grep "example" metadata.json + script: - 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 new file mode 100644 index 0000000..e3ae34d --- /dev/null +++ b/example/README.md @@ -0,0 +1,18 @@ +# example + +This is an example box. +Version: 1.0 + +It won't be compiled. + +--- + +This section will be automatically replaced by `python make.py` with auto-generated +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" +``` diff --git a/example/build.sh b/example/build.sh new file mode 100644 index 0000000..205a232 --- /dev/null +++ b/example/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# This will be executed during build process as root +# You can delete it if you want to. +# cd into a directory if you depend on a particular working directory. diff --git a/example/build_as_vagrant.sh b/example/build_as_vagrant.sh new file mode 100644 index 0000000..8e9ea4b --- /dev/null +++ b/example/build_as_vagrant.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# This will be executed during build process as user Vagrant +# You can delete it if you want to. +# cd into a directory if you depend on a particular working directory. -- GitLab