Skip to content

Commit

Permalink
update hugo push
Browse files Browse the repository at this point in the history
  • Loading branch information
flemay committed Feb 12, 2020
1 parent c9646e3 commit 995ea04
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
15 changes: 8 additions & 7 deletions docker-hugo/Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
COMPOSE_BUILD_HUGO = docker-compose build --no-cache hugo
COMPOSE_RUN_HUGO = docker-compose run --rm hugo
COMPOSE_RUN_MUSKETEERS = docker-compose run --rm musketeers
ENVFILE ?= env.template

all:
ENVFILE=env.example $(MAKE) envfile build test clean

ciTest: envfile build test clean

ciDeploy: envfile build test deploy clean
ciPush: envfile build test push clean

envfile:
cp -f $(ENVFILE) .env

pull:
docker-compose pull

build:
$(COMPOSE_BUILD_HUGO)

pull:
docker-compose pull

test:
$(COMPOSE_RUN_HUGO) ./scripts/test.sh

shell:
$(COMPOSE_RUN_HUGO)
$(COMPOSE_RUN_HUGO) bash

deploy:
$(COMPOSE_RUN_HUGO) ./scripts/deploy.sh
push:
$(COMPOSE_RUN_MUSKETEERS) ./scripts/push.sh

clean:
docker-compose down --remove-orphans
Expand Down
4 changes: 3 additions & 1 deletion docker-hugo/env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DOCKERHUB_TRIGGER_URL=https://cloud.docker.com/api/build/v1/source/uuid/trigger/token/call/
DOCKER_USERNAME=username
DOCKER_PASSWORD=password
IMAGE_NAME=flemay/hugo:latest
4 changes: 3 additions & 1 deletion docker-hugo/env.template
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DOCKERHUB_TRIGGER_URL
DOCKER_USERNAME
DOCKER_PASSWORD
IMAGE_NAME=flemay/hugo:latest
6 changes: 0 additions & 6 deletions docker-hugo/scripts/deploy.sh

This file was deleted.

7 changes: 7 additions & 0 deletions docker-hugo/scripts/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
set -u

echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin docker.io
docker push "${IMAGE_NAME}"
docker logout

0 comments on commit 995ea04

Please sign in to comment.