Coder Social home page Coder Social logo

script_utils's Introduction

script_utils

Bash scripts to condense and/or automate repititive local tasks.


docker_make_utils.sh

A script made to automate the task of building, tagging and pushing local Docker images to Azure Container Registry(ACR).

Usage

<command> options [parameters]
-h | --help - show help

Example. bash docker_make_utils.sh mycontainerregistry helloworld This is the equivalent to:
docker build -t helloworld .
docker tag helloworld mycontainerregistry.azurecr.io/helloworld:latest
docker push mycontainerregistry.azurecr.io/helloworld:latest

Note: If omitting the tag for the image, this will default to latest. A tag can be supplied as the 3rd argument, as seen in an example below:
bash docker_make_utils.sh mycontainerregistry helloworld v1
This is the equivalent to:
docker build -t helloworld .
docker tag helloworld mycontainerregistry.azurecr.io/helloworld:v1
docker push mycontainerregistry.azurecr.io/helloworld:v1

Note: You must still log in with either AZ CLI and run docker login before pushing to the container registry for the first time, if not authenticated already.
Tip: Bash scripts can be aliased locally - by editing the .bashrc file and adding the script location to your PATH to run this globally. Doing so then can have the script be run in the following manner(where dutils is the alias name): dutils mycontainerregistry helloworld v1



git_push_utils.sh

A script made to automate pushing git commits.

Usage

<command> options [parameters]
-h | --help - show help
The command requires a minimum of two arguments, which is the commit message(arg: 1) and upstream repo(arg: 2). Omitting the third argument which is the branch(arg: 3) will default to 'main'.

Example: bash git_push_utils.sh 'my first commit' origin This is the equivalent to:
git add .
git commit -m 'my first commit'
git push origin main

Note: The commit message must be in a string unless using only a single word for the commit message.

How it looks when specifying a branch. Example: bash git_push_utils.sh 'my first commit' origin dev This is the equivalent to:
git add .
git commit -m 'my first commit'
git push origin dev

As mentioned above, this script can be aliased within your .bashrc and script location added to your PATH so it can be executed globally.
Aliased example, where gutils is the script alias name: gutils 'initial commit' origin testing

script_utils's People

Contributors

ajsalemo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.