-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cd65ef
commit 8b4c0c8
Showing
24 changed files
with
706 additions
and
3,439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ~/.shellcheckrc | ||
|
||
external-sources=true | ||
source-path="./shell" | ||
|
||
# Suggest ${VAR} in place of $VAR | ||
enable=require-variable-braces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# GitLab-CI Installation | ||
|
||
## Prerequisites | ||
|
||
- A Kubernetes cluster | ||
- The following tools installed on your local machine: | ||
- [Helm](https://helm.sh/docs/intro/install/) | ||
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | ||
|
||
Both Helm and Kubectl are available in the Homebrew package manager. To install them, run the following commands: | ||
|
||
- Install Homebrew: | ||
|
||
```bash | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
``` | ||
|
||
- Install Helm and Kubectl: | ||
|
||
```bash | ||
brew install helm | ||
brew install kubectl | ||
``` | ||
|
||
## Configure Helm | ||
|
||
```bash | ||
helm repo add gitlab https://charts.gitlab.io | ||
helm repo update | ||
``` | ||
|
||
## Deploy GitLab-CI with Helm | ||
|
||
```bash | ||
helm install gitlab gitlab/gitlab --set global.edition=ce --set global.hosts.domain=scalastic.local --set certmanager.install=false | ||
``` | ||
|
||
Get the Jenkins admin password: | ||
|
||
```bash | ||
kubectl get secret jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode; echo | ||
``` | ||
|
||
## Configure Ingress to access Jenkins | ||
|
||
- Install Nginx Ingress Controller: | ||
|
||
```bash | ||
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx | ||
helm repo update | ||
helm install nginx-ingress ingress-nginx/ingress-nginx | ||
``` | ||
|
||
- Create a `jenkins-ingress.yaml` file: | ||
|
||
```yaml | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: jenkins-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
spec: | ||
rules: | ||
- host: jenkins.scalastic.local | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: jenkins | ||
port: | ||
number: 8080 | ||
``` | ||
- Apply the configuration: | ||
```bash | ||
kubectl apply -f jenkins-ingress.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Jenkins Installation | ||
|
||
## Prerequisites | ||
|
||
- A Kubernetes cluster | ||
- The following tools installed on your local machine: | ||
- [Helm](https://helm.sh/docs/intro/install/) | ||
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | ||
|
||
Both Helm and Kubectl are available in the Homebrew package manager. To install them, run the following commands: | ||
|
||
- Install Homebrew: | ||
|
||
```bash | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
``` | ||
|
||
- Install Helm and Kubectl: | ||
|
||
```bash | ||
brew install helm | ||
brew install kubectl | ||
``` | ||
|
||
## Configure Helm | ||
|
||
```bash | ||
helm repo add jenkins https://charts.jenkins.io | ||
helm repo update | ||
``` | ||
|
||
## Deploy Jenkins with Helm | ||
|
||
```bash | ||
helm install jenkins jenkins/jenkins --set controller.service.type=NodePort | ||
``` | ||
|
||
Get the Jenkins admin password: | ||
|
||
```bash | ||
kubectl get secret jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode; echo | ||
``` | ||
|
||
## Configure Ingress to access Jenkins | ||
|
||
- Install Nginx Ingress Controller: | ||
|
||
```bash | ||
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx | ||
helm repo update | ||
helm install nginx-ingress ingress-nginx/ingress-nginx | ||
``` | ||
|
||
- Create a `jenkins-ingress.yaml` file: | ||
|
||
```yaml | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: jenkins-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
spec: | ||
rules: | ||
- host: jenkins.scalastic.local | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: jenkins | ||
port: | ||
number: 8080 | ||
``` | ||
- Apply the configuration: | ||
```bash | ||
kubectl apply -f jenkins-ingress.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: jenkins-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
spec: | ||
rules: | ||
- host: jenkins.scalastic.local | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: jenkins | ||
port: | ||
number: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck source-path=shell | ||
. "${SHELL_DIR}/lib/core/logger.sh" | ||
|
||
# shellcheck disable=SC2034 | ||
COMMAND_SUCCESS=0 | ||
# shellcheck disable=SC2034 | ||
COMMAND_WARNING=1 | ||
# shellcheck disable=SC2034 | ||
COMMAND_ERROR=2 | ||
|
||
command.run_function() { | ||
local function_name="$1" | ||
shift | ||
local args=("$@") | ||
|
||
if declare -f "${function_name}" > /dev/null; then | ||
log.debug "Running function: ${function_name} with args: ${args[*]}" | ||
${function_name} "${args[@]}" | ||
else | ||
log.error "Function ${function_name} is not defined" | ||
return 1 | ||
fi | ||
} | ||
|
||
command.run_eval() { | ||
local command="$1" | ||
|
||
log.debug "Running eval for command: ${command}" | ||
eval "${command}" | ||
} |
Oops, something went wrong.