-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbitbucket-pipelines.yml
128 lines (127 loc) · 7.47 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
pipelines:
default:
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: build-dotnet
# Name of the Docker image which may or may not include registry URL, tag, and digest value
image: mcr.microsoft.com/dotnet/sdk:3.1-bullseye
# Commands to execute in the step
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Build dotnet project with Release configuration
- dotnet build dotnet/HelloWorld.csproj -c Release
# Copy built artifacts to artifacts directory
- cp dotnet/bin/Release/netcoreapp3.1/HelloWorld-0.0.1.dll ${BITBUCKET_CLONE_DIR}/packages/HelloWorld.dll
# Files produced by a step to share with a following step
artifacts:
- packages/HelloWorld.dll
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: build-maven-java
# Name of the Docker image which may or may not include registry URL, tag, and digest value
image: maven:3.6.3
# Caches enabled for the step
caches:
- maven
# Commands to execute in the step
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Build Maven project with Maven Options
- mvn --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true clean install -f java/pom.xml
# Copy built artifacts to artifacts directory
- cp java/target/HelloWorld-0.0.1.jar ${BITBUCKET_CLONE_DIR}/packages/HelloWorld-Maven.jar
# Files produced by a step to share with a following step
artifacts:
- packages/HelloWorld-Maven.jar
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: build-gradle-java
# Name of the Docker image which may or may not include registry URL, tag, and digest value
image: gradle:7.2-jdk11
# Caches enabled for the step
caches:
- gradle
# Commands to execute in the step
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Set GRADLE options for building Java project
- export GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=4"
- touch ${BITBUCKET_CLONE_DIR}/java/gradle.properties
- echo "${BITBUCKET_CLONE_DIR}/java/gradle.properties" >> 'org.gradle.daemon=false'
- echo "${BITBUCKET_CLONE_DIR}/java/gradle.properties" >> 'org.gradle.workers.max=4'
# Build Maven project with Maven Options
- gradle clean build -p java -PsetupType=jar
# Copy built artifacts to artifacts directory
- cp java/build/libs/HelloWorld-0.0.1.jar ${BITBUCKET_CLONE_DIR}/packages/HelloWorld-Gradle.jar
# Files produced by a step to share with a following step
artifacts:
- packages/HelloWorld-Gradle.jar
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: sign-dotnet-artifacts
# Services enabled for the step
services:
- docker
# Commands to execute in the step
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Fixed dotnet permission issue
- chmod -R 777 ${BITBUCKET_CLONE_DIR}/packages
# Docker Pull CodeSigner Docker Image
- docker pull ghcr.io/sslcom/codesigner:latest
# Sign artifact with CodeSigner docker image
- docker run -i --rm --dns 8.8.8.8 --volume ${BITBUCKET_CLONE_DIR}/packages:/codesign/examples --volume ${BITBUCKET_CLONE_DIR}/artifacts:/codesign/output -e USERNAME=${USERNAME} -e PASSWORD=${PASSWORD} -e CREDENTIAL_ID=${CREDENTIAL_ID} -e TOTP_SECRET=${TOTP_SECRET} -e ENVIRONMENT_NAME=${ENVIRONMENT_NAME} ghcr.io/sslcom/codesigner:latest sign -input_file_path=/codesign/examples/HelloWorld.dll -output_dir_path=/codesign/output
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: sign-maven-artifacts
# Services enabled for the step
services:
- docker
# Commands to execute in the step
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Docker Pull CodeSigner Docker Image
- docker pull ghcr.io/sslcom/codesigner:latest
# Sign artifact with CodeSigner docker image
- docker run -i --rm --dns 8.8.8.8 --volume ${BITBUCKET_CLONE_DIR}/packages:/codesign/examples --volume ${BITBUCKET_CLONE_DIR}/artifacts:/codesign/output -e USERNAME=${USERNAME} -e PASSWORD=${PASSWORD} -e CREDENTIAL_ID=${CREDENTIAL_ID} -e TOTP_SECRET=${TOTP_SECRET} -e ENVIRONMENT_NAME=${ENVIRONMENT_NAME} ghcr.io/sslcom/codesigner:latest sign -input_file_path=/codesign/examples/HelloWorld-Maven.jar -output_dir_path=/codesign/output
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: sign-gradle-artifacts
# Services enabled for the step
services:
- docker
# Commands to execute in the step
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Docker Pull CodeSigner Docker Image
- docker pull ghcr.io/sslcom/codesigner:latest
# Sign artifact with CodeSigner docker image
- docker run -i --rm --dns 8.8.8.8 --volume ${BITBUCKET_CLONE_DIR}/packages:/codesign/examples --volume ${BITBUCKET_CLONE_DIR}/artifacts:/codesign/output -e USERNAME=${USERNAME} -e PASSWORD=${PASSWORD} -e CREDENTIAL_ID=${CREDENTIAL_ID} -e TOTP_SECRET=${TOTP_SECRET} -e ENVIRONMENT_NAME=${ENVIRONMENT_NAME} ghcr.io/sslcom/codesigner:latest sign -input_file_path=/codesign/examples/HelloWorld-Gradle.jar -output_dir_path=/codesign/output
- step:
# You can add a name to a step to make displays and reports easier to read and understand.
name: sign-ps1-artifacts
# Services enabled for the step
services:
- docker
script:
# Created directories for artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/artifacts
- mkdir -p ${BITBUCKET_CLONE_DIR}/packages
# Copy ps1 script for signing
- cp powershell/HelloWorld.ps1 ${BITBUCKET_CLONE_DIR}/packages/HelloWorld.ps1
# Docker Pull CodeSigner Docker Image
- docker pull ghcr.io/sslcom/codesigner:latest
# Sign artifact with CodeSigner docker image
- docker run -i --rm --dns 8.8.8.8 --volume ${BITBUCKET_CLONE_DIR}/packages:/codesign/examples --volume ${BITBUCKET_CLONE_DIR}/artifacts:/codesign/output -e USERNAME=${USERNAME} -e PASSWORD=${PASSWORD} -e CREDENTIAL_ID=${CREDENTIAL_ID} -e TOTP_SECRET=${TOTP_SECRET} -e ENVIRONMENT_NAME=${ENVIRONMENT_NAME} ghcr.io/sslcom/codesigner:latest sign -input_file_path=/codesign/examples/HelloWorld.ps1 -output_dir_path=/codesign/output