-
Notifications
You must be signed in to change notification settings - Fork 5
/
bitbucket-pipelines.yml
55 lines (54 loc) · 1.92 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:14.21-alpine3.16
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- apk add python2 make g++
- yarn install
- yarn lint
- yarn test
branches:
development:
- step:
name: Test and build
caches:
- node
script: # Modify the commands below to build your repository.
- apk add python2 make g++
- yarn install
- yarn lint
- yarn test
- yarn build
artifacts:
- build/**
- step:
name: Build docker image
caches:
- docker
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker build -f Dockerfile_unikie_dev_cluster -t kleklekle/spia:kaavapino-web-$BITBUCKET_BUILD_NUMBER-$BITBUCKET_COMMIT .
- docker push kleklekle/spia:kaavapino-web-$BITBUCKET_BUILD_NUMBER-$BITBUCKET_COMMIT
services:
- docker
- step:
name: Deploy
caches:
- docker
script:
- sed -i 's|${CICD_EXECUTION_SEQUENCE}|'$BITBUCKET_BUILD_NUMBER'|g' deploy/rancher/deployment.yaml
- sed -i 's|${CICD_GIT_COMMIT}|'$BITBUCKET_COMMIT'|g' deploy/rancher/deployment.yaml
- pipe: atlassian/kubectl-run:3.1.2
variables:
KUBE_CONFIG: $KUBE_CONFIG
KUBECTL_COMMAND: 'apply'
RESOURCE_PATH: 'deploy/rancher/deployment.yaml'
KUBECTL_ARGS:
- '--namespace=p-c94d9-pipeline'