diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3261735b7c3d5aae9abf58ab669481363de4b2f2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,133 +0,0 @@ - -deploy: - stage: deploy - tags: - - vagrant - - develop19216822423 - script: - - vagrant box remove henrietta/cassandra - - vagrant box add henrietta/cassandra file:///var/www/html/dev/vagrant/cassandra.box - - vagrant box remove henrietta/cass_zk_rmq - - vagrant box add henrietta/cass_zk_rmq file:///var/www/html/dev/vagrant/cass_zk_rmq.box - - vagrant box remove henrietta/czr_pythons - - vagrant box add henrietta/czr_pythons file:///var/www/html/dev/vagrant/czr_pythons.box - - vagrant box remove henrietta/czr_pythons_pg - - vagrant box add henrietta/czr_pythons_pg file:///var/www/html/dev/vagrant/czr_pythons_pg.box - - vagrant box remove henrietta/nodejs4 - - vagrant box add henrietta/nodejs4 file:///var/www/html/dev/vagrant/nodejs4.box - - vagrant box remove henrietta/nodejs5_jdk_adk25 - - vagrant box add henrietta/nodejs5_jdk_adk25 file:///var/www/html/dev/vagrant/nodejs5_jdk_adk25.box - -build_cassandra: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh cassandra/ - - cp SkeletonVagrantfile cassandra/Vagrantfile - - cd cassandra - - python ../make.py meta - script: - - vagrant up - - vagrant package --out cassandra.box - - mv -f cassandra.box /var/www/html/dev/vagrant/cassandra.box - - cd .. - after_script: - - vagrant destroy -f - - cd .. - -build_cass_zk_rmq: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh cass_zk_rmq/ - - cp SkeletonVagrantfile cass_zk_rmq/Vagrantfile - - cd cass_zk_rmq - - python ../make.py meta - script: - - vagrant up - - vagrant package --out cass_zk_rmq.box - - mv -f cass_zk_rmq.box /var/www/html/dev/vagrant/cass_zk_rmq.box - - cd .. - after_script: - - vagrant destroy -f - - cd .. - -build_czr_pythons: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh czr_pythons/ - - cp SkeletonVagrantfile czr_pythons/Vagrantfile - - cd czr_pythons - - python ../make.py meta - script: - - vagrant up - - vagrant package --out czr_pythons.box - - mv -f czr_pythons.box /var/www/html/dev/vagrant/czr_pythons.box - - cd .. - after_script: - - vagrant destroy -f - - cd .. - -build_czr_pythons_pg: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh czr_pythons_pg/ - - cp SkeletonVagrantfile czr_pythons_pg/Vagrantfile - - cd czr_pythons_pg - - python ../make.py meta - script: - - vagrant up - - vagrant package --out czr_pythons_pg.box - - mv -f czr_pythons_pg.box /var/www/html/dev/vagrant/czr_pythons_pg.box - - cd .. - after_script: - - vagrant destroy -f - - cd .. - -build_nodejs4: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh nodejs4/ - - cp SkeletonVagrantfile nodejs4/Vagrantfile - - cd nodejs4 - - python ../make.py meta - script: - - vagrant up - - vagrant package --out nodejs4.box - - mv -f nodejs4.box /var/www/html/dev/vagrant/nodejs4.box - - cd .. - after_script: - - vagrant destroy -f - - cd .. - -build_nodejs5_jdk_adk25: - stage: build - tags: - - vagrant - - develop19216822423 - before_script: - - cp *.sh nodejs5_jdk_adk25/ - - cp SkeletonVagrantfile nodejs5_jdk_adk25/Vagrantfile - - cd nodejs5_jdk_adk25 - - python ../make.py meta - script: - - vagrant up - - vagrant package --out nodejs5_jdk_adk25.box - - mv -f nodejs5_jdk_adk25.box /var/www/html/dev/vagrant/nodejs5_jdk_adk25.box - - cd .. - after_script: - - vagrant destroy -f - - cd .. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..4e4eb8195334626a2460d613095f0d66d5801ad8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +Chcesz jakÄ Ĺ typowÄ VM-kÄ? + +StwĂłrz sobie jakÄ Ĺ gaĹÄ Ĺş o nazwie rĂłwnej nazwie swojego boxa, zrĂłb folder(y) o nazwie boxa, +wrzuÄ tam `build.sh` (wywoĹwany jako root ) albo `build_as_vagrant.sh` (wywoĹywany jako +uzytkownik _vagrant_), dorzuÄ _README.md_ ktĂłrego trzeciÄ liniÄ bÄdzie krĂłtki opis, +i siÄ zrobi, wgra i bÄdzie na [http://dev.dms-serwis.com.pl/vagrant/](http://dev.dms-serwis.com.pl/vagrant/) + +Np. maszyna **funky** +**funky/build.sh**: +```bash +#!/usr/bin/env bash + +wynurz.sh java +wynurz.sh cassandra +wynurz.sh rabbitmq +wynurz.sh zookeeper +``` + +**funky/README.md**: +```markdown +# funky + +java + cass + rmq + zk + +Maszyna z: +* CassandrÄ .. +``` + +SposĂłb uĹźycia bÄdzie w README w katalogu po wbiciu `python make.py` w gĹĂłwnym katalogu. +Zostanie doczepiony do twojego README. Ponowne wywoĹanie nie doczepiÄ go ponownie. + +Generalnie buduje siÄ tylko to co jest na dalej gaĹÄzi. Po wywoĹaniu `python make.py` +wyĹlij to na repo i niech CI czyni magiÄ. + +**master** to taka czysta kartka - do robienia nowych branchĂłw tylko. +Wpisz siÄ w **mastera** diff --git a/README.md b/README.md index 54b19f557ff5f6b2a2f2b1bb8ef22b8fb0327354..80629793d6ed94eb3ceca92a8cc3ea29466634c8 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,13 @@ # vagrant-boxen -**Problem:** installing same things over and over makes builds long +ZbiĂłr typowych boxĂłw vagrantowych, co by kompilacje szybciej szĹy. +MoĹźna dodawaÄ wĹasne! -**Solution:** make Vagrant images with common things preinstalled +[Chcesz tworzyÄ wĹasne typowe VMki?](/CONTRIBUTING.md) -Boxes are based off *debian/contrib-jessie64* +Zobacz dostÄpne [http://git.dms-serwis.com.pl/henrietta/vagrant-boxen/branches](branche) +Ĺźeby widzieÄ jakie sÄ vmki. -# How to rebuild +Ew wbij na [http://dev.dms-serwis.com.pl/vagrant](http://dev.dms-serwis.com.pl/vagrant). -```bash -python make.py -git add --all -git commit -m "dfdf" -git push origin master -``` - -Boxes are automatically regenerated upon a push to master. -If you want to develop a single box, just make a branch that starts with it's name -and a dash, eg. **cassandra-something**. -Only it will then rebuild upon commit. - -Boxes, after being built, will be automatically available at -[http://dev.dms-serwis.com.pl/vagrant/](http://dev.dms-serwis.com.pl/vagrant/) - -# Box index - - * **cassandra**: [Debian Jessie x86_64 with Cassandra 3.0.9](/cassandra/README.md) -* **cass_zk_rmq**: [Cassandra, ZooKeeper, RabbitMQ](/cass_zk_rmq/README.md) -* **czr_pythons**: [Cassandra, ZooKeeper, RabbitMQ and assorted Pythons](/czr_pythons/README.md) -* **czr_pythons_pg**: [czr_pythons but with PostgreSQL](/czr_pythons_pg/README.md) -* **nodejs4**: [NodeJS 4 + bower + gulp](/nodejs4/README.md) -* **nodejs5_jdk_adk25**: [odeJS 5.x + JDK + ADT + cordova](/nodejs5_jdk_adk25/README.md) +W oparciu o *debian/contrib-jessie64* diff --git a/cass_zk_rmq/README.md b/cass_zk_rmq/README.md deleted file mode 100644 index 7ba2cd853ca86e803a64eb6ed3320699cb726e16..0000000000000000000000000000000000000000 --- a/cass_zk_rmq/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# cass_zk_mq - -Cassandra, ZooKeeper, RabbitMQ - -Added: -* curl -* Sun Java 8 -* Apache Cassandra 3.0.9 -* ZooKeeper -* RabbitMQ 3.3.5 (management plugin disabled) diff --git a/cass_zk_rmq/build.sh b/cass_zk_rmq/build.sh deleted file mode 100644 index f3f56765b54c6660e0e6477490de2f081b1d47f3..0000000000000000000000000000000000000000 --- a/cass_zk_rmq/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -wynurz.sh java -wynurz.sh cassandra -wynurz.sh zookeeeper -wynurz.sh rabbitmq diff --git a/cassandra/README.md b/cassandra/README.md deleted file mode 100644 index 5beb433fdb65c8dbe554963bd5de322318102d77..0000000000000000000000000000000000000000 --- a/cassandra/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# cassandra - -Debian Jessie x86_64 with Cassandra 3.0.9 - -Added: -* curl -* Sun Java 8 -* Apache Cassandra 3.0.9 diff --git a/cassandra/build.sh b/cassandra/build.sh deleted file mode 100644 index 99f5e0b0fd4f666915b7d9fd652e3c7b6166d0f2..0000000000000000000000000000000000000000 --- a/cassandra/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -wynurz.sh java -wynurz.sh cassandra \ No newline at end of file diff --git a/czr_pythons/README.md b/czr_pythons/README.md deleted file mode 100644 index 1ac9085ecd34db11e4235199b38f4f0634989d11..0000000000000000000000000000000000000000 --- a/czr_pythons/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# czr_pythons - -Cassandra, ZooKeeper, RabbitMQ and assorted Pythons - -It's [cass_zk_rmq](/cass_zk_rmq) but with extra: -* build-essentials -* git -* Python 2.7 - * cassandra, kazoo and CoolAMQP - * common utility and testing libraries diff --git a/czr_pythons/build.sh b/czr_pythons/build.sh deleted file mode 100644 index 107231f6688ce19181cb5c792b05fab94e9dc7db..0000000000000000000000000000000000000000 --- a/czr_pythons/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -apt-get install -y curl python python-pip python-dev python-setuptools build-essential git libffi-dev libyaml-dev libev4 libev-dev -pip install --upgrade pip==1.5.6 -pip install --upgrade setuptools==5.5.1 - -# Install RabbitMQ -$(wynurz.sh java && -wynurz.sh cassandra && -wynurz.sh rabbitmq && -wynurz.sh zookeeper) & - -pip install cassandra-driver kazoo CoolAMQP requests futures six monotonic nose mock diff --git a/czr_pythons_pg/README.md b/czr_pythons_pg/README.md deleted file mode 100644 index 3757c8e408324a8f2f79f7faaca9eb52f264c8f3..0000000000000000000000000000000000000000 --- a/czr_pythons_pg/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# czr_pythons_pg - -czr_pythons but with PostgreSQL - -It's [cass_zk_rmq](/cass_zk_rmq) but with extra: -* build-essentials -* git -* PostgreSQL 9.4 - * user _postgres_ password _postgres_ - * listens on 0.0.0.0 -* Python 2.7 - * cassandra, kazoo and CoolAMQP - * common utility and testing libraries diff --git a/czr_pythons_pg/build.sh b/czr_pythons_pg/build.sh deleted file mode 100644 index 923d59f8c9196b7c725fb37f3b1a6d003109fb75..0000000000000000000000000000000000000000 --- a/czr_pythons_pg/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -apt-get install -y curl python python-pip python-dev python-setuptools build-essential git libffi-dev libyaml-dev libev4 libev-dev libpq-dev -pip install --upgrade pip==1.5.6 -pip install --upgrade setuptools==5.5.1 -pip install --upgrade cffi - - -wynurz.sh java -wynurz.sh cassandra -wynurz.sh zookeeeper -wynurz.sh rabbitmq -wynurz.sh postgresql - -pip install cassandra-driver kazoo CoolAMQP requests futures six monotonic nose mock coverage psycopg2cffi wheel diff --git a/make.py b/make.py index 96d38f299fe49102ad19adc2c116f295f7c7eac3..1da44cd970f052157685b68e7e8167ed76691217 100644 --- a/make.py +++ b/make.py @@ -19,27 +19,37 @@ if __name__ == '__main__': if len(sys.argv) == 1: # Generate Gitlab CI file with open('.gitlab-ci.yml', 'wb') as ci: - ci.write(''' -deploy: - stage: deploy - tags: - - vagrant - - develop19216822423 - script:''') - for box in boxes: - ci.write(''' - - vagrant box remove $PREFIX$BOX - - vagrant box add $PREFIX$BOX file:///var/www/html/dev/vagrant/$BOX.box'''.replace('$BOX', box).replace('$PREFIX', PREFIX)) - ci.write('\n') - for box in boxes: + with open(os.path.join(box, 'README.md'), 'rb') as rin: + readme = '\n---\n'.join(rin.read().split('\n---\n'))[:-1] + readme = readme + ''' +--- + +Usage in Vagrantfile: +``` +config.vm.box = "$PREFIX$BOX" +config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/$BOX.box" +``` +'''.replace('$BOX', box).replace('$PREFIX', PREFIX) + + with open(os.path.join(box, 'README.md'), 'wb') as fo: + fo.write(readme) + try: os.unlink(os.path.join(box, 'metadata.json')) except OSError: pass ci.write(''' +deploy_$BOX: + stage: deploy + tags: + - vagrant + - develop19216822423 + script: + - vagrant box remove $PREFIX$BOX + - vagrant box add $PREFIX$BOX file:///var/www/html/dev/vagrant/$BOX.box build_$BOX: stage: build tags: @@ -59,52 +69,6 @@ build_$BOX: - vagrant destroy -f - cd .. '''.replace('$BOX', box).replace('$PREFIX', PREFIX)) - # README.md - index = [] - for box in boxes: - with open(os.path.join(box, 'README.md'), 'rb') as mdin: - description = mdin.readlines()[2].strip() - - index.append( - u'* **$BOX**: [$DESCRIPTION](/$BOX/README.md)\n'.replace('$DESCRIPTION', description).replace('$BOX', - box).replace( - '$PREFIX', PREFIX)) - - index = [u'''# vagrant-boxen - -**Problem:** installing same things over and over makes builds long - -**Solution:** make Vagrant images with common things preinstalled - -Boxes are based off *debian/contrib-jessie64* - -# How to rebuild - -```bash -python make.py -git add --all -git commit -m "dfdf" -git push origin master -``` - -Boxes are automatically regenerated upon a push to master. -If you want to develop a single box, just make a branch that starts with it's name -and a dash, eg. **cassandra-something**. -Only it will then rebuild upon commit. - -Boxes, after being built, will be automatically available at -[http://dev.dms-serwis.com.pl/vagrant/](http://dev.dms-serwis.com.pl/vagrant/) - -# Box index - - '''] + index - - with open('README.md', 'wb') as wo: - wo.write(u''.join(index).encode('utf8')) - - - - if ' '.join(sys.argv).endswith('meta'): box = os.path.split(os.getcwd())[-1] @@ -128,17 +92,3 @@ Boxes, after being built, will be automatically available at }] } '''.replace('$DESCRIPTION', description).replace('$BOX', box).replace('$PREFIX', PREFIX)) - - - with open('README.md', 'rb') as rin: - readme = rin.read() - - readme = readme + '''Use like: -``` -config.vm.box = "$PREFIX$BOX" -config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/$BOX.box" -``` -'''.replace('$BOX', box).replace('$PREFIX', PREFIX) - - with open('README.md', 'wb') as fo: - fo.write(readme) diff --git a/nodejs4/README.md b/nodejs4/README.md deleted file mode 100644 index 26ebf570dd8d8ee7251a3abf4e3b8a3cfea466c3..0000000000000000000000000000000000000000 --- a/nodejs4/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# nodejs4 - -NodeJS 4 + bower + gulp - -* NodeJS 4.x -* bower -* gulp -* git -* build-essential -* curl - -Use like: -``` -config.vm.box = "henrietta/nodejs4" -config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/nodejs4.box" -``` \ No newline at end of file diff --git a/nodejs4/build.sh b/nodejs4/build.sh deleted file mode 100644 index 68807ff6a75fad74946b910f0d2975f666720a8d..0000000000000000000000000000000000000000 --- a/nodejs4/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -wynurz.sh node4 -npm cache clean -npm install -g --unsafe-perm bower gulp diff --git a/nodejs5_jdk_adk25/README.md b/nodejs5_jdk_adk25/README.md deleted file mode 100644 index 2bf9eff2f342228c077bb072a9bef52b0593b9dc..0000000000000000000000000000000000000000 --- a/nodejs5_jdk_adk25/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# nodejs5_jdk_adk25 - -odeJS 5.x + JDK + ADT + cordova - -* NodeJS 5.12 -* bower -* gulp -* cordova 6.3.1 -* zipalign -* Android toolchain - * build-tools: - * 25.0.1 - * 24.0.0 - * Android platform: - * 25 - * 23 - * 23 - * Platform tools - * Google Play services - -Use like: -``` -config.vm.box = "henrietta/nodejs5_jdk_adk25" -config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/nodejs5_jdk_adk25.box" -``` - -This machine requires a lot of CPU and memory. You can use ones below: -``` - config.vm.provider "virtualbox" do |v| - v.memory = 1260 - v.cpus = 3 - end -``` diff --git a/nodejs5_jdk_adk25/build_as_vagrant.sh b/nodejs5_jdk_adk25/build_as_vagrant.sh deleted file mode 100644 index 963ff88e914a634b2b1a345c8b0efe33ddb3b213..0000000000000000000000000000000000000000 --- a/nodejs5_jdk_adk25/build_as_vagrant.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -cd ~ - -sudo apt-get install -y unzip wget tar - -echo """ -export PATH=\\$PATH:/home/vagrant/platform-tools:/home/vagrant/build-tools/25.0.1:/home/vagrant/tools -export ANDROID_HOME=/home/vagrant -""" >> /home/vagrant/.bashrc -source /home/vagrant/.bashrc - -(wynurz.sh node5 && -npm install -g --unsafe-perm bower gulp cordova@6.3.1 karma) & - -(wget -nv http://dev.dms-serwis.com.pl/misc/tools_r25.2.3-linux.zip && - unzip tools_r25.2.3-linux.zip && - rm -f tools_r25.2.3-linux.zip) & - -wynurz.sh jdk - -wait %2 - -echo y | ./tools/bin/sdkmanager "build-tools;25.0.1" "build-tools;24.0.0" "platforms;android-25" "platforms;android-24" "platforms;android-23" "platform-tools" "extras;android;m2repository" "extras;google;m2repository" "extras;google;google_play_services" - -wait %1 diff --git a/wynurz.sh b/wynurz.sh index c21f7ede4842b5d6922e1d548fc40cfa62a606df..6a255be221e137b993f74fc78800b74185127230 100644 --- a/wynurz.sh +++ b/wynurz.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Typowe polecenia do instalowania typowych rzeczy +# +# + if [ $1 == "java" ]; then # Oracle Java JRE apt-get install -y debconf-utils @@ -42,9 +46,9 @@ if [ $1 == "cassandra" ]; then apt-get update apt-get install -y cassandra=3.0.9 dsc30 cassandra-tools - $(sleep 30 && + (sleep 30 && service cassandra stop && - rm -rf /var/lib/cassandra/*) $ + rm -rf /var/lib/cassandra/*) & fi if [ $1 == "zookeeper" ]; then