From 50dc96ab9a364b0cfe52d7b00038c068d9607c27 Mon Sep 17 00:00:00 2001 From: MatteoGheza Date: Tue, 16 Mar 2021 09:49:49 +0000 Subject: [PATCH] Fully automate dev setup with Gitpod This commit implements a fully-automated development setup using Gitpod.io, an online IDE for GitLab, GitHub, and Bitbucket that enables Dev-Environments-As-Code. This makes it easy for anyone to get a ready-to-code workspace for any branch, issue or pull request almost instantly with a single click. --- .gitpod.Dockerfile | 5 +++++ .gitpod.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..77206d7 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,5 @@ +#Inspired from https://github.com/koel/koel/blob/master/.gitpod.dockerfile + +FROM gitpod/workspace-mysql:latest + +ENV APACHE_DOCROOT_IN_REPO="server" \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..e4c2bb2 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,34 @@ +#Inspired from + +image: + file: .gitpod.dockerfile +ports: + - port: 8001 + onOpen: open-preview + - port: 3306 + onOpen: ignore +tasks: + - name: Apache + command: > + touch /var/log/apache2/error.log; + touch /var/log/apache2/access.log; + multitail /var/log/apache2/error.log -I /var/log/apache2/access.log + - name: Allerta + init: > + cd server; + composer install; + composer update; + cd resources; + npm install; + npm run prod; + cd ../..; + command: > + cd server/install; + WORKSPACE_URL=$(gp url 8001 | sed -E s/\\/$//); + mysql -e "CREATE DATABASE IF NOT EXISTS allerta"; + mysql -e "CREATE USER 'allerta'@'localhost' IDENTIFIED BY 'allerta_pwd';"; + mysql -e "GRANT ALL PRIVILEGES ON * . * TO 'allerta'@'localhost';"; + mysqladmin reload; + php install.php config -n "allerta" -u "allerta" -a "allerta_pwd" -o "127.0.0.1" -r "DEV_ENV"; + php install.php populate -m "admin" -b -s "password" -w "owner" -e "mail@mailserver.local"; + apachectl start; \ No newline at end of file diff --git a/README.md b/README.md index 205e44f..0c87b13 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # allerta-vvf -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fallerta-vvf%2Fallerta-vvf.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fallerta-vvf%2Fallerta-vvf?ref=badge_shield) ![PHP Code Testing](https://github.com/allerta-vvf/allerta-vvf/workflows/PHP%20Code%20Testing/badge.svg) ![Languages count](https://img.shields.io/github/languages/count/allerta-vvf/allerta-vvf) ![Top language](https://img.shields.io/github/languages/top/allerta-vvf/allerta-vvf) ![GitHub issues](https://img.shields.io/github/issues-raw/allerta-vvf/allerta-vvf) ![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/allerta-vvf/allerta-vvf) ![GitHub stars](https://img.shields.io/github/stars/allerta-vvf/allerta-vvf?style=social) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fallerta-vvf%2Fallerta-vvf.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fallerta-vvf%2Fallerta-vvf?ref=badge_shield) ![PHP Code Testing](https://github.com/allerta-vvf/allerta-vvf/workflows/PHP%20Code%20Testing/badge.svg) ![Languages count](https://img.shields.io/github/languages/count/allerta-vvf/allerta-vvf) ![Top language](https://img.shields.io/github/languages/top/allerta-vvf/allerta-vvf) ![GitHub issues](https://img.shields.io/github/issues-raw/allerta-vvf/allerta-vvf) ![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/allerta-vvf/allerta-vvf) ![GitHub stars](https://img.shields.io/github/stars/allerta-vvf/allerta-vvf?style=social) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/allerta-vvf/allerta-vvf) **Coming soon, stay tuned!** :thumbsup: