From e10d768ee8eb35e55ca5d9ac76193a331f506acd Mon Sep 17 00:00:00 2001 From: Evandre Silva Date: Thu, 16 Jun 2022 08:38:06 +0000 Subject: [PATCH 1/4] Initial Bitbucket Deployments configuration --- bitbucket-pipelines.yml | 43 ++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 39b65a9b2..7e3dd0811 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,18 +1,35 @@ -image: node:14.15.0 +# This is an example Starter pipeline configuration +# Use a skeleton to build, test and deploy using manual and parallel steps +# ----- +# You can specify a custom docker image from Docker Hub as your build environment. + +image: atlassian/default-image:3 pipelines: default: + - parallel: + - step: + name: 'Build and Test' + script: + - echo "Your build and test goes here..." + - step: + name: 'Lint' + script: + - echo "Your linting goes here..." + - step: + name: 'Security scan' + script: + - echo "Your security scan goes here..." + + # The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/ - step: - caches: - - node + name: 'Deployment to Staging' + deployment: staging script: - - apt-get update; apt-get install -y gettext-base; - - echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list - - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - - set -x && apt-get update && apt-get install -y xvfb google-chrome-stable - - wget -q -O /usr/bin/xvfb-chrome https://bitbucket.org/atlassian/docker-node-chrome-firefox/raw/ff180e2f16ea8639d4ca4a3abb0017ee23c2836c/scripts/xvfb-chrome - - ln -sf /usr/bin/xvfb-chrome /usr/bin/google-chrome - - chmod 755 /usr/bin/google-chrome - - npm install - - ./node_modules/@angular/cli/bin/ng -v - - npm run test \ No newline at end of file + - echo "Your deployment to staging script goes here..." + - step: + name: 'Deployment to Production' + deployment: production + trigger: 'manual' + script: + - echo "Your deployment to production script goes here..." From 1c6f1ae5ed7c2139ffc9d8b63f275db39948ec33 Mon Sep 17 00:00:00 2001 From: Evandre Silva Date: Thu, 16 Jun 2022 08:41:04 +0000 Subject: [PATCH 2/4] Initial Bitbucket Deployments configuration --- bitbucket-pipelines.yml | 63 ++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 7e3dd0811..8c126ba0a 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,35 +1,32 @@ -# This is an example Starter pipeline configuration -# Use a skeleton to build, test and deploy using manual and parallel steps -# ----- -# You can specify a custom docker image from Docker Hub as your build environment. - -image: atlassian/default-image:3 - +definitions: + services: + docker: + memory: 3072 pipelines: - default: - - parallel: - - step: - name: 'Build and Test' - script: - - echo "Your build and test goes here..." - - step: - name: 'Lint' - script: - - echo "Your linting goes here..." - - step: - name: 'Security scan' - script: - - echo "Your security scan goes here..." + branches: + developer: + - step: + size: 2x + name: 'Build Images and push to Docker hub' + caches: + - docker + script: + - export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT| cut -c1-7) + - export IMAGE_NAME=gabinetedigital/gdsite:$BITBUCKET_COMMIT_SHORT + - docker build -t $IMAGE_NAME . + - docker login --username $DOCKER_USER --password $DOCKER_PASS + - docker push $IMAGE_NAME + - step: + name: 'Deploy on server' + deployment: dev + script: + - 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' - # The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/ - - step: - name: 'Deployment to Staging' - deployment: staging - script: - - echo "Your deployment to staging script goes here..." - - step: - name: 'Deployment to Production' - deployment: production - trigger: 'manual' - script: - - echo "Your deployment to production script goes here..." +options: + docker: true From d6391ac7881d005e32a5797d8a0a64a0af9f3c55 Mon Sep 17 00:00:00 2001 From: Evandre Silva Date: Thu, 16 Jun 2022 08:41:59 +0000 Subject: [PATCH 3/4] Initial Bitbucket Deployments configuration --- bitbucket-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 8c126ba0a..5e9527e91 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -18,7 +18,7 @@ pipelines: - docker push $IMAGE_NAME - step: name: 'Deploy on server' - deployment: dev + deployment: test script: - echo "Starting deploy..." - export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT| cut -c1-7) From 161ba7e7c1505320e2410a59d78f3ddd0a205905 Mon Sep 17 00:00:00 2001 From: Evandre Silva Date: Thu, 16 Jun 2022 08:43:21 +0000 Subject: [PATCH 4/4] Initial Bitbucket Deployments configuration