Skip to content

Instantly share code, notes, and snippets.

@panki
Created December 9, 2016 20:45
Show Gist options
  • Save panki/1fe33f25aa1addda302f71627f4aedaa to your computer and use it in GitHub Desktop.
Save panki/1fe33f25aa1addda302f71627f4aedaa to your computer and use it in GitHub Desktop.
.PHONY: all build test
SHELL:=/bin/bash
DOCKER_REGISTRY=021181094716.dkr.ecr.us-east-1.amazonaws.com
staging: clean build staging-image deploy-staging
production: clean build production-image deploy-production
npm-auth:
test -f .npmrc || docker run --rm -e NPM_REGISTRY=http://npm.klab-berlin.de -e NPM_USER=ci -e NPM_PASS=QM6CcwsfvY3rW32w -e NPM_EMAIL=it.systems@klab-berlin.com bravissimolabs/generate-npm-authtoken > .npmrc
run:
make npm-auth
docker-compose up
test:
npm run test
test-jenkins:
npm run test:jenkins
clean:
test -d build && find build -mindepth 1 -delete || mkdir build
build:
npm run build
echo "Date: $(shell date)" >build/info
echo "Hostname: $(shell hostname)" >>build/info
echo "Branch: $(shell git rev-parse --abbrev-ref HEAD)" >>build/info
echo "Commit: $(shell git rev-parse --verify HEAD)" >>build/info
build-in-container:
make npm-auth
make clean
docker-compose -f docker-compose-build.yml up --build --abort-on-container-exit
@ { \
export BUILDER_NAME=`docker-compose -f docker-compose-build.yml ps | grep builder | awk -F " " '{ print $$1 }'` ;\
docker logs $${BUILDER_NAME} ;\
exit `docker wait $${BUILDER_NAME}` ;\
}
staging-image:
docker build -f Dockerfile.production -t content-pipeline:latest .
docker tag content-pipeline:latest $(DOCKER_REGISTRY)/content-pipeline:latest
`aws ecr get-login --region us-east-1`
docker push $(DOCKER_REGISTRY)/content-pipeline
production-image:
docker build -f Dockerfile.production -t content-pipeline-production:latest .
docker tag content-pipeline-production:latest $(DOCKER_REGISTRY)/content-pipeline-production:latest
`aws ecr get-login --region us-east-1`
docker push $(DOCKER_REGISTRY)/content-pipeline-production
deploy-staging:
./scripts/aws deploy-staging
deploy-production:
./scripts/aws deploy-production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment