-
Notifications
You must be signed in to change notification settings - Fork 8
Ex5 shai #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shikam
wants to merge
9
commits into
devopsloft:main
Choose a base branch
from
shikam:ex5-shai
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ex5 shai #31
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
de75d14
Added current global config
shikam 4d8a294
Changed the checkNginx.sh
shikam d91ac69
Added ex3 and ex4
invalid-email-address 85d7fd9
Changed the ex3 and ex4
invalid-email-address 6bdfe5b
Changed the fiels
invalid-email-address fa861ef
Added All the files for ex5
invalid-email-address 6acc884
Added the default network
invalid-email-address daa2e4b
Removed the temp folder
invalid-email-address d41d439
Fixed the bug
invalid-email-address File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
Empty file.
This file contains hidden or 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 hidden or 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 hidden or 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,59 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| which docker > /dev/null 2>&1 | ||
| if [[ $? -eq 1 ]]; then | ||
| yum update -y | ||
| yum install -y yum-utils device-mapper-persistent-data lvm2 | ||
| yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
| echo "Installing docker....." | ||
| yum install -y docker-ce docker-ce-cli containerd.io | ||
| systemctl enable docker | ||
| systemctl start docker | ||
|
|
||
| systemctl is-active --quiet docker && echo Docker is running | ||
| else | ||
| echo "docker installed" | ||
| fi | ||
|
|
||
| docker container inspect myJenkins > /dev/null 2>&1 | ||
| if [[ $? -eq 1 ]]; then | ||
| echo "Installing jenkins" | ||
| mkdir -p /home/shai/Documents/backery/playground/jcasc/ex3/JenkinsHome | ||
| chmod 755 /home/shai/Documents/backery/playground/jcasc/ex3/JenkinsHome | ||
| cd /home/shai/Documents/backery/playground/jcasc/ex3/ | ||
|
|
||
| echo " | ||
| git:latest | ||
| github-api:latest | ||
| workflow-aggregator:latest | ||
| python:latest | ||
| pipeline-github-lib:latest | ||
| pipeline-stage-view:latest" > plugins.txt | ||
|
|
||
| echo " | ||
| unclassified: | ||
| location: | ||
| url: http://server_ip:8080/ | ||
| jenkins: | ||
| securityRealm: | ||
| local: | ||
| allowsSignup: false | ||
| users: | ||
| - id: ${JENKINS_ADMIN_ID} | ||
| password: ${JENKINS_ADMIN_PASSWORD}" > casc.yaml | ||
|
|
||
| echo " | ||
| FROM jenkins/jenkins:lts | ||
| COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
| RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt | ||
| COPY casc.yaml /var/jenkins_home/casc.yaml | ||
| ENV CASC_JENKINS_CONFIG /var/jenkins_home/casc.yaml | ||
| ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false" > Dockerfile | ||
|
|
||
|
|
||
| docker build -t jenkins:jcasc -f Dockerfile . | ||
| docker run --name myJenkins -u root -d -p 8080:8080 --env JENKINS_ADMIN_ID=root --env JENKINS_ADMIN_PASSWORD=root -v /home/shai/Documents/backery/playground/jcasc/ex3/JenkinsHome:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins:jcasc | ||
| else | ||
| echo "jenkins installed" | ||
| fi | ||
|
|
||
This file contains hidden or 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,29 @@ | ||
| pipeline { | ||
| agent any | ||
| environment { | ||
| CI = 'true' | ||
| } | ||
| stages { | ||
| stage('Build') { | ||
| steps { | ||
| println 'Compiling the application!' | ||
| } | ||
| } | ||
| stage("Deploy to master"){ | ||
| when { | ||
| branch 'master' | ||
| } | ||
| steps { | ||
| println 'Deploying to master' | ||
| } | ||
| } | ||
| stage("Deploy to Production"){ | ||
| when { | ||
| branch 'production' | ||
| } | ||
| steps { | ||
| println 'Deploying to production' | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,26 @@ | ||
| FROM jenkins/jenkins:lts | ||
| USER root | ||
| RUN apt-get update && \ | ||
| apt-get -y install apt-transport-https \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnupg2 \ | ||
| software-properties-common && \ | ||
| curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \ | ||
| add-apt-repository \ | ||
| "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ | ||
| $(lsb_release -cs) \ | ||
| stable" && \ | ||
| apt-get update && \ | ||
| apt-get -y install docker-ce | ||
| RUN apt-get install -y docker-ce | ||
| RUN groupmod -g 993 docker | ||
| RUN usermod -a -G docker jenkins | ||
| USER jenkins | ||
| ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false | ||
| ENV CASC_JENKINS_CONFIG /var/jenkins_home/casc.yml | ||
| COPY JENKINS_ADMIN_ID /run/secrets/JENKINS_ADMIN_ID | ||
| COPY JENKINS_ADMIN_PASSWORD /run/secrets/JENKINS_ADMIN_PASSWORD | ||
| COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
| RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt | ||
| COPY casc.yml /var/jenkins_home/casc.yml |
This file contains hidden or 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,21 @@ | ||
| FROM jenkins/jenkins:lts | ||
| USER root | ||
| RUN apt-get update && \ | ||
| apt-get -y install apt-transport-https \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnupg2 \ | ||
| software-properties-common && \ | ||
| curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \ | ||
| add-apt-repository \ | ||
| "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ | ||
| $(lsb_release -cs) \ | ||
| stable" && \ | ||
| apt-get update && \ | ||
| apt-get -y install docker-ce | ||
| RUN apt-get install -y docker-ce | ||
| RUN usermod -a -G docker jenkins | ||
| USER jenkins | ||
| ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false | ||
| COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
| RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt |
This file contains hidden or 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,23 @@ | ||
| FROM jenkins/jenkins:lts | ||
| USER root | ||
| RUN apt-get update && \ | ||
| apt-get -y install apt-transport-https \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnupg2 \ | ||
| software-properties-common && \ | ||
| curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \ | ||
| add-apt-repository \ | ||
| "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ | ||
| $(lsb_release -cs) \ | ||
| stable" && \ | ||
| apt-get update && \ | ||
| apt-get -y install docker-ce | ||
| RUN apt-get install -y docker-ce | ||
| RUN usermod -a -G docker jenkins | ||
| USER jenkins | ||
| ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false | ||
| COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
| RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt | ||
| COPY casc.yaml /var/jenkins_home/casc.yaml | ||
| ENV CASC_JENKINS_CONFIG /var/jenkins_home/casc.yaml |
This file contains hidden or 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,26 @@ | ||
| FROM jenkins/jenkins:lts | ||
| USER root | ||
| RUN apt-get update && \ | ||
| apt-get -y install apt-transport-https \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnupg2 \ | ||
| software-properties-common && \ | ||
| curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \ | ||
| add-apt-repository \ | ||
| "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ | ||
| $(lsb_release -cs) \ | ||
| stable" && \ | ||
| apt-get update && \ | ||
| apt-get -y install docker-ce | ||
| RUN apt-get install -y docker-ce | ||
| RUN groupmod -g 993 docker | ||
| RUN usermod -a -G docker jenkins | ||
| USER jenkins | ||
| ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false | ||
| ENV CASC_JENKINS_CONFIG /var/jenkins_home/casc.yml | ||
| COPY JENKINS_ADMIN_ID /run/secrets/JENKINS_ADMIN_ID | ||
| COPY JENKINS_ADMIN_PASSWORD /run/secrets/JENKINS_ADMIN_PASSWORD | ||
| COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
| RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt | ||
| COPY casc.yaml /var/jenkins_home/casc.yaml |
This file contains hidden or 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 @@ | ||
| admin |
This file contains hidden or 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 @@ | ||
| admin |
This file contains hidden or 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,22 @@ | ||
| pipeline { | ||
| agent any | ||
| stages { | ||
|
|
||
| stage('Build') { | ||
| steps { | ||
| echo 'Start build' | ||
| sh 'docker build -t microblog:latest .' | ||
| sh 'docker run --name microblogFromJenkins -d -p 8001:5000 --rm microblog:latest' | ||
|
|
||
| } | ||
| } | ||
| } | ||
| post { | ||
| success { | ||
| echo "Pipeline successful" | ||
| } | ||
| failure { | ||
| echo "The Pipeline failed :(" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,2 @@ | ||
| docker build -t jenkins:jcasc . | ||
| docker run --name myJ -u root -d -p 8085:8080 --env JENKINS_ADMIN_ID=admin --env JENKINS_ADMIN_PASSWORD=admin -v /home/shai/Documents/backery/playground/jcasc/JenkinsHomeNew:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins:jcasc |
This file contains hidden or 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,15 @@ | ||
| jenkins: | ||
| securityRealm: | ||
| local: | ||
| allowsSignup: false | ||
| users: | ||
| - id: ${JENKINS_ADMIN_ID} | ||
| password: ${JENKINS_ADMIN_PASSWORD} | ||
| authorizationStrategy: | ||
| globalMatrix: | ||
| permissions: | ||
| - "Overall/Administer:admin" | ||
| - "Overall/Read:authenticated" | ||
| unclassified: | ||
| location: | ||
| url: http://192.168.131.132:8085/ |
This file contains hidden or 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,24 @@ | ||
| --- | ||
| jenkins: | ||
| securityRealm: | ||
| local: | ||
| allowsSignup: false | ||
| users: | ||
| - id: ${JENKINS_ADMIN_ID} | ||
| password: ${JENKINS_ADMIN_PASSWORD} | ||
| authorizationStrategy: | ||
| globalMatrix: | ||
| permissions: | ||
| - "Overall/Administer:admin" | ||
| - "Overall/Read:authenticated" | ||
| remotingSecurity: | ||
| enabled: true | ||
| security: | ||
| queueItemAuthenticator: | ||
| authenticators: | ||
| - global: | ||
| strategy: triggeringUsersAuthorizationStrategy | ||
| unclassified: | ||
| location: | ||
| url: http://192.168.131.134:8085/ | ||
|
|
This file contains hidden or 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,10 @@ | ||
| unclassified: | ||
| location: | ||
| url: http://server_ip:8085/ | ||
| jenkins: | ||
| securityRealm: | ||
| local: | ||
| allowsSignup: false | ||
| users: | ||
| - id: | ||
| password: |
This file contains hidden or 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 @@ | ||
|
|
||
| git:latest | ||
| github-api:latest | ||
| workflow-aggregator:latest | ||
| python:latest | ||
| pipeline-github-lib:latest | ||
| pipeline-stage-view:latest |
This file contains hidden or 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,12 @@ | ||
| FROM python:3.7-alpine | ||
| RUN mkdir /app | ||
| COPY . /app | ||
| WORKDIR /app | ||
| ENV FLASK_APP=app.py | ||
| ENV FLASK_RUN_HOST=0.0.0.0 | ||
| RUN apk add --no-cache gcc musl-dev linux-headers | ||
| COPY requirements.txt requirements.txt | ||
| RUN pip install -r requirements.txt | ||
| EXPOSE 5000 | ||
| #COPY . . | ||
| CMD ["flask", "run"] |
This file contains hidden or 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,8 @@ | ||
| import os | ||
| from flask import Flask | ||
| app = Flask(__name__) | ||
| @app.route('/') | ||
| def welcome(): | ||
| return "Start" | ||
| if __name__ == '__main__': | ||
| app.run(host='0.0.0.0', port=os.getenv('PORT')) |
This file contains hidden or 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 @@ | ||
| flask |
This file contains hidden or 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,35 @@ | ||
| version: '3.6' | ||
|
|
||
| services: | ||
| api: | ||
| build: ./api | ||
| depends_on: | ||
| - db | ||
| environment: | ||
| STAGE: test | ||
| SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://test:test@db/test | ||
| networks: | ||
| - default | ||
| ports: | ||
| - 5000:5000 | ||
| volumes: | ||
| - ./app:/usr/src/app/app | ||
| - ./migrations:/usr/src/app/migrations | ||
| restart: always | ||
|
|
||
| db: | ||
| environment: | ||
| POSTGRES_USER: test | ||
| POSTGRES_PASSWORD: test | ||
| POSTGRES_DB: test | ||
| image: postgres:latest | ||
| networks: | ||
| - default | ||
| ports: | ||
| - 5406:5432 | ||
| restart: always | ||
| volumes: | ||
| - ./postgres-data:/var/lib/postgresql/data | ||
| networks: | ||
| default: | ||
| name: bakery |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.