View jest_with_parcel.txt
// babel.rc
{
"presets": [
"es2015"
]
}
// package.json
{
"dependencies": {
View FilterBranchName.sh
echo 'feature/testingGDSC' | sed -e 's/\//-/g'
View Go build with docker
docker run --rm -v ${PWD}:/go/src/github.com/herlon214/gdsc -w /go/src/github.com/herlon214/gdsc/cmd/gdsc golang:latest /bin/bash -c "go get -v && go build -v -o /go/src/github.com/herlon214/gdsc/dist"
View NPM fix docker permissions.md

Fix npm docker permissions

Add this line into your Dockerfile

RUN npm config set unsafe-perm=true

View Dockerfile
FROM traefik:camembert
ADD traefik.toml .
EXPOSE 80
EXPOSE 8080
EXPOSE 443
View Mysql create user and give permissions to database.md
CREATE USER 'user'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'user'@'%';
View Wordpress with SSL (Traefik) and AWS S3.md

Fix SSL

Put this in wp-config.php

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
define('WP_HOME','https://your.site/');
define('WP_SITEURL','https://your.site/');

Media Upload & S3

View build_and_update_swarm.sh
branch=${GIT_BRANCH##origin/}
commit=$(git rev-parse --short HEAD)
docker build -t ${REGISTRY}:${branch}.${commit} .
docker push ${REGISTRY}:${branch}.${commit}
docker service update --with-registry-auth --image ${REGISTRY}:${branch}.${commit} ${JOB_NAME}_${branch}
View swarm_clean.sh
#!/bin/bash
docker node ls | grep Down | while read a
do
IFS=' ' read -a field <<< $a
echo "--> Removing ${field[0]}"
docker node rm ${field[0]}
done
View docker_clean.sh
#/bin/bash
docker volume rm $(docker volume ls -q -f dangling=true)
docker rmi -f $(docker images -qf "dangling=true")