Compare commits
No commits in common. "main" and "dev-mr-test" have entirely different histories.
main
...
dev-mr-tes
@ -1,7 +1,6 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
LABEL author="Piotr Biernat"
|
||||
LABEL service="api-gw"
|
||||
LABEL vendor="Egommerce"
|
||||
LABEL version="1.0"
|
||||
|
||||
|
12
Makefile
12
Makefile
@ -1,12 +0,0 @@
|
||||
DEPLOY_DIR := ./deploy
|
||||
SRC_DIR := ./src
|
||||
|
||||
## DEPLOY PART
|
||||
build-image-dev:
|
||||
- sh ${DEPLOY_DIR}/image-build.sh dev
|
||||
|
||||
build-image-prod:
|
||||
- sh ${DEPLOY_DIR}/image-build.sh
|
||||
|
||||
push-image-prod:
|
||||
- sh ${DEPLOY_DIR}/image-push.sh
|
@ -2,8 +2,7 @@ include apigw_backends.conf;
|
||||
include apigw_keys.conf;
|
||||
|
||||
server {
|
||||
access_log /var/log/nginx/apigw_access.log main;
|
||||
error_log /var/log/nginx/apigw_error.log warn;
|
||||
access_log /var/log/nginx/apigw_access.log main;
|
||||
|
||||
listen 80;
|
||||
# listen 443 ssl;
|
||||
@ -31,6 +30,9 @@ server {
|
||||
location = /_validate_apikey {
|
||||
internal;
|
||||
|
||||
access_log /var/log/nginx/apigw_access.log main;
|
||||
error_log /var/log/nginx/apigw_error.log warn;
|
||||
|
||||
if ($http_apikey = "") {
|
||||
return 401; # Unauthorized
|
||||
}
|
||||
|
@ -3,14 +3,11 @@
|
||||
|
||||
export IMAGE_NAME="git.pbiernat.dev/egommerce/apigw-svc"
|
||||
|
||||
TARGET=${1:-latest}
|
||||
branch=${DRONE_TAG:=$CI_COMMIT_BRANCH}
|
||||
branch=$(echo $branch | grep -v /) || echo $branch ;
|
||||
p1=$(echo $branch | cut -d / -f1 -s) &&
|
||||
p2=$(echo $branch | cut -d / -f2 -s) &&
|
||||
tag=${branch:=$p1-$p2} &&
|
||||
echo "Building" $tag
|
||||
|
||||
echo "Building: $IMAGE_NAME:$TARGET"
|
||||
if [ $TARGET = "dev" ]
|
||||
then
|
||||
docker build --rm --no-cache -t "$IMAGE_NAME:dev" . >/dev/null 2>&1
|
||||
else
|
||||
docker build --rm --cache-from "$IMAGE_NAME:$TARGET" -t "$IMAGE_NAME:$TARGET" . >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
docker build --rm --cache-from "$IMAGE_NAME:latest" -t "$IMAGE_NAME:latest" .
|
||||
|
Loading…
Reference in New Issue
Block a user