From 399b73846dca34b0e131ebd857f19f2de08328f6 Mon Sep 17 00:00:00 2001 From: Fatimak11 Date: Sat, 6 Aug 2022 03:44:33 +0300 Subject: [PATCH 1/2] new --- Dockerfile | 5 +++++ Dockerrun.aws.json | 12 +++++++++++ Jenkinsfile | 38 +++++++++++++++++++++++++++++++++ Jenkinsfile-EBS3 | 53 ++++++++++++++++++++++++++++++++++++++++++++++ forbidden.html | 4 ++++ 5 files changed, 112 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerrun.aws.json create mode 100644 Jenkinsfile create mode 100644 Jenkinsfile-EBS3 create mode 100644 forbidden.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..24f6d50 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx + +COPY . /usr/share/nginx/html + +EXPOSE 80 \ No newline at end of file diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json new file mode 100644 index 0000000..1151667 --- /dev/null +++ b/Dockerrun.aws.json @@ -0,0 +1,12 @@ +{ + "AWSEBDockerrunVersion": "1", + "Image": { + "Name": "registry.hub.docker.com/chandradeoarya/dojo-jump:latest" + }, + "Ports": [ + { + "ContainerPort": 80 + } + ] + } + \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..a0571a1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + agent any + + enviroment { + DOCKERHUB_CERDENTIALS=credentials('chandra-dockerhub') + + } + + stages { + stage('Build'){ + + steps { + sh 'docker build -t chandradeoarya/dojo-jump:leatest .' + } + } + + stage('Login'){ + + steps { + sh 'echo $DOCKERHUB_CREDENTALS_PWS | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' + } + } + + stage('Push') { + + steps { + sh 'docker push chandradeoarya/dojo-jump:latest' + } + } + } + + post { + always { + sh 'docker logout' + } + } + +} \ No newline at end of file diff --git a/Jenkinsfile-EBS3 b/Jenkinsfile-EBS3 new file mode 100644 index 0000000..bd3b2a6 --- /dev/null +++ b/Jenkinsfile-EBS3 @@ -0,0 +1,53 @@ +pipeline { + + agent any + + environment { + DOCKERHUB_CREDENTIALS=credentials('chandra-dockerhub') + AWS_ACCESS_KEY_ID = credentials('jenkins-aws-secret-key-id') + AWS_SECRET_ACCESS_KEY = credentials('jenkins-aws-secret-access-key') + ARTIFACT_NAME = 'Dockerrun.aws.json' + AWS_S3_BUCKET = 'online-dojojump-docker-cicd' + AWS_EB_APP_NAME = 'online-dojojump-cicd' + AWS_EB_ENVIRONMENT_NAME = 'Onlinedojojumpcicd-env' + AWS_EB_APP_VERSION = "${BUILD_ID}" + } + + stages { + + stage('Build') { + + steps { + sh 'docker build -t chandradeoarya/dojo-jump:latest .' + } + } + + stage('Login') { + + steps { + sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' + } + } + + stage('Push') { + + steps { + sh 'docker push chandradeoarya/dojo-jump:latest' + } + } + + stage('Deploy') { + steps { + sh 'aws configure set region us-east-1 ' + sh 'aws elasticbeanstalk create-application-version --application-name $AWS_EB_APP_NAME --version-label $AWS_EB_APP_VERSION --source-bundle S3Bucket=$AWS_S3_BUCKET,S3Key=$ARTIFACT_NAME' + sh 'aws elasticbeanstalk update-environment --application-name $AWS_EB_APP_NAME --environment-name $AWS_EB_ENVIRONMENT_NAME --version-label $AWS_EB_APP_VERSION' + } + } + } + post { + always { + sh 'docker logout' + } + } + +} \ No newline at end of file diff --git a/forbidden.html b/forbidden.html new file mode 100644 index 0000000..b70ed5d --- /dev/null +++ b/forbidden.html @@ -0,0 +1,4 @@ +

Open in https by clicking here

+click here + +

Only saudi people can play this game

\ No newline at end of file From f05e6234b575b93976b3d8370466e2503c1b10d7 Mon Sep 17 00:00:00 2001 From: Fatimah Khamees <107077564+Fatimak11@users.noreply.github.com> Date: Mon, 8 Aug 2022 12:02:37 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d6b657..a14adca 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-Dojo Jump +Dojo Jumping Game