Skip to content
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

Docker compose #23

Open
wants to merge 13 commits into
base: docker-compose
Choose a base branch
from
Empty file added AWS
Empty file.
4 changes: 2 additions & 2 deletions Jenkinsfile-1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pipeline {
agent { label 'macos' }
agent { label 'master' }
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
Expand All @@ -13,4 +13,4 @@ pipeline {
}
}
}
}
}
21 changes: 7 additions & 14 deletions Jenkinsfile-2
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
pipeline {
agent { label 'macos' }
agent { label 'master' }
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
environment {
DOCKER_HUB_CREDS = credentials('darinpope-docker-hub')
AWS_CREDS = credentials('darinpope-aws-creds')
KEYCHAIN_PASSWORD = credentials('darinpope-keychain')
DOCKER_HUB_CREDS = credentials('docker-hub-password')
AWS_CREDS = credentials('nkwochidubem-aws-cred')
}
stages {
stage('Tooling versions') {
Expand All @@ -17,29 +16,23 @@ pipeline {
'''
}
}
stage('Unlock keychain') {
steps {
sh 'security -v unlock-keychain -p $KEYCHAIN_PASSWORD ~/Library/Keychains/login.keychain-db'
}
}
stage('Build') {
steps {
sh 'docker context ls'
sh 'docker context use default'
sh 'echo $DOCKER_HUB_CREDS | docker login --username=nkwochidubem --password-stdin docker.io'
sh 'docker compose build'
sh 'docker compose push'
}
}
stage('Deploy') {
steps {
sh 'docker context create ecs myecscontext --from-env'
sh 'docker context use myecscontext'
sh 'docker compose up'
sh 'docker compose ps --format json'
sh 'docker compose down'
}
}
}
post {
always {
sh 'security -v lock-keychain ~/Library/Keychains/login.keychain-db'
}
}
}
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
x-aws-vpc: "vpc-0dece3d7dce2d0578"
x-aws-vpc: "vpc-07612c6b50521af3a"
services:
web:
image: darinpope/java-web-app:latest
image: nkwochidubem/java-web-app:latest
build:
context: .
ports:
Expand Down