forked from spinnaker/clouddriver
-
Notifications
You must be signed in to change notification settings - Fork 9
151 lines (130 loc) · 5.99 KB
/
clouddriver-oes.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Branch Build clouddriver
on:
workflow_call:
push:
branches:
- OES-1.30.1
inputs:
org:
# Friendly description to be shown in the UI instead of 'name'
description: 'Oragnisation'
# Default value if no value is explicitly provided
default: 'OpsMx'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string
repo:
# Friendly description to be shown in the UI instead of 'name'
description: 'Repositry'
# Default value if no value is explicitly provided
default: 'armory-observability-plugin'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string
tag:
# Friendly description to be shown in the UI instead of 'name'
description: 'Tag'
# Default value if no value is explicitly provided
default: 'v1.0.1'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
CONTAINER_REGISTRY: quay.io/opsmxpublic
jobs:
build-clouddriver:
runs-on: ubuntu-latest
outputs:
clouddriver: ${{ steps.get-build-name.outputs.clouddriver }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'temurin'
- name: Prepare build variables
id: build_variables
run: |
echo ::set-output name=REPO::ubi8-clouddriver-cve
echo ::set-output name=VERSION::"1.30.1$(date --utc +'%Y%m%d')"
- name: Login to Quay
uses: docker/login-action@v1
# use service account flow defined at: https://github.com/docker/login-action#service-account-based-authentication-1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_KEY }}
- name: Build
env:
ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }}
run: |
sed -e 's/NEXUS_USERNAME/${{ secrets.NEXUS_USERNAME }}/' -i settings.gradle
sed -e 's/NEXUS_PASSWORD/${{ secrets.NEXUS_PASSWORD }}/' -i settings.gradle
sed -e 's/NEXUS_USERNAME/${{ secrets.NEXUS_USERNAME }}/' -i build.gradle
sed -e 's/NEXUS_PASSWORD/${{ secrets.NEXUS_PASSWORD }}/' -i build.gradle
./gradlew --no-daemon -PenableCrossCompilerPlugin=true clouddriver-web:installDist -x test
#./gradlew --no-daemon clouddriver-web:installDist -x test
#extra_opts='"--add-opens=java.base/sun.net=ALL-UNNAMED" "--add-exports=java.base/sun.net=ALL-UNNAMED" "--add-opens=java.base/java.time=ALL-UNNAMED"'
extra_opts='"-Djava.security.egd=file:/dev/./urandom" "-Dspring.config.import=optional:/opt/spinnaker/config/" "--add-opens=java.base/sun.net=ALL-UNNAMED" "--add-exports=java.base/sun.net=ALL-UNNAMED" "--add-opens=java.base/java.time=ALL-UNNAMED" "--add-exports=java.base/sun.security.rsa=ALL-UNNAMED" "--add-exports=java.base/sun.security.pkcs=ALL-UNNAMED" "--add-exports=java.base/sun.security.x509=ALL-UNNAMED"'
extra_opts_escaped=$(sed 's/[\/&]/\\&/g' <<< "$extra_opts")
echo $extra_opts_escaped
#sed "s/^\(DEFAULT_JVM_OPTS=\'.*\)\'$/\1 $extra_opts_escaped\'/" -i clouddriver-web/build/install/clouddriver/bin/clouddriver
sed "s/^\(DEFAULT_JVM_OPTS\)\s*=\s*'.*'\$/\1='$extra_opts_escaped'/" -i clouddriver-web/build/install/clouddriver/bin/clouddriver
cat clouddriver-web/build/install/clouddriver/bin/clouddriver
- name: dockerBuildpush
uses: docker/build-push-action@v2
with:
context: .
build-args: |
TARGETARCH=amd64
CUSTOMPLUGIN_RELEASEORG=${{ inputs.org }}
CUSTOMPLUGIN_RELEASEREPO=${{ inputs.repo }}
CUSTOMPLUGIN_RELEASEVERSION=${{ inputs.tag }}
file: docker/ubi8/Dockerfile-fips
push: true
tags: |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}"
- name: dockerBuildpushjaeger
uses: docker/build-push-action@v2
with:
context: .
build-args: |
TARGETARCH=amd64
CUSTOMPLUGIN_RELEASEORG=${{ inputs.org }}
CUSTOMPLUGIN_RELEASEREPO=${{ inputs.repo }}
CUSTOMPLUGIN_RELEASEVERSION=${{ inputs.tag }}
file: docker/ubi8/Dockerfile-dev
push: true
tags: |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-dev"
- id: get-build-name
run: |
imageName=${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}
echo "clouddriver=$imageName" >> $GITHUB_OUTPUT
outputs:
runs-on: ubuntu-latest
needs: [build-clouddriver]
steps:
- name: Che4ck out repository code
uses: actions/checkout@v3
with:
repository: opsmx/cve-target
ref: refs/heads/main
- run: |
echo artifactId: ${{ needs.build-clouddriver.outputs.clouddriver }} > default/service-settings/clouddriver.yml
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "updating master Branch images into service settings"
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}