diff --git a/.dockerignore b/.dockerignore index 77b9ea6b179aaa31c73ebb6e8d37ab825248d391..5178bb88c27632671afad41e1f79e9d9df52aad1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,3 +10,5 @@ nodemon.json *.swp *.log +*.swo +*.env diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49c40eb11a0543d6991d6629ab6ea2ae0b9b0972..ea09dc39c6fc1a70d364159e74a6a97383427f62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,15 +7,22 @@ variables: POSTGRES_DB: 'blendb_fixture' POSTGRES_USER: 'runner' POSTGRES_PASSWORD: '' + PKG_VERSION: 'latest' cache: paths: - node_modules -before_script: - - npm install --silent +stages: + - test + - build + - deploy + run_tests: + stage: test + before_script: + - npm install --silent script: - mv config/ci_test.yaml.example config/test.yaml - mv config/ci_test.env.example config/test.env @@ -24,3 +31,28 @@ run_tests: tags: - node - postgres +build: + stage: build + variables: + PKG_VERSION: 'latest' + script: + - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ') + - echo ${PKG_VERSION} + - docker build -t marula.c3sl.ufpr.br:5000/c3sl/blendb:${PKG_VERSION} . + tags: + - docker + - build + +deploy: + stage: deploy + variables: + PKG_VERSION: 'latest' + script: + - PKG_VERSION=$(cat package.json | grep \"version\" | cut -f2 -d':'| sed -e 's/"\|,//g' | tr -d ' ') + - docker push marula.c3sl.ufpr.br:5000/c3sl/blendb:${PKG_VERSION} . + tags: + - docker + - build + only: + - master + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..5e5c0597cad17bfa58137a8b3e881bea70d31cfe --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3.3' +services: + blendb: + image: marula.c3sl.ufpr.br:5000/c3sl/blendb:latest + build: /home/lfo14/c3sl/blendb + container_name: blendb +# depends_on: +# - db + environment: + BLENDB_DB_USER: ${BLENDB_DB_USER} + BLENDB_DB_PASSWORD: ${BLENDB_DB_PASSWORD} + BLENDB_DB_NAME: ${BLENDB_DB_NAME} + BLENDB_DB_HOST: ${BLENDB_DB_HOST} + BLENDB_DB_PORT: ${BLENDB_DB_PORT} + BLENDB_ST_CREATE: ${BLENDB_ST_CREATE} + BLENDB_ST_INSERT: ${BLENDB_ST_INSERT} + BLENDB_ADAPTER: ${BLENDB_ADAPTER} + volumes: + - + type: bind + source: ./config + target: /home/node/app/config + - + type: tmpfs + target: /tmp + restart: unless-stopped + read_only: 'true' + security_opt: + - no-new-privileges + +# db: +# image: postgres:9.6 +# container_name: db +# ports: +# - "5432" +# restart: unless-stopped +# #read_only: 'true' +# security_opt: +# - no-new-privileges