Skip to content

Instantly share code, notes, and snippets.

@itinance
Created April 11, 2020 21:24
Show Gist options
  • Select an option

  • Save itinance/fc915d90b55064c88a9cf2266e3b3ee8 to your computer and use it in GitHub Desktop.

Select an option

Save itinance/fc915d90b55064c88a9cf2266e3b3ee8 to your computer and use it in GitHub Desktop.

Revisions

  1. itinance created this gist Apr 11, 2020.
    45 changes: 45 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    # (C) 2020 Hagen Huebel, ITinance GmbH https://itinance.com, dedified GmbH https://dedified.io
    # All rights reserved.

    VersionFile=VERSION
    VERSION=`cat $(VersionFile)`

    start:
    docker-compose up -d

    stop:
    docker-compose stop

    build:
    docker-compose build

    show-version:
    echo ${VERSION}

    inc-version:
    go run cmd/release/inc-version.go

    rebuild:
    go build && swag init && make fix-swagger-models

    run-with-swagger:
    go build && swag init && make fix-swagger-models && go run main.go

    build-prod:
    docker build -t itinance/emoney-payment-api-gateway:latest -t itinance/emoney-payment-api-gateway:v${VERSION} .

    push-prod:
    docker push itinance/emoney-payment-api-gateway:latest
    docker push itinance/emoney-payment-api-gateway:v${VERSION}

    # fix-swagger-models
    # swaggo/swag has a bug that will prevent renaming of Models from "model.Account" ino "Account"
    # we are going to fix this generation with this command

    fix-swagger-models:
    ./fix-swagger-files.sh

    build-dev:
    swag init
    ./fix-swagger-files.sh
    go build -v main.go