Skip to content

Commit 3611903

Browse files
committed
inital commit
0 parents  commit 3611903

File tree

6 files changed

+91
-0
lines changed

6 files changed

+91
-0
lines changed

.additional_bashrc.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
alias ll='ls -alh'
2+
export PATH=$PATH:./bin:./vendor/bin:./node_modules/.bin
3+
source ~/.git-completion.bash
4+
source ~/.git-prompt.sh
5+
6+
PS1='\033]2;'$(pwd)'\007\[\e[0;36m\][\[\e[1;31m\]\u\[\e[0;36m\]@\[\e[1;34m\]\h\[\e[0;36m\]: \[\e[0m\]\w\[\e[0;36m\]]\[\e[0m\]\$\[\e[1;32m\]\s\[\e[0;33m\]$(__git_ps1)\[\e[0;36m\]> \[\e[0m\]\n$ ';
7+
8+
DOCKER_COMPOSE_PROJECT=$(docker inspect ${HOSTNAME} | grep '"com.docker.compose.project":' | awk '{print $2}' | tr --delete '"' | tr --delete ',')
9+
NODE_CONTAINER=$(docker ps -f "name=${DOCKER_COMPOSE_PROJECT}_node_1" --format {{.Names}})
10+
alias node='docker exec -w $(pwd) -it ${NODE_CONTAINER} node'
11+
alias npm='docker exec -w $(pwd) -it ${NODE_CONTAINER} npm'
12+
alias yarn='docker exec -w $(pwd) -it ${NODE_CONTAINER} yarn'
13+
14+
# Run SSH Agent and add key 7d
15+
if [ -z "$SSH_AUTH_SOCK" ] ; then
16+
eval `ssh-agent -s`
17+
ssh-add -t 604800 ~/.ssh/id_rsa
18+
fi

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea/

.vimrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
filetype indent plugin on
2+
syntax on
3+
set hidden

CreateBranches.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Pluswerk;
5+
6+
final class CreateBranches
7+
{
8+
private $config = [
9+
'apache' => 'webdevops/php-apache-dev:7.3',
10+
'apache-7.3' => 'webdevops/php-apache-dev:7.3',
11+
'apache-7.2' => 'webdevops/php-apache-dev:7.2',
12+
'apache-7.1' => 'webdevops/php-apache-dev:7.1',
13+
'apache-7.0' => 'webdevops/php-apache-dev:7.0',
14+
'apache-5.6' => 'webdevops/php-apache-dev:5.6',
15+
16+
'nginx' => 'webdevops/php-nginx-dev:7.3',
17+
'nginx-7.3' => 'webdevops/php-nginx-dev:7.3',
18+
'nginx-7.2' => 'webdevops/php-nginx-dev:7.2',
19+
'nginx-7.1' => 'webdevops/php-nginx-dev:7.1',
20+
'nginx-7.0' => 'webdevops/php-nginx-dev:7.0',
21+
'nginx-5.6' => 'webdevops/php-nginx-dev:5.6',
22+
];
23+
24+
public function __construct()
25+
{
26+
`git checkout master -f && git push`;
27+
foreach ($this->config as $branch => $FROM) {
28+
`git checkout master -f && git reset Dockerfile && git checkout Dockerfile && git checkout -B $branch`;
29+
$lines = file("Dockerfile");
30+
$lines[0] = "FROM $FROM\n";
31+
file_put_contents("Dockerfile", $lines);
32+
`git add Dockerfile && git commit -m 'set image version to $branch with FROM $FROM'`;
33+
}
34+
$branches = implode(' ', array_keys($this->config));
35+
`git push -f --atomic origin $branches`;
36+
`git checkout master -f`;
37+
}
38+
}
39+
40+
new CreateBranches();

Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM webdevops/php-apache-dev:7.3
2+
3+
# add sudo; without password
4+
RUN apt-get update && \
5+
apt-get install -y sudo vim nano tree bash-completion && \
6+
rm -rf /var/lib/apt/lists/* && \
7+
usermod -aG sudo application && \
8+
echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
9+
10+
RUN curl -fsSL https://get.docker.com/ | sh && \
11+
sudo usermod -aG docker application && \
12+
sudo usermod -aG 999 application
13+
14+
USER application
15+
RUN composer global require hirak/prestissimo
16+
17+
# add .git-completion.bash
18+
RUN curl https://raw.githubusercontent.com/git/git/v$(git --version | awk 'NF>1{print $NF}')/contrib/completion/git-completion.bash > /home/application/.git-completion.bash
19+
# add .git-prompt.bash
20+
RUN curl https://raw.githubusercontent.com/git/git/v$(git --version | awk 'NF>1{print $NF}')/contrib/completion/git-prompt.sh > /home/application/.git-prompt.sh
21+
22+
# add .additional_bashrc.sh
23+
COPY .additional_bashrc.sh /home/application/.additional_bashrc.sh
24+
COPY .vimrc /home/application/.vimrc
25+
COPY apache.conf /opt/docker/etc/httpd/vhost.common.d/apache.conf
26+
RUN echo "source ~/.additional_bashrc.sh" >> ~/.bashrc
27+
28+
USER root

apache.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AllowEncodedSlashes On

0 commit comments

Comments
 (0)