Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding UNIX CLI dependent workflows #515

Open
colbyn opened this issue May 29, 2019 · 0 comments
Open

Regarding UNIX CLI dependent workflows #515

colbyn opened this issue May 29, 2019 · 0 comments

Comments

@colbyn
Copy link

colbyn commented May 29, 2019

I hope I’m not intruding or anything. I literally just discovered your project and it’s everything I’ve always wanted from Docker! :)

Anyway if you’re ever looking for some inspiration for shell scripting, theres this project I’ve written a while back (and still use such personally every day, especially for quickly running hardcoded commands from the horribly verbose AWS CLI) that implements an indentation sensitive shell parser: https://github.com/colbyn/commands
Anyway just thought it may interest you (also I’ve been thinking about rewriting such in rust).

It doesn’t try to replace shell scripting in any way, rather the intention was to simply make writing such less verbose, and feel more modern (i.e. it supports multiline strings; which has been very convenient for CLI based SQL workflows). It’s crazy that in Docker I have to write scripts like this:

RUN cd ./frontend/cms \
  && npm install \
  && bower install --allow-root \
  && mkdir -p ./dist/release/build \
  && pulp browserify --optimise --to ./dist/release/build/app.bundle.js \
  && browserify -p tinyify ./dist/release/build/app.bundle.js --outfile ./dist/release/build/app.bundle.js \
  && uglifycss ./assets/css/*.css > ./dist/release/build/app.bundle.css \
  && html-minifier ./assets/index.html \
    --collapse-whitespace \
    --remove-comments \
    --remove-optional-tags \
    --remove-redundant-attributes \
    --remove-script-type-attributes \
    --remove-tag-whitespace \
  && cp -r ./dist ../../release/build

Since I think an indentation sensitive shell parser feels more natural (also with some higher order convenience utils, i.e. the from thing (not sure what to call it)):

from ./frontend/cms do
  npm install
  bower install
    --allow-root
  mkdir -p ./dist/release/build
  pulp browserify
    --optimise
    --to ./dist/release/build/app.bundle.js
  browserify
    -p tinyify ./dist/release/build/app.bundle.js
    --outfile ./dist/release/build/app.bundle.js
  uglifycss ./assets/css/*.css > ./dist/release/build/app.bundle.css
  html-minifier ./assets/index.html
    --collapse-whitespace
    --remove-comments
    --remove-optional-tags
    --remove-redundant-attributes
    --remove-script-type-attributes
    --remove-tag-whitespace
  cp -r ./dist ../../release/build

Here is an example from a UI lib I'm currently working on (internal helper cmd):

from ./ss-web-utils do
    try cargo publish
from ./ss-css-types do
    try cargo publish
from ./ss-cssom-tree do
    try cargo publish
from ./ss-trees do
    try cargo publish
from ./ss-view-tree do
    try cargo publish
from ./ss-dom-tree do
    try cargo publish
from ./subscript do
    try cargo publish

Or using ffmpeg (most of my real stuff usually spans hundreds of lines, which would quickly get very messy using traditional bash syntax):

mkdir -p output/batch
ffmpeg -hide_banner -y
    -i ./input/test-two.mp4
    -an
    -c:v libx264
    -profile:v high
    -level 3.1
    -preset veryslow
    -flags +loop
    -pix_fmt yuv420p
    -qp 1 output/batch/out1.mp4
    -qp 50 output/batch/out2.mp4
    -qp 60 output/batch/out3.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant