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

Commit 85b35f5

Browse files
authored
Merge pull request #188 from scalecube/travis-ci-cd
ci-cd using Travis CI
2 parents bdf4350 + ac82ead commit 85b35f5

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

src/main/scripts/cd/before-deploy.sh

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,52 @@ BEFORE_DEPLOY_EXEC_FILES=$(find $DIRNAME -name 'before-deploy-*.sh')
66
echo Running $0
77
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*
88

9-
function decryptsecrets {
10-
echo decrypting secrets
11-
echo *-*-*-*-*-*-*-*-*-*-*-*
12-
mkdir -p ~/tmp
13-
openssl aes-256-cbc -K $encrypted_SOME_key -iv $encrypted_SOME_iv -in $TRAVIS_BUILD_DIR/src/main/scripts/cd/secrets.tar.enc -out ~/tmp/secrets.tar -d
14-
md5sum ~/tmp/secrets.tar
15-
tar -xvf ~/tmp/secrets.tar -C ~/.ssh
16-
shred -z -u ~/tmp/secrets.tar
9+
decryptsecrets() {
10+
echo decrypting secrets
11+
echo *-*-*-*-*-*-*-*-*-*-*-*
12+
mkdir -p ~/tmp
13+
openssl aes-256-cbc -K $encrypted_SOME_key -iv $encrypted_SOME_iv -in $TRAVIS_BUILD_DIR/src/main/scripts/cd/secrets.tar.enc -out ~/tmp/secrets.tar -d
14+
md5sum ~/tmp/secrets.tar
15+
tar -xvf ~/tmp/secrets.tar -C ~/.ssh
16+
shred -z -u ~/tmp/secrets.tar
1717
}
1818

19-
function importpgp {
20-
echo importing pgp secret
21-
echo *-*-*-*-*-*-*-*-*-*-*-*
22-
eval $(gpg-agent --daemon --batch)
19+
importpgp() {
20+
echo importing pgp secret
21+
echo *-*-*-*-*-*-*-*-*-*-*-*
22+
eval $(gpg-agent --daemon --batch)
2323
gpg --batch --passphrase $GPG_PASSPHRASE --import ~/.ssh/codesigning.asc
2424
shred -z -u ~/.ssh/codesigning.asc
2525
}
2626

27-
function setupssh {
28-
echo importing ssh secret
29-
echo *-*-*-*-*-*-*-*-*-*-*-*
27+
setupssh() {
28+
echo importing ssh secret
29+
echo *-*-*-*-*-*-*-*-*-*-*-*
3030
chmod 400 ~/.ssh/id_rsa
3131
touch ~/.ssh/config
3232

3333
echo "Host github.com" >> $HOME/.ssh/config
3434
echo " IdentityFile $HOME/.ssh/id_rsa" >> $HOME/.ssh/config
3535
echo " StrictHostKeyChecking no" >> $HOME/.ssh/config
36-
37-
eval "$(ssh-agent -s)"
38-
ssh-add ~/.ssh/id_rsa
39-
ssh -T git@github.com | true
36+
37+
eval "$(ssh-agent -s)"
38+
ssh-add ~/.ssh/id_rsa
39+
ssh -T git@github.com | true
4040
}
41-
42-
function setupgit {
43-
echo setting git up
44-
echo *-*-*-*-*-*-*-*-*-*-*-*
41+
42+
setupgit() {
43+
echo setting git up
44+
echo *-*-*-*-*-*-*-*-*-*-*-*
4545
git remote set-url origin git@github.com:$TRAVIS_REPO_SLUG.git
46-
git config --global user.email "io.scalecube.ci@gmail.com"
46+
git config --global user.email "io.scalecube.ci@gmail.com"
4747
git config --global user.name "io-scalecube-ci"
48-
git checkout -B $TRAVIS_BRANCH | true
48+
git checkout -B $TRAVIS_BRANCH | true
4949
}
5050

51-
function deployment {
52-
if [ "$TRAVIS_PULL_REQUEST" == 'false' ] && [ "$TRAVIS_BRANCH" = 'master' ] || [ "$TRAVIS_BRANCH" = 'develop' ]; then
53-
echo deployment
54-
echo *-*-*-*-*-*-*-*-*-*-*-*
51+
deployment() {
52+
if [ "$TRAVIS_PULL_REQUEST" = 'false' -a "$TRAVIS_BRANCH" = 'master' -o "$TRAVIS_BRANCH" = 'develop' -o -n "$TRAVIS_TAG" ]; then
53+
echo deployment
54+
echo *-*-*-*-*-*-*-*-*-*-*-*
5555
decryptsecrets
5656
importpgp
5757
setupssh

src/main/scripts/cd/release.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ RELEASE_EXEC_FILES=$(find $DIRNAME -name 'release-*.sh')
66
echo Running $0
77
echo *-*-*-*-*-*-*-*-*-*-*-*-*-*
88

9+
. $DIRNAME/before-deploy.sh
10+
911
commit_to_develop() {
10-
git fetch
11-
git branch -r
12-
git checkout -B develop
13-
git rebase $TRAVIS_BRANCH
14-
git commit --amend -m "++++ Prepare for next development iteration build: $TRAVIS_BUILD_NUMBER ++++"
15-
git push origin develop
12+
git fetch
13+
git branch -r
14+
git checkout -B develop
15+
git rebase $TRAVIS_BRANCH
16+
git commit --amend -m "++++ Prepare for next development iteration build: $TRAVIS_BUILD_NUMBER ++++"
17+
git push origin develop
1618
}
1719

1820
check_next_version() {

0 commit comments

Comments
 (0)