add pipeline

This commit is contained in:
Evandre Da Silva
2022-06-16 09:45:43 +01:00
parent 18a5cc5c15
commit 0efdc81811
+29 -15
View File
@@ -1,18 +1,32 @@
image: node:14.15.0 definitions:
services:
docker:
memory: 3072
pipelines: pipelines:
default: branches:
- step: developer:
- step:
size: 2x
name: 'Build Images and push to Docker hub'
caches: caches:
- node - docker
script: script:
- apt-get update; apt-get install -y gettext-base; - export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT| cut -c1-7)
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list - export IMAGE_NAME=gabinetedigital/gdsite:$BITBUCKET_COMMIT_SHORT
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - docker build -t $IMAGE_NAME .
- set -x && apt-get update && apt-get install -y xvfb google-chrome-stable - docker login --username $DOCKER_USER --password $DOCKER_PASS
- wget -q -O /usr/bin/xvfb-chrome https://bitbucket.org/atlassian/docker-node-chrome-firefox/raw/ff180e2f16ea8639d4ca4a3abb0017ee23c2836c/scripts/xvfb-chrome - docker push $IMAGE_NAME
- ln -sf /usr/bin/xvfb-chrome /usr/bin/google-chrome - step:
- chmod 755 /usr/bin/google-chrome name: 'Deploy on server'
- npm install deployment: test
- ./node_modules/@angular/cli/bin/ng -v script:
- npm run test - echo "Starting deploy..."
- export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT| cut -c1-7)
- pipe: atlassian/ssh-run:0.4.0
variables:
SSH_USER: 'administrator'
SERVER: '41.63.166.54'
COMMAND: 'export GDSITE_VERSION=${BITBUCKET_COMMIT_SHORT};cd ${COMPOSE_FOLDER} ; docker-compose up -d gdsite'
options:
docker: true