76 lines
2.9 KiB
YAML
76 lines
2.9 KiB
YAML
image: node:14.17.1
|
|
|
|
definitions:
|
|
services:
|
|
docker:
|
|
memory: 3072
|
|
steps:
|
|
- step: &build-image
|
|
name: Build Docker image
|
|
image: openjdk:8-jdk-alpine
|
|
script:
|
|
- docker build -t helloworld -f docker/hello-world/Dockerfile .
|
|
- docker save --output tmp-image.docker helloworld
|
|
artifacts:
|
|
- tmp-image.docker
|
|
- step: &push-gcp
|
|
name: Push to GCP registry
|
|
image: google/cloud-sdk:alpine
|
|
script:
|
|
- docker load --input ./tmp-image.docker
|
|
# Authenticating with the service account key file
|
|
- echo $GCLOUD_API_KEYFILE | base64 -d > ./gcloud-api-key.json
|
|
- gcloud auth activate-service-account --key-file gcloud-api-key.json
|
|
- gcloud config set project $GCLOUD_PROJECT
|
|
# # Tag container & push
|
|
# - export TAG=$(echo "$BITBUCKET_TAG" | sed -e "s/v//g")
|
|
# - export SUFFIX=$([[ ! -z "$TAG" ]] && echo ":$TAG" || echo "")
|
|
# - export IMAGE_NAME=gcr.io/my-project/hello-world${SUFFIX}
|
|
# - docker tag helloworld ${IMAGE_NAME}
|
|
# # Login to google docker hub
|
|
# - cat ./gcloud-api-key.json | docker login -u _json_key --password-stdin https://gcr.io
|
|
# - docker push ${IMAGE_NAME}
|
|
pipelines:
|
|
branches:
|
|
feature/VRFS-5283:
|
|
- step: *push-gcp
|
|
# - step:
|
|
# name: Build Container Image
|
|
# script:
|
|
# - docker build .
|
|
# services:
|
|
# - docker
|
|
develop:
|
|
- step:
|
|
name: Build Staging
|
|
script:
|
|
- cd jam-ui
|
|
- npm install
|
|
- CI=false REACT_APP_ORIGIN=staging.jamkazam.com REACT_APP_LEGACY_BASE_URL=https://staging.jamkazam.com REACT_APP_API_BASE_URL=https://staging.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT npm run build
|
|
artifacts:
|
|
- jam-ui/build/**
|
|
- step:
|
|
name: Deploy to staging
|
|
deployment: staging
|
|
script:
|
|
- pipe: atlassian/aws-s3-deploy:1.1.0
|
|
variables:
|
|
S3_BUCKET: "jamkazam-ui/stg"
|
|
LOCAL_PATH: "jam-ui/build"
|
|
- step:
|
|
name: Build Production
|
|
script:
|
|
- cd jam-ui
|
|
- npm install
|
|
- CI=false REACT_APP_ORIGIN=jamkazam.com REACT_APP_LEGACY_BASE_URL=https://www.jamkazam.com REACT_APP_API_BASE_URL=https://www.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT npm run build
|
|
artifacts:
|
|
- jam-ui/build/**
|
|
|
|
- step:
|
|
name: Deploy to production
|
|
deployment: production
|
|
script:
|
|
- pipe: atlassian/aws-s3-deploy:1.1.0
|
|
variables:
|
|
S3_BUCKET: "jamkazam-ui/prd"
|
|
LOCAL_PATH: "jam-ui/build" |