Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from mesosphere/mh/build
Browse files Browse the repository at this point in the history
Fix Jenkinsfile issues
  • Loading branch information
mhrabovcin authored May 29, 2019
2 parents 086ef2a + 4854cfb commit b02e9d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
27 changes: 17 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

@Library('sec_ci_libs@v2-latest') _

def master_branches = ["master", ] as String[]

task_wrapper('mesos-sec', master_branches, '8b793652-f26a-422f-a9ba-0d1e47eb9d89', '#dcos-security-ci') {

stage("Verify author") {
user_is_authorized(master_branches, '8b793652-f26a-422f-a9ba-0d1e47eb9d89', '#dcos-security-ci')
}

stage('Checkout') {
checkout scm
}

stage("build") {
sh 'make build'
}
Expand All @@ -28,21 +34,22 @@ task_wrapper('mesos-sec', master_branches, '8b793652-f26a-422f-a9ba-0d1e47eb9d89
credentialsId: '4551c307-10ae-40f9-a0ac-f1bb44206b5b',
variable: 'DOCKER_HUB_EMAIL']
]) {
sh "docker login -u '${env.DOCKER_HUB_USERNAME}' -p '${env.DOCKER_HUB_PASSWORD}'"
sh "echo ${env.DOCKER_HUB_PASSWORD} | docker login -u '${env.DOCKER_HUB_USERNAME}' --password-stdin"
}
sh 'make docker-push'
}

stage("release") {
when { tag "" }
withCredentials([
[
$class: 'StringBinding',
credentialsId: 'd146870f-03b0-4f6a-ab70-1d09757a51fc',
variable: 'GITHUB_TOKEN',
]
]) {
sh 'make release'
if (env.TAG_NAME) {
withCredentials([
[
$class: 'StringBinding',
credentialsId: 'c674acda-2a3b-497c-88f4-ff5c16f7edc0',
variable: 'GITHUB_TOKEN',
]
]) {
sh 'make release'
}
}
}
}
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ docker-test: docker-image

github-release:
curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 -o github-release.tar.bz2
tar xzf github-release.tar.bz2
# Our jenkins doesn't support .tar.bz2 archivves
bunzip2 -c < github-release.tar.bz2 | gzip -c > github-release.tar.gz
tar xzf github-release.tar.gz
mv bin/linux/amd64/github-release .
rm -rf bin github-release.tar.bz2

release: github-release build
./github-release release -u $(USER) -r $(REPO) \
./github-release -v release -u $(USER) -r $(REPO) \
-t $(TAG) -n $(TAG)
./github-release upload -u $(USER) -r $(REPO) -t $(TAG) -n $(BIN) -f $(BIN)
./github-release -v upload -u $(USER) -r $(REPO) -t $(TAG) -n $(BIN) -f $(BIN)

0 comments on commit b02e9d2

Please sign in to comment.