Advertisement
kaaposc

Makefile with conditional

Aug 24th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.32 KB | None | 0 0
  1. .PHONY: all drone
  2.  
  3. all: drone
  4.     @echo Recipe for drone
  5.  
  6. drone: container != docker ps -a --format {{.ID}} --filter "name=drone-agent"
  7. drone: cont = $(container)
  8. drone:
  9.     @if [ ! -z $(container) ]; then \
  10.         echo Stopping container $(cont)...; \
  11.     else \
  12.         echo Container already stopped; \
  13.     fi
  14.     @echo End drone recipe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement