forked from arun-setty-hotstar/ashutest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.gocd.yaml
51 lines (51 loc) · 1.65 KB
/
pipeline.gocd.yaml
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
format_version: 3
pipelines:
<data.team>-<data.service>-pipeline:
group: <data.team>
materials:
mygit:
git: [email protected]:hotstar/<data.repoName>.git
branch: main
environment_variables:
DOCKER_REGISTRY: 084690408984.dkr.ecr.us-east-1.amazonaws.com
IMAGE_NAME: <data.team>-<data.service>
stages:
- build:
clean_workspace: true
jobs:
build:
elastic_profile_id: prod-java-8
artifacts:
- build:
source: image_ref
tasks:
- exec:
command: bash
arguments:
- "-c"
- "mvn clean package"
- exec:
command: bash
arguments:
- "-c"
- "mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec > version.txt"
- exec:
command: bash
arguments:
- "-c"
- "echo ${DOCKER_REGISTRY}/${IMAGE_NAME}:v`git rev-list HEAD --count`.0 > image_ref"
- exec:
command: bash
arguments:
- "-c"
- "eval $(aws ecr get-login --registry-ids 084690408984 --no-include-email --region us-east-1) && docker build --build-arg version=`cat version.txt` -t `cat image_ref` ."
- exec:
command: bash
arguments:
- "-c"
- "docker push `cat image_ref`"
- exec:
command: bash
arguments:
- "-c"
- "cat image_ref"