Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #222 from Wikia/crowdin-deploy-support
Browse files Browse the repository at this point in the history
Crowdin deploy support
  • Loading branch information
nikodamn authored Nov 3, 2017
2 parents a3a4970 + 6af310a commit cb00513
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Jenkinsfile-build-and-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node('linux'){
containerTemplate(name: 'jnlp', image: 'artifactory.wikia-inc.com/jenkins/jnlp-slave-ssh:2.62-alpine', args: '${computer.jnlpmac} ${computer.name}'),
containerTemplate(name: 'deployenv', label: 'pandora', image: 'artifactory.wikia-inc.com/platform/alpine:3.6-curl', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'kubectl', label: 'mobile-wiki-kube', image: 'artifactory.wikia-inc.com/ops/k8s-deployer:0.0.12', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'docker', image: 'docker:17.09.0-git', ttyEnabled: true)
containerTemplate(name: 'docker', image: 'artifactory.wikia-inc.com/platform/crowdin:0.0.1', ttyEnabled: true)
],
volumes: [
hostPathVolume(mountPath: "/var/run/docker.sock", hostPath: "/var/run/docker.sock")
Expand All @@ -15,12 +15,19 @@ node('linux'){
def normalizedEnv = params.environment ==~ /sandbox-/ ? "sandbox" : params.environment
def imageVersion = params.version
def imageExists = false
def imageName = "artifactory.wikia-inc.com/mobile-wiki:${imageVersion}"
def imageName = ""

stage('Clone sources'){
checkout scm

println "imageName: ${imageName}"

if (params.crowdin_branch != null) {
def timestamp = System.currentTimeMillis()
imageVersion = "${imageVersion}-${timestamp}"
}

imageName = "artifactory.wikia-inc.com/mobile-wiki:${imageVersion}"
}

container('deployenv'){
Expand All @@ -46,6 +53,11 @@ node('linux'){
}
} else {
stage('Build developement image') {
if (params.crowdin_branch != null) {
sh """#!/bin/sh
./tasks/download-translations.sh /etc/crowdin/crowdin.conf ${params.crowdin_branch}"""
}

sh """#!/bin/sh
./tasks/docker-build.sh ${imageName}"""
}
Expand Down Expand Up @@ -73,4 +85,4 @@ node('linux'){
}
}
}
}
}
Empty file modified tasks/download-translations.sh
100644 → 100755
Empty file.

0 comments on commit cb00513

Please sign in to comment.