Initial Bitbucket Deployments configuration

This commit is contained in:
Evandre Silva
2022-06-16 08:41:04 +00:00
parent e10d768ee8
commit 1c6f1ae5ed
+30 -33
View File
@@ -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