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
|
FROM nginx:alpine
|
||||||
|
|
||||||
LABEL author="Piotr Biernat"
|
LABEL author="Piotr Biernat"
|
||||||
LABEL service="api-gw"
|
|
||||||
LABEL vendor="Egommerce"
|
LABEL vendor="Egommerce"
|
||||||
LABEL version="1.0"
|
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
|
|
@ -3,7 +3,6 @@ include apigw_keys.conf;
|
|||||||
|
|
||||||
server {
|
server {
|
||||||
access_log /var/log/nginx/apigw_access.log main;
|
access_log /var/log/nginx/apigw_access.log main;
|
||||||
error_log /var/log/nginx/apigw_error.log warn;
|
|
||||||
|
|
||||||
listen 80;
|
listen 80;
|
||||||
# listen 443 ssl;
|
# listen 443 ssl;
|
||||||
@ -31,6 +30,9 @@ server {
|
|||||||
location = /_validate_apikey {
|
location = /_validate_apikey {
|
||||||
internal;
|
internal;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/apigw_access.log main;
|
||||||
|
error_log /var/log/nginx/apigw_error.log warn;
|
||||||
|
|
||||||
if ($http_apikey = "") {
|
if ($http_apikey = "") {
|
||||||
return 401; # Unauthorized
|
return 401; # Unauthorized
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,11 @@
|
|||||||
|
|
||||||
export IMAGE_NAME="git.pbiernat.dev/egommerce/apigw-svc"
|
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"
|
docker build --rm --cache-from "$IMAGE_NAME:latest" -t "$IMAGE_NAME:latest" .
|
||||||
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."
|
|
||||||
|
Loading…
Reference in New Issue
Block a user