Created
April 10, 2020 16:48
-
-
Save edbizarro/44f4c8e014915a019e3e8255b0fa3a80 to your computer and use it in GitHub Desktop.
docker.zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A_BASE=$HOME/.cache/gitlab-ci-pipeline-php | |
# define specific cache directories | |
A_CONFIG=$A_BASE/.config | |
A_CACHE=$A_BASE/.cache | |
A_LOCAL=$A_BASE/.local | |
A_SSH=$HOME/.ssh | |
A_COMPOSER=$A_BASE/.composer | |
A_YARN=$A_BASE/.yarn | |
# create directories | |
mkdir -p $A_CONFIG | |
mkdir -p $A_CACHE | |
mkdir -p $A_LOCAL | |
mkdir -p $A_COMPOSER | |
mkdir -p $A_YARN | |
# reset permissions | |
chown -R $(whoami) $A_BASE | |
# home directory | |
A_USER_HOME=/home/php | |
DOCKER_OPTS="-it --rm -v $HOME:$HOME -v $(pwd):/var/www/html -v $A_COMPOSER:$A_USER_HOME/.composer -v $A_YARN:$A_USER_HOME/.yarn -v $A_CONFIG:$A_USER_HOME/.config -v $A_CACHE:$A_USER_HOME/.cache -v $A_LOCAL:$A_USER_HOME/.local -v $A_SSH:$A_USER_HOME/.ssh" | |
# COMPOSER | |
alias c="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine composer" | |
alias ci="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine composer install" | |
alias cu="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine composer up" | |
alias cg="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine composer global" | |
alias cr="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine composer require" | |
# YARN | |
alias y="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine yarn --cache-folder ~/.yarn" | |
alias yi="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine yarn install --pure-lock --cache-folder ~/.yarn" | |
alias yu="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine yarn upgrade --cache-folder ~/.yarn" | |
# PHP | |
alias p="docker run $DOCKER_OPTS edbizarro/gitlab-ci-pipeline-php:7.4-alpine php" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment