Skip to content

Commit 88c41c7

Browse files
committed
moved yaml files to separate directory
1 parent feca96b commit 88c41c7

9 files changed

Lines changed: 232 additions & 10 deletions

.cilibs/install-and-run-spinnaker.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sudo bash InstallHalyard.sh --version ${HAL_VERSION} --user $USERNAME -y
1414
hal -v
1515

1616
# Create Kind cluster
17-
kind create cluster --config="${EXEC_DIR}/kind-cluster-config.yaml"
17+
kind create cluster --config="${EXEC_DIR}/templates/kind-cluster-config.yaml"
1818
kubectl config use-context kind-kind
1919
kubectl cluster-info
2020

@@ -34,8 +34,8 @@ hal -q config deploy edit --type distributed --account-name my-k8s-v2-account
3434

3535
## Install minio
3636
kubectl create namespace spinnaker
37-
sed -i 's/LoadBalancer/ClusterIP/g' "${EXEC_DIR}/minio-standalone.yaml"
38-
kubectl -n spinnaker create -f "${EXEC_DIR}/minio-standalone.yaml"
37+
sed -i 's/LoadBalancer/ClusterIP/g' "${EXEC_DIR}/templates/minio-standalone.yaml"
38+
kubectl -n spinnaker create -f "${EXEC_DIR}/templates/minio-standalone.yaml"
3939
mkdir -p ~/.hal/default/profiles
4040
echo "spinnaker.s3.versioning: false" >> ~/.hal/default/profiles/front50-local.yml
4141

@@ -55,8 +55,8 @@ hal config security api edit --override-base-url='http://spinnaker/api/v1'
5555
echo 'window.spinnakerSettings.authEnabled = true;' > ~/.hal/default/profiles/settings-local.js
5656
mkdir -p ~/.hal/default/service-settings
5757
echo 'healthEndpoint: /api/v1/health' > ~/.hal/default/service-settings/gate.yml
58-
sed -i "s/GATE_PASS/${GATE_PASS}/g" "${EXEC_DIR}/gate-local.yml"
59-
cp "${EXEC_DIR}/gate-local.yml" ~/.hal/default/profiles/gate-local.yml
58+
sed -i "s/GATE_PASS/${GATE_PASS}/g" "${EXEC_DIR}/templates/gate-local.yml"
59+
cp "${EXEC_DIR}/templates/gate-local.yml" ~/.hal/default/profiles/gate-local.yml
6060

6161
# Install Spinnaker
6262
hal -q deploy apply
@@ -66,11 +66,11 @@ do
6666
done
6767

6868
# Install Ingress controller
69-
kubectl apply -f "${EXEC_DIR}/ingress-mandatory.yaml"
70-
kubectl apply -f "${EXEC_DIR}/ingress-service-nodeport.yaml"
69+
kubectl apply -f "${EXEC_DIR}/templastes/ingress-mandatory.yaml"
70+
kubectl apply -f "${EXEC_DIR}/templates/ingress-service-nodeport.yaml"
7171
kubectl patch deployments -n ingress-nginx nginx-ingress-controller -p '{"spec":{"template":{"spec":{"containers":[{"name":"nginx-ingress-controller","ports":[{"containerPort":80,"hostPort":80},{"containerPort":443,"hostPort":443}]}],"nodeSelector":{"ingress-ready":"true"},"tolerations":[{"key":"node-role.kubernetes.io/master","operator":"Equal","effect":"NoSchedule"}]}}}}'
72-
kubectl -n spinnaker apply -f "${EXEC_DIR}/spinnaker-ingress.yaml"
72+
kubectl -n spinnaker apply -f "${EXEC_DIR}/templates/spinnaker-ingress.yaml"
7373

7474
# Generate Floodgate config file
75-
sed -i "s/GATE_PASS/${GATE_PASS}/g" "${EXEC_DIR}/floodgate-config.yaml"
76-
cp "${EXEC_DIR}/floodgate-config.yaml" ~/floodgate.yaml
75+
sed -i "s/GATE_PASS/${GATE_PASS}/g" "${EXEC_DIR}/templates/floodgate-config.yaml"
76+
cp "${EXEC_DIR}/templates/floodgate-config.yaml" ~/floodgate.yaml
File renamed without changes.
File renamed without changes.

.circleci/config.yml

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
version: 2.1
2+
3+
aliases:
4+
latest-gate-version: &default-gate-version
5+
gate_api_branch:
6+
type: string
7+
default: release-1.20.x
8+
supported-spinnaker-releases: &gate-versions
9+
gate_api_branch: [ "release-1.20.x", "release-1.19.x", "release-1.18.x" ]
10+
supported-client-os: &build-os-type
11+
build_os: [ "linux", "darwin" ]
12+
release-filters: &filters-release
13+
filters:
14+
branches:
15+
only:
16+
- /release-v[0-9]+\.[0-9]+\.x/
17+
tags:
18+
only:
19+
- /v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?/
20+
21+
commands:
22+
install_toolset:
23+
description: "Install needed extra tools"
24+
steps:
25+
- run:
26+
name: Install tools
27+
command: .cilibs/install_toolset.sh
28+
29+
wait_for_dpkg:
30+
description: "Wait for packaging operations to finish"
31+
steps:
32+
- run:
33+
name: Wait for packaging operations to finish
34+
command: .cilibs/wait_for_dpkg.sh
35+
36+
jobs:
37+
generate_swagger:
38+
parameters: *default-gate-version
39+
docker:
40+
- image: circleci/openjdk:11.0.3-jdk-stretch
41+
steps:
42+
- checkout
43+
- run:
44+
name: Prepare extra directories
45+
command: sudo .cilibs/prepare_extra_directories.sh
46+
- run:
47+
name: Setup swagger
48+
command: sudo .cilibs/setup_swagger.sh << parameters.gate_api_branch >>
49+
- persist_to_workspace:
50+
root: /floodgate
51+
paths:
52+
- gate-swagger.json
53+
- gateapi
54+
- store_artifacts:
55+
path: /floodgate/gate/swagger/gate-swagger.json
56+
destination: gate-swagger.json
57+
58+
build:
59+
parameters:
60+
<<: *default-gate-version
61+
build_os:
62+
type: string
63+
default: linux
64+
build_arch:
65+
type: string
66+
default: amd64
67+
send_coverity:
68+
type: enum
69+
default: send
70+
enum: ["send", "dont-send"]
71+
docker:
72+
- image: circleci/golang:1.14.1
73+
environment:
74+
GO111MODULE: "on"
75+
working_directory: /go/src/github.com/codilime/floodgate
76+
steps:
77+
- checkout
78+
- run: git submodule sync
79+
- run: git submodule update --init
80+
- run:
81+
name: Remove gateapi dir
82+
command: rm -r gateapi
83+
- attach_workspace:
84+
at: ./
85+
- run:
86+
name: Get dependencies
87+
command: .cilibs/get_dependencies.sh
88+
- run:
89+
name: Examine source code with go vet
90+
command: .cilibs/examine_source_code_with_go_get.sh
91+
- run:
92+
name: Execute go tests
93+
command: .cilibs/execute_go_tests.sh
94+
- run:
95+
name: Compile code
96+
command: .cilibs/compile_code.sh -o << parameters.build_os >> -a << parameters.build_arch >> -g << parameters.gate_api_branch >>
97+
- run:
98+
name: Calculate code coverage
99+
environment:
100+
REQUIREDCODECOVERAGE: 60
101+
command: .cilibs/calculate_code_coverage.sh << parameters.send_coverity >>
102+
- run:
103+
name: Check linting
104+
command: .cilibs/check_linting.sh
105+
- run:
106+
name: Copy binaries for later use
107+
command: sudo .cilibs/copy_binaries_for_later_use.sh
108+
- run:
109+
name: Generate checksum
110+
command: .cilibs/generate_checksum.sh -o << parameters.build_os >> -a << parameters.build_arch >> -g << parameters.gate_api_branch >>
111+
- persist_to_workspace:
112+
root: /floodgate/bin
113+
paths:
114+
- floodgate
115+
- store_artifacts:
116+
path: /go/src/github.com/codilime/floodgate/floodgate
117+
destination: floodgate-<< parameters.gate_api_branch >>.<< parameters.build_os >>.<< parameters.build_arch >>
118+
- store_artifacts:
119+
path: /go/src/github.com/codilime/floodgate/floodgate-<< parameters.gate_api_branch >>.<< parameters.build_os >>.<< parameters.build_arch >>.sha1sum
120+
destination: floodgate-<< parameters.gate_api_branch >>.<< parameters.build_os >>.<< parameters.build_arch >>.sha1sum
121+
122+
start_spinnaker:
123+
parameters:
124+
<<: *default-gate-version
125+
floodgate_extra_params:
126+
type: string
127+
default: ""
128+
machine:
129+
image: ubuntu-1604:202004-01
130+
steps:
131+
- checkout
132+
- run:
133+
name: Update submodules - sponnet
134+
command: git submodule init && git submodule update
135+
- attach_workspace:
136+
at: ./
137+
- run:
138+
name: Prepare directories
139+
command: .cilibs/prepare_directories.sh
140+
- install_toolset
141+
- run:
142+
name: Update /etc/hosts
143+
command: .cilibs/update_hosts.sh
144+
- wait_for_dpkg
145+
- run:
146+
name: Install Spinnaker and configure Floodgate
147+
command: .cilibs/install_spinnaker_and_configure_floodgate.sh << parameters.gate_api_branch >>
148+
- run:
149+
name: Test Floodgate against running Spinnaker instance
150+
command: .cilibs/test_floodgate_against_running_spinnaker_instance.sh << parameters.floodgate_extra_params >>
151+
152+
workflows:
153+
periodic:
154+
triggers:
155+
- schedule:
156+
cron: "15 2 * * *"
157+
filters:
158+
branches:
159+
only:
160+
- master
161+
jobs:
162+
- generate_swagger:
163+
name: generate swagger api << matrix.gate_api_branch >>
164+
matrix:
165+
parameters: *gate-versions
166+
- build:
167+
name: build for << matrix.build_os >> against gate << matrix.gate_api_branch >>
168+
build_arch: amd64
169+
send_coverity: dont-send
170+
matrix:
171+
parameters:
172+
<<: *gate-versions
173+
<<: *build-os-type
174+
requires:
175+
- generate swagger api << matrix.gate_api_branch >>
176+
- start_spinnaker:
177+
name: test floodgate with working spinnaker << matrix.gate_api_branch >>
178+
matrix:
179+
parameters: *gate-versions
180+
requires:
181+
- build for linux against gate << matrix.gate_api_branch >>
182+
183+
release:
184+
jobs:
185+
- generate_swagger:
186+
<<: *filters-release
187+
name: generate swagger api << matrix.gate_api_branch >>
188+
matrix:
189+
parameters: *gate-versions
190+
191+
- build:
192+
<<: *filters-release
193+
name: build for << matrix.build_os >> against gate << matrix.gate_api_branch >>
194+
build_arch: amd64
195+
send_coverity: dont-send
196+
matrix:
197+
parameters:
198+
<<: *gate-versions
199+
<<: *build-os-type
200+
requires:
201+
- generate swagger api << matrix.gate_api_branch >>
202+
- start_spinnaker:
203+
<<: *filters-release
204+
name: test floodgate with working spinnaker << matrix.gate_api_branch >>
205+
matrix:
206+
parameters: *gate-versions
207+
requires:
208+
- build for linux against gate << matrix.gate_api_branch >>
209+
210+
commit:
211+
jobs:
212+
- generate_swagger:
213+
name: generate swagger api
214+
- build:
215+
name: build
216+
requires:
217+
- generate swagger api
218+
- start_spinnaker:
219+
name: test floodgate with working spinnaker
220+
floodgate_extra_params: "-q"
221+
requires:
222+
- build

0 commit comments

Comments
 (0)