Commit 551465c3 authored by Tommy Svendsen's avatar Tommy Svendsen
Browse files

DEICH-3487 change deploy pipeline to be more canonical and fix push issue

parent a5ce6029
......@@ -49,14 +49,14 @@
refs:
- tags
build-all-scheduled:
stage: build
script:
- echo -n "Building all Scheduled"
- make build-all
only:
variables:
- $BUILD_TYPE == "scheduled"
# build-all-scheduled:
# stage: build
# script:
# - echo -n "Building all Scheduled"
# - make build-all
# only:
# variables:
# - $BUILD_TYPE == "scheduled"
build-authorization-server:
variables:
......@@ -437,27 +437,19 @@
script:
- make push-${APPLICATION_NAME}
stage: push
when: manual
except:
refs:
- tags
push-all:
script:
- make push-all
stage: push
only:
refs:
- tags
push-all-latest:
script:
- make push-all
stage: push
only:
variables:
- $BUILD_TYPE == "scheduled"
when: on_success
when: manual
# push-all-latest:
# script:
# - make push-all
# stage: push
# only:
# variables:
# - $BUILD_TYPE == "scheduled"
# when: on_success
push-authorization-server:
extends:
......
......@@ -119,18 +119,20 @@ check-%:
remote-deploy: | check-ssh_user check-ssh_servers check-TAG
@for server in $(ssh_servers);\
do\
ssh $(ssh_user)@$$server "mkdir -p ./deployments/$(TAG)/deichman && cd ./deployments/$(TAG)/deichman && ln -fvs \$$DEPLOYMENT_CONFIG_LOCATION/docker-compose.yml docker-compose.override.yml && ln -fvs \$$DEPLOYMENT_CONFIG_LOCATION/.env"; \
scp docker-compose.yml $(ssh_user)@$$server:deployments/$(TAG)/deichman/; \
ssh $(ssh_user)@$$server "cd deployments/$(TAG)/deichman && TAG=$(TAG) docker-compose pull $(CONTAINER) && TAG=$(TAG) docker-compose up -d $(CONTAINER)"; \
@echo "Deploying $(TAG) to server $$server" ; \
ssh $(ssh_user)@$$server "mkdir -p ./deployments/$(TAG)/deichman && rm -rf ./deployments/$(TAG)/config cp -rf \$$DEPLOYMENT_CONFIG_LOCATION/ ./deployments/$(TAG)/config"; \
scp docker-compose.yml $(ssh_user)@$$server:deployments/$(TAG)/docker-compose.yml; \
ssh $(ssh_user)@$$server "cd deployments/$(TAG)/deichman && TAG=$(TAG) DEPLOYMENT_CONFIG_LOCATION=./config docker-compose --env-file=../config/.env -f ../docker-compose.yml -f ../config/docker-compose.yml > docker-compose.yml && docker-compose up -d $(CONTAINER)"; \
done
remote-deploy-voting: | check-ssh_user check-TAG
ifdef voting_node
ssh $(ssh_user)@$(voting_node) "cd \$$DEPLOYMENT_CONFIG_LOCATION/ && COMPOSE_PROJECT_NAME=deichman TAG=$(TAG) docker-compose -f \$$DEPLOYMENT_CONFIG_LOCATION/../debvoter/docker-compose.yml up -d";
@echo "Deploying to voting node $(voting_node)" ; \
ssh $(ssh_user)@$(voting_node) "mkdir -p deployments/$(TAG)/deichman && rm -rf deployments/$(TAG)/config && cd deployments/$(TAG)/ && cp -rf \$$DEPLOYMENT_CONFIG_LOCATION config && cp \$$DEPLOYMENT_CONFIG_LOCATION/../debvoter/docker-compose.yml . && cd deichman && TAG=$(TAG) DEPLOYMENT_CONFIG_LOCATION=./config docker-compose --env-file=../config/.env -f ../docker-compose.yml config > docker-compose.yml && docker-compose up -d";
endif
remote-docker-command:
ssh $(ssh_user)@$(ssh_server) "cd ./deployments/$(job_id)/deichman && docker-compose exec -T $(CONTAINER) $(cmd)"
ssh $(ssh_user)@$(ssh_server) "cd ./deployments/$(TAG)/deichman && docker-compose exec -T $(CONTAINER) $(cmd)"
define build_app
docker-compose build $1
......@@ -152,14 +154,14 @@ endef
$(foreach element,$(SERVICES),$(eval $(call make-build-target,$(element))))
push-all: build-all | check-TAG
push-all:
@for service in $(SERVICES) ; \
do \
echo "Tagging and pushing service $$service with latest and $(TAG)"; \
docker tag digibib/$$service digibib/$$service:latest ; \
docker tag digibib/$$service digibib/$$service:$(TAG) ; \
docker push digibib/$$service ; \
done
docker-compose push
build-all:
docker-compose build
......
......@@ -233,6 +233,7 @@ services:
no.deichman.label.component-category: "Frontend"
test-front:
image: "digibib/test-nl:${TAG:-latest}"
build:
context: test-front
labels:
......
......@@ -445,16 +445,6 @@ services:
- "8050"
logging: *default-logging
nlsink: # Fake NL response, for testing
container_name: nlsink
image: "alpine:3.3"
networks:
- deichman-dev
command:
- "/bin/sh"
- "-c"
- "mkfifo pipe; while true ; do { read line<pipe;echo -e 'HTTP/1.1 200 OK\nContent-Type: text/xml; charset=utf-8\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ns0:Envelope xmlns:ns0=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://lanekortet.no\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ns0:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n<ns0:Body>\n<ns1:hentResponse>\n<return xsi:type=\"ns1:Resultat\">\n<status xsi:type=\"xsd:boolean\">true</status>\n<melding xsi:type=\"xsd:string\">OK</melding>\n<antall_treff xsi:type=\"xsd:int\">0</antall_treff>\n<antall_poster_returnert xsi:type=\"xsd:int\">0</antall_poster_returnert>\n<neste_indeks xsi:type=\"xsd:int\">0</neste_indeks>\n<server_tid xsi:type=\"xsd:string\">2016-07-07T11:29:08</server_tid>\n</return>\n</ns1:hentResponse>\n</ns0:Body>\n</ns0:Envelope>\n' ; } | nc -l -p 9999 > pipe; done"
redia-api:
image: "digibib/redia-api:${TAG:-latest}"
labels:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment