Commit 91277ffc authored by Tommy Svendsen's avatar Tommy Svendsen
Browse files

DEICH-3487 Attempt to deploy using buildkit and removing the buildnumber from...

DEICH-3487 Attempt to deploy using buildkit and removing the buildnumber from the deployjob, using TAG/latest instead
parent 3552031f
......@@ -9,6 +9,9 @@
- curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
- echo $DOCKERHUB_PASSWORD|docker login -u $DOCKERHUB_USERNAME --password-stdin
- export DOCKER_BUILDKIT=1
- export COMPOSE_DOCKER_CLI_BUILD=1
- export TAG=${CI_COMMIT_TAG:-latest}
.after_script: &after
- echo -n "END :" && date -u +'%Y-%m-%dT%H:%M:%SZ'
......@@ -33,6 +36,9 @@
- echo -n "Building ${APPLICATION_NAME}"
- make build-${APPLICATION_NAME}
stage: build
except:
refs:
- tags
build-all:
stage: build
......@@ -52,14 +58,6 @@
variables:
- $BUILD_TYPE == "scheduled"
build-all-manual:
stage: build
script:
- echo -n "Building all"
- make build-all
when: manual
build-authorization-server:
variables:
APPLICATION_NAME: authorization-server
......@@ -67,6 +65,9 @@
- .build-application
only:
changes: [ "Makefile", ".gitlab-ci.yml", "*.sh", "authorization-server/**/*" ]
except:
refs:
- tags
build-deichman.no:
variables:
......@@ -196,8 +197,8 @@
- chmod 644 ~/.ssh/known_hosts
- export APPLICATION_NAME=${APPLICATION_NAME}
script:
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" job_id=${CI_JOB_ID} deploy_tag=${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA:-latest}} CONTAINER=${APPLICATION_NAME}
- make remote-deploy-voting ssh_user=${SSH_USER} voting_node="${SSH_VOTING_SERVER}" deploy_tag=${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA:-latest}}
- make remote-deploy ssh_user=${SSH_USER} ssh_servers="${SSH_SERVERS}" CONTAINER=${APPLICATION_NAME}
- make remote-deploy-voting ssh_user=${SSH_USER} voting_node="${SSH_VOTING_SERVER}"
when: manual
#Deploy test
......@@ -215,7 +216,7 @@
- .devtest
- .deploy-scp
after_script:
- make remote-docker-command CONTAINER=koha ssh_user=$DEPLOY_USER ssh_server=$DEVTEST_SERVER job_id=$CI_JOB_ID cmd=/koha/start-cron.sh
- make remote-docker-command CONTAINER=koha ssh_user=$DEPLOY_USER ssh_server=$DEVTEST_SERVER cmd=/koha/start-cron.sh
- ./transitionIssues.sh test
- *after
only:
......@@ -433,32 +434,29 @@
## Push stages here
.push:
script:
- make push-${APPLICATION_NAME} TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA}}
- make push-${APPLICATION_NAME}
stage: push
when: manual
except:
refs:
- tags
push-all:
script:
- make push-all TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA}}
- make push-all
stage: push
only:
refs:
- tags
#push-all-latest:
# script:
# - make push-all TAG=${CI_COMMIT_SHORT_SHA}
# stage: push
# only:
# variables:
# - $BUILD_TYPE == "scheduled"
# when: on_success
push-all-latest-manual:
push-all-latest:
script:
- make push-all TAG=${CI_COMMIT_SHORT_SHA}
- make push-all
stage: push
when: manual
only:
variables:
- $BUILD_TYPE == "scheduled"
when: on_success
push-authorization-server:
extends:
......
......@@ -116,12 +116,12 @@ test_pubindex:
check-%:
@: $(if $(value $*),,$(error $* is undefined))
remote-deploy: | check-ssh_user check-ssh_servers check-job_id check-deploy_tag
remote-deploy: | check-ssh_user check-ssh_servers check-TAG
@for server in $(ssh_servers);\
do\
ssh $(ssh_user)@$$server "mkdir -p ./deployments/$(job_id)/deichman && cd ./deployments/$(job_id)/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/$(job_id)/deichman/; \
ssh $(ssh_user)@$$server "cd deployments/$(job_id)/deichman && TAG=$(deploy_tag) docker-compose pull $(CONTAINER) && TAG=$(deploy_tag) docker-compose up -d $(CONTAINER)"; \
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)"; \
done
remote-deploy-voting: | check-ssh_user check-deploy_tag
......
......@@ -133,7 +133,7 @@ services:
depends_on:
- katalog-builder
volumes:
- katalog_builds:/usr/share/nginx/html
- katalog_builds:/usr/share/nginx/html
koha:
build:
......@@ -144,7 +144,7 @@ services:
org.label-schema.description: "This is the employee application for managing borrowing and borrowers."
no.deichman.label.component-category: "Frontend"
volumes:
- ./koha:/koha
- ./koha:/koha
kibana:
build:
......
......@@ -7,56 +7,38 @@ FROM debian:jessie
MAINTAINER Oslo Public Library "digitalutvikling@gmail.com"
ENV REFRESHED_AT 2019-05-01
RUN (grep "Debian GNU/Linux 8" /etc/issue \
&& echo "deb http://archive.debian.org/debian jessie main" > /etc/apt/sources.list \
&& echo "deb http://security.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list) \
|| true
RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y wget less curl git nmap socat netcat tree htop \
unzip python-software-properties libswitch-perl \
libnet-ssleay-perl libcrypt-ssleay-perl \
supervisor inetutils-syslogd && \
apt-get clean
#Add basic deps
RUN apt-get update && \
apt-get install -y wget
# Install koha perldeps
RUN echo "search deich.folkebibl.no guest.oslo.kommune.no\nnameserver 10.172.2.1\nnameserver 8.8.8.8\nnameserver 8.8.4.4" > /etc/resolv.conf && \
echo "deb http://debian.koha-community.org/koha oldstable main" > /etc/apt/sources.list.d/koha.list && \
wget -q -O- http://debian.koha-community.org/koha/gpg.asc | apt-key add - && \
apt-get update && apt-get install -y --force-yes koha-perldeps && apt-get clean
RUN wget -q -O- http://debian.koha-community.org/koha/gpg.asc | apt-key add -
COPY ./etc/apt/sources.list.d/koha.list /etc/apt/sources.list.d/koha.list
RUN apt-get update && apt-get install -y --force-yes koha-perldeps
# kohadev dependencies
RUN apt-get update && apt-get install -y libtemplate-plugin-json-escape-perl libtext-bidi-perl libwww-csrf-perl \
#Run apt install
RUN apt-get update && apt-get install -y \
less curl git nmap socat netcat tree htop \
unzip python-software-properties libswitch-perl \
libnet-ssleay-perl libcrypt-ssleay-perl \
supervisor inetutils-syslogd \
libtemplate-plugin-json-escape-perl libtext-bidi-perl libwww-csrf-perl \
libdancer-perl libobject-tiny-perl libxml-libxml-simple-perl libconfig-merge-perl \
libdbix-connector-perl make libtest-warnings-perl libplack-middleware-debug-perl \
libsereal-encoder-perl libsereal-decoder-perl libtext-unaccent-perl \
libsearch-elasticsearch-perl libcatmandu-marc-perl libcatmandu-store-elasticsearch-perl entr&& \
apt-get clean
# NCIP deps
RUN apt-get update && apt-get install -y \
libsearch-elasticsearch-perl libcatmandu-marc-perl libcatmandu-store-elasticsearch-perl entr \
libhtml-strip-perl libipc-run3-perl paps \
libdancer-perl \
libyaml-libyaml-perl && \
apt-get clean
# dev tools
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -q -y cpanminus build-essential vim net-tools telnet screen && \
cpanm Raisin@0.87 Error::Return Plack::Middleware::Rewrite Log::Log4perl::Layout::GELF Net::OAuth2::Profile::WebServer && \
#cpanm Crypt::JWT Search::Elasticsearch::Client::6_0::Direct && \
cpanm Crypt::JWT EZIMUEL/Search-Elasticsearch-6.80_1.tar.gz && \
apt-get purge -y cpanminus build-essential && \
rm -rf /root/.cpanm && \
apt-get clean
RUN apt-get update && apt-get install -y gettext-base && apt-get clean
# koha-deps
RUN apt-get update && apt-get install -y \
libyaml-libyaml-perl \
cpanminus build-essential vim net-tools telnet screen gettext-base\
daemon fonts-dejavu fonts-dejavu-extra idzebra-2.0 idzebra-2.0-common \
idzebra-2.0-doc idzebra-2.0-utils libaio1 libhtml-template-perl libhttp-parser-xs-perl libidzebra-2.0-0 libidzebra-2.0-dev \
libidzebra-2.0-mod-alvis libidzebra-2.0-mod-dom libidzebra-2.0-mod-grs-marc \
......@@ -64,8 +46,15 @@ RUN apt-get update && apt-get install -y \
libidzebra-2.0-modules libproc-wait3-perl libserver-starter-perl libtcl8.6 \
libterm-readkey-perl mysql-client mysql-client-5.5 perl-doc pwgen starman \
tinymce ttf-dejavu ttf-dejavu-core ttf-dejavu-extra xmlstarlet yaz \
libsoap-lite-perl libcrypt-gcrypt-perl libconvert-basen-perl && \
apt-get clean
libsoap-lite-perl libcrypt-gcrypt-perl libconvert-basen-perl
RUN cpanm Raisin@0.87 Error::Return Plack::Middleware::Rewrite Log::Log4perl::Layout::GELF Net::OAuth2::Profile::WebServer && \
cpanm Crypt::JWT EZIMUEL/Search-Elasticsearch-6.80_1.tar.gz
RUN apt-get purge -y cpanminus build-essential
RUN rm -rf /root/.cpanm
RUN apt-get clean
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.6/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
......
deb http://debian.koha-community.org/koha oldstable main
\ No newline at end of file
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