-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbitbucket-pipelines.yml
More file actions
72 lines (68 loc) · 2.66 KB
/
bitbucket-pipelines.yml
File metadata and controls
72 lines (68 loc) · 2.66 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Template Go (Golang) build
# This template allows you to validate your Go (Golang) code.
# The workflow allows running tests, build and code linting on the default branch.
image: golang:1.22
definitions:
steps:
- step: &build
name: Build
script:
- go build .
- step: &cleanup-email-contacts
name: Cleanup Email Contacts
script:
- apt-get update && apt-get install -y jq
- chmod +x scripts/cleanup-email-contacts.sh
- ./scripts/cleanup-email-contacts.sh
- step: &jsmTest
name: JSM Test
script:
- mkdir -p test-reports
- go install github.com/jstemmer/go-junit-report/v2@latest
- export ATLASSIAN_OPS_PRODUCT_TYPE="jira-service-desk"
- go test -v 2>&1 ./... | go-junit-report -set-exit-code > test-reports/report-jsm.xml
artifacts: # defining the artifacts to be passed to each future step.
- test-reports/**
- reports/*.txt
- step: &compassTest
name: Compass Test
script:
- mkdir -p test-reports
- go install github.com/jstemmer/go-junit-report/v2@latest
- export ATLASSIAN_OPS_PRODUCT_TYPE="compass"
- go test -v 2>&1 ./... | go-junit-report -set-exit-code > test-reports/report-compass.xml
artifacts: # defining the artifacts to be passed to each future step.
- test-reports/**
- reports/*.txt
- step: &lint
name: Lint code
image: golangci/golangci-lint:v1.31.0
script:
- golangci-lint run -v
- step: &replicate-to-github
name: Replicate main branch to GitHub
image: python:3.7
script:
- pip install git-filter-repo
- git fetch --unshallow --all && git checkout main && git pull
- git remote rename origin bitbucket
- git remote add github git@github.com:atlassian/terraform-provider-atlassian-operations.git
- git checkout -b release-from-bitbucket
- git pull --rebase --strategy-option=ours github main
- git filter-repo --commit-callback 'commit.committer_name = commit.author_name; commit.committer_email = commit.author_email;' --refs $(git merge-base github/main release-from-bitbucket)...HEAD --force
- git push --set-upstream github release-from-bitbucket --force
pipelines:
default:
- parallel:
- step: *build
custom:
replicate-to-github:
- step: *replicate-to-github
cleanup-email-contacts:
- step: *cleanup-email-contacts
pull-requests:
'**':
- step: *cleanup-email-contacts
- step: *jsmTest
- step: *compassTest
# - step: *lint