Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.git
.gitignore
LICENSE
README.md
CHANGELOG.md
.git
.gitignore
LICENSE
README.md
CHANGELOG.md
60 changes: 30 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Tmp files to always-ignore extensions
*.diff
*.err
*.rej
*.swo
*~
*.sass-cache
*.orig

# OS
.DS_Store
Thumbs.db

# Editors
.cache
.project
.settings
.tmproj
*.esproj
*.sublime-project
*.sublime-workspace
/.redcar
/nbproject
/.project
/.idea
/.eclipse
*.vi

# logs files
*.log
# Tmp files to always-ignore extensions
*.diff
*.err
*.rej
*.swo
*~
*.sass-cache
*.orig
# OS
.DS_Store
Thumbs.db
# Editors
.cache
.project
.settings
.tmproj
*.esproj
*.sublime-project
*.sublime-workspace
/.redcar
/nbproject
/.project
/.idea
/.eclipse
*.vi
# logs files
*.log
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM php:7-apache
MAINTAINER Dare dare@zooto.io

RUN docker-php-ext-install mysqli
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
COPY start-apache /usr/local/bin
RUN a2enmod rewrite

# Copy application source
COPY html /var/www
RUN chown -R www-data:www-data /var/www

FROM php:7-apache
MAINTAINER Dare dare@zooto.io
RUN docker-php-ext-install mysqli
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
COPY start-apache /usr/local/bin
RUN a2enmod rewrite
# Copy application source
COPY html /var/www
RUN chown -R www-data:www-data /var/www
CMD ["start-apache"]
288 changes: 144 additions & 144 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,145 +1,145 @@
pipeline {
agent any

environment
{
PROJECT = 'zooto-tooling-prod'
ECRURL = '059636857273.dkr.ecr.eu-central-1.amazonaws.com'
DEPLOY_TO = 'development'
}

stages {

stage("Initial cleanup") {
steps {
dir("${WORKSPACE}") {
deleteDir()
}
}
}

stage('Checkout')
{
steps {
checkout([
$class: 'GitSCM',
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
// branches: [[name: '$branch']],
userRemoteConfigs: [[url: "https://github.com/darey-io/tooling.git ",credentialsId:'GITHUB_CREDENTIALS']]
])

}
}

// stage('Checkout Helm chart')
// {
// steps {
// checkout([
// $class: 'GitSCM',
// doGenerateSubmoduleConfigurations: false,
// extensions: [[$class: 'RelativeTargetDirectory',
// relativeTargetDir: 'helm']],
// submoduleCfg: [],
// branches: [[name: 'master']],
// userRemoteConfigs: [[url: "https://gitlab.com/propitix/kubernetes/helm.git",credentialsId:'GIT_CREDENTIALS']]
// ])

// }
// }
stage('Build preparations')
{
steps
{
script
{
// calculate GIT lastest commit short-hash
gitCommitHash = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
shortCommitHash = gitCommitHash.take(7)
// calculate a sample version tag
VERSION = shortCommitHash
// set the build display name
currentBuild.displayName = "#${BUILD_ID}-${VERSION}"
IMAGE = "$PROJECT:$VERSION"
}
}
}

stage('Build For Dev Environment') {
when {
expression { BRANCH_NAME ==~ /(dev)/ }
}
steps {
echo 'Build Dockerfile....'
script {
sh("eval \$(aws ecr get-login --no-include-email --region eu-central-1 | sed 's|https://||')")
// sh "docker build --network=host -t $IMAGE -f deploy/docker/Dockerfile ."
sh "docker build --network=host -t $IMAGE ."
docker.withRegistry("https://$ECRURL"){
docker.image("$IMAGE").push("dev-$BUILD_NUMBER")
}
}
}
}

stage('Build For Staging Environment') {
when {
expression { BRANCH_NAME ==~ /(staging|master)/ }
}
steps {
echo 'Build Dockerfile....'
script {
sh("eval \$(aws ecr get-login --no-include-email --region eu-central-1 | sed 's|https://||')")
// sh "docker build --network=host -t $IMAGE -f deploy/docker/Dockerfile ."
sh "docker build --network=host -t $IMAGE ."
docker.withRegistry("https://$ECRURL"){
docker.image("$IMAGE").push("staging-$BUILD_NUMBER")
}
}
}
}


stage('Build For Production Environment') {
when { tag "release-*" }
steps {
echo 'Build Dockerfile....'
script {
sh("eval \$(aws ecr get-login --no-include-email --region eu-central-1 | sed 's|https://||')")
// sh "docker build --network=host -t $IMAGE -f deploy/docker/Dockerfile ."
sh "docker build --network=host -t $IMAGE ."
docker.withRegistry("https://$ECRURL"){
docker.image("$IMAGE").push("prod-$BUILD_NUMBER")
}
}
}
}

//








// stage('Update Helm appVersion') {
// steps {
// echo 'Update appVersion'
// sh '''
// cat helm/Chart.yaml.template | sed "s/appVersion: .*/appVersion: \"${BUILD_NUMBER}\"/g" > helm/Chart.yaml
// '''
// }
// }
}

post
{
always
{
sh "docker rmi -f $IMAGE "
}
}
pipeline {
agent any
environment
{
PROJECT = 'zooto-tooling-prod'
ECRURL = '059636857273.dkr.ecr.eu-central-1.amazonaws.com'
DEPLOY_TO = 'development'
}
stages {
stage("Initial cleanup") {
steps {
dir("${WORKSPACE}") {
deleteDir()
}
}
}
stage('Checkout')
{
steps {
checkout([
$class: 'GitSCM',
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
// branches: [[name: '$branch']],
userRemoteConfigs: [[url: "https://github.com/darey-io/tooling.git ",credentialsId:'GITHUB_CREDENTIALS']]
])
}
}
// stage('Checkout Helm chart')
// {
// steps {
// checkout([
// $class: 'GitSCM',
// doGenerateSubmoduleConfigurations: false,
// extensions: [[$class: 'RelativeTargetDirectory',
// relativeTargetDir: 'helm']],
// submoduleCfg: [],
// branches: [[name: 'master']],
// userRemoteConfigs: [[url: "https://gitlab.com/propitix/kubernetes/helm.git",credentialsId:'GIT_CREDENTIALS']]
// ])
// }
// }
stage('Build preparations')
{
steps
{
script
{
// calculate GIT lastest commit short-hash
gitCommitHash = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
shortCommitHash = gitCommitHash.take(7)
// calculate a sample version tag
VERSION = shortCommitHash
// set the build display name
currentBuild.displayName = "#${BUILD_ID}-${VERSION}"
IMAGE = "$PROJECT:$VERSION"
}
}
}
stage('Build For Dev Environment') {
when {
expression { BRANCH_NAME ==~ /(dev)/ }
}
steps {
echo 'Build Dockerfile....'
script {
sh("eval \$(aws ecr get-login --no-include-email --region eu-central-1 | sed 's|https://||')")
// sh "docker build --network=host -t $IMAGE -f deploy/docker/Dockerfile ."
sh "docker build --network=host -t $IMAGE ."
docker.withRegistry("https://$ECRURL"){
docker.image("$IMAGE").push("dev-$BUILD_NUMBER")
}
}
}
}
stage('Build For Staging Environment') {
when {
expression { BRANCH_NAME ==~ /(staging|master)/ }
}
steps {
echo 'Build Dockerfile....'
script {
sh("eval \$(aws ecr get-login --no-include-email --region eu-central-1 | sed 's|https://||')")
// sh "docker build --network=host -t $IMAGE -f deploy/docker/Dockerfile ."
sh "docker build --network=host -t $IMAGE ."
docker.withRegistry("https://$ECRURL"){
docker.image("$IMAGE").push("staging-$BUILD_NUMBER")
}
}
}
}
stage('Build For Production Environment') {
when { tag "release-*" }
steps {
echo 'Build Dockerfile....'
script {
sh("eval \$(aws ecr get-login --no-include-email --region eu-central-1 | sed 's|https://||')")
// sh "docker build --network=host -t $IMAGE -f deploy/docker/Dockerfile ."
sh "docker build --network=host -t $IMAGE ."
docker.withRegistry("https://$ECRURL"){
docker.image("$IMAGE").push("prod-$BUILD_NUMBER")
}
}
}
}
//
// stage('Update Helm appVersion') {
// steps {
// echo 'Update appVersion'
// sh '''
// cat helm/Chart.yaml.template | sed "s/appVersion: .*/appVersion: \"${BUILD_NUMBER}\"/g" > helm/Chart.yaml
// '''
// }
// }
}
post
{
always
{
sh "docker rmi -f $IMAGE "
}
}
}
Loading