From 8b809bafcaa252a5d288f125f9e2ee7930266699 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Fri, 30 Sep 2022 15:46:34 +0800 Subject: [PATCH] Dockerfile removed, README fixes --- .dockerignore | 4 --- Dockerfile | 27 --------------- README.md | 30 +++-------------- gen-makefile | 92 --------------------------------------------------- 4 files changed, 5 insertions(+), 148 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile delete mode 100755 gen-makefile diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 4ff89d2..0000000 --- a/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -.git -.gitignore -.dockerignore -README.md diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 45fcf65..0000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ubuntu:22.04 - -RUN apt update && \ - apt -y install \ - apt-transport-https \ - apt-utils \ - bsdmainutils \ - curl \ - dialog \ - grep \ - make \ - man \ - sudo \ - wget - -RUN adduser ivan \ - --quiet \ - --home=/home/ivan \ - --ingroup=sudo \ - --disabled-password \ - --disabled-login - -COPY ./ /home/ivan/my-env -RUN echo "ivan ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - -USER ivan -WORKDIR /home/ivan/my-env diff --git a/README.md b/README.md index 01fa750..69dfa99 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ make ### Selective straightforward installation ```shell -# from remote file +# from remote file (you can meet interaction bugs this way!) wget -qO - https://git.axenov.dev/anthony/my-env/raw/branch/master/install/apt | bash -# from locally cloned repo +# from locally cloned repo (except scripts from ./packs) ./install/apt ``` @@ -58,11 +58,12 @@ wget -qO - https://git.axenov.dev/anthony/my-env/raw/branch/master/install/apt | 3. Test your script 4. Run `make self` to generate new `./Makefile` -## How to create packs? +## How to create a pack? You can create new file inside `./packs` dir. -Syntax is same as classic makefile with one important and necessary addition -- a comment started with `##`: +Syntax is same as classic makefile. +It is important to add a comment with short description: ```makefile # Pack description @@ -80,27 +81,6 @@ where: * `mypack*` is the pack name * `goal*` are script names in `./install` -## Testing in docker (not recommended) - -> Note that this is almost useless way to test since you'll meet errors in many cases because dockerized OS is not fully-functional and will never be. -> -> You can use docker to test something **really simple**, e.g. to check general script steps or install cli tools. -> -> In other cases you need virtualized Ubuntu instead of dockerized one, so I strongly recommend you to use [VirtualBox](https://www.virtualbox.org/wiki/Downloads) or your host machine. - -```shell -# switch to repo dir -cd my-env - -# build and run container -docker build -t myenv . && docker run -it myenv - -# or oneliner -docker run -it $(docker build -q .) -``` - -Now you can play around with scripts. - ## TODO * build: [flameshot](https://github.com/flameshot-org/flameshot#compilation) diff --git a/gen-makefile b/gen-makefile deleted file mode 100755 index 163f333..0000000 --- a/gen-makefile +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -mv Makefile Makefile.bak -CHR_UPGRADE='^' -CHR_UNINSTALL='/' - -cat << EOF >> Makefile -# Autogenerated at $(date +'%d.%m.%Y %H:%M') using ${BASH_SOURCE[0]} -.DEFAULT_GOAL := help - -#=============================================== -# Scripts listed in ./packs -#=============================================== - -EOF - -for file in ./packs/*; do - cat "$file" >> Makefile - echo >> Makefile -done; - -cat << EOF >> Makefile -#=============================================== -# Scripts listed in ./install -#=============================================== - -EOF - -for file in ./install/*; do - name=${file##*/} - name=${name%.sh} - desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file}) - [ -z "$desc" ] && desc='' - echo -e "# ${desc}\n${name}:\n\t@${file}\n" >> Makefile -done; - -cat << EOF >> Makefile -#=============================================== -# Scripts listed in ./upgrade -#=============================================== - -EOF - -for file in ./upgrade/*; do - name=${file##*/} - name=${name%.sh} - desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file}) - [ -z "$desc" ] && desc='' - echo -e "# ${desc}\n${CHR_UPGRADE}${name}:\n\t@${file}\n" >> Makefile -done; - -cat << EOF >> Makefile -#=============================================== -# Scripts listed in ./uninstall -#=============================================== - -EOF - -for file in ./uninstall/*; do - name=${file##*/} - name=${name%.sh} - desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file}) - [ -z "$desc" ] && desc='' - echo -e "# ${desc}\n${CHR_UNINSTALL}${name}:\n\t@${file}\n" >> Makefile -done; - -cat << EOF >> Makefile -#=============================================== -# Service goals -#=============================================== - -self: - @./gen-makefile - -help: Makefile - @echo "Ubuntu software installator" - @echo - @echo "Usage:\n \ - make help|- show this help\n \ - make self|- regenerate Makefile (alias of ./gen-makefile)\n \ - make GOAL|- install software\n \ - make ${CHR_UPGRADE}GOAL|- upgrade software\n \ - make ${CHR_UNINSTALL}GOAL|- uninstall software" | column -ts '|' - @echo "\nYou can combine GOALs, here are some examples:" - @echo "\tmake @docker docker" - @echo "\tmake php @docker ^omz" - @echo "\nAvailable GOALs:" - @sed -n '/^#/{N;s/# *\(.*\)\n\([^# .].*:\)/\t\2\1/p}' $< | column -ts ':' -EOF - -echo "New ./Makefile has been generated!" -echo "Old one has been saved as ./Makefile.bak" -echo "Now run 'make' to get help"