Skip to content

Commit

Permalink
Merge pull request smithmicro#68 from vtepliuk/develop
Browse files Browse the repository at this point in the history
Remove docker.smithmicro.io references
  • Loading branch information
mblomdahl authored Dec 10, 2017
2 parents 1ab1d80 + b2dbd98 commit ab04351
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build: docker build -t docker.smithmicro.io/mapbox-gl-circle:dev .
# Start: docker run -itp 9966:9966 docker.smithmicro.io/mapbox-gl-circle:dev
# Build: docker build -t mapbox-gl-circle:dev .
# Start: docker run -itp 9966:9966 mapbox-gl-circle:dev
# Evaluate: open http://localhost:9966

FROM node:8-alpine
Expand Down
29 changes: 8 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ pipeline {
return fullBranchName.split('/') as List
}

throw new AssertionError("Enforcing Gitflow Workflow and SemVer. Ha!")
if (fullBranchName.matches(/PR-\d+$/)) {
return fullBranchName.split('-') as List
}

error "Enforcing Gitflow Workflow and SemVer on '${fullBranchName}'. Ha!"
}

def getBuildVersion = { String fullBranchName, buildNumber ->
Expand All @@ -55,8 +59,10 @@ pipeline {
case 'release':
assert branchTypeAndName[1] == projectVersion
return "${projectVersion}-rc.${buildNumber}"
case 'PR':
return "${projectVersion}+PR.${branchTypeAndName[1]}.${buildNumber}"
default:
throw new AssertionError("Oops, Mats messed up! :(")
error "Oops, we messed up! :("
}
}

Expand All @@ -73,8 +79,6 @@ pipeline {

env.BUILD_VERSION = getBuildVersion(BRANCH_NAME as String, BUILD_NUMBER)
env.NPM_TAG = getNpmTag(BRANCH_NAME as String)
env.DOCKER_TAG = env.BUILD_VERSION.replace('+', '_')
env.DOCKER_TAG_ALIAS = env.NPM_TAG
env.BUILD_TYPE = env.NPM_TAG ? env.NPM_TAG : 'develop' // latest, next or develop

if (env.BUILD_TYPE == 'next') {
Expand Down Expand Up @@ -125,27 +129,10 @@ pipeline {
}
environment {
NPM_TOKEN = credentials('mblomdahl_npm')
DOCKER_LOGIN = credentials('docker_smithmicro_io')
}
steps {
//noinspection GroovyAssignabilityCheck
parallel(
'Docker Image': {
dir('_docker-build') {
unstash 'pre_install_git_checkout'
sh 'docker login -u $DOCKER_LOGIN_USR -p $DOCKER_LOGIN_PSW docker.smithmicro.io'
sh 'docker build -t docker.smithmicro.io/mapbox-gl-circle:$DOCKER_TAG .'
sh 'docker save docker.smithmicro.io/mapbox-gl-circle:$DOCKER_TAG | gzip - \
> mapbox-gl-circle-$BUILD_VERSION.docker.tar.gz'
archiveArtifacts "mapbox-gl-circle-${BUILD_VERSION}.docker.tar.gz"

sh 'docker push docker.smithmicro.io/mapbox-gl-circle:$DOCKER_TAG'
sh 'docker tag docker.smithmicro.io/mapbox-gl-circle:$DOCKER_TAG \
docker.smithmicro.io/mapbox-gl-circle:$DOCKER_TAG_ALIAS'
sh 'docker push docker.smithmicro.io/mapbox-gl-circle:$DOCKER_TAG_ALIAS'
deleteDir()
}
},
'NPM Package': {
sh 'echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc'
sh 'npm publish --tag $NPM_TAG .'
Expand Down

0 comments on commit ab04351

Please sign in to comment.