Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e14739e

Browse files
authored
Merge pull request #248 from jgebal/feature/update_release_process
Update of the release process to make it update version of project files
2 parents b56d051 + f8b09c5 commit e14739e

21 files changed

Lines changed: 131 additions & 68 deletions

.gitattributes

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
1-
.gitattributes export-ignore
2-
.gitignore export-ignore
3-
.gitmodules export-ignore
4-
.travis.yml export-ignore
5-
mkdocs.yml export-ignore
6-
.travis export-ignore
7-
sonar-project.properties export-ignore
8-
^tests/* export-ignore
9-
^development/* export-ignore
10-
^docs/* linguist-documentation
1+
* export-ignore
2+
^docs/* linguist-documentation

.gitattributes.release

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.gitmodules export-ignore
4+
.travis.yml export-ignore
5+
mkdocs.yml export-ignore
6+
.travis export-ignore
7+
sonar-project.properties export-ignore
8+
tests export-ignore
9+
development export-ignore
10+
node_modules export-ignore
11+
^docs/* linguist-documentation

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ pages/
1010
release/
1111
*.gz
1212
*.zip
13+
node_modules/

.travis.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ env:
2525
- UT3_USER=ut3_user
2626
- UT3_USER_PASSWORD=ut3
2727
- UT3_TABLESPACE=users
28+
# Environment for building a release
29+
- CURRENT_BRANCH=${TRAVIS_BRANCH}
30+
- UTPLSQL_REPO="utPLSQL/utPLSQL"
31+
- UTPLSQL_BUILD_NO="${TRAVIS_BUILD_NUMBER:-0}"
32+
- UTPLSQL_VERSION_PLACEHOLDER='utPLSQL - Version'
33+
- UTPLSQL_VERSION=$(. .travis/get_project_version.sh)
34+
- UTPLSQL_BUILD_VERSION=$(. .travis/get_project_build_version.sh)
35+
- UTPLSQL_SOURCES_DIR='source'
36+
- UTPLSQL_BUILD_USER_NAME="Travis CI"
2837
# Target Branch and Directory for Deployment of Docs
2938
- PAGES_TARGET_BRANCH="gh-pages"
3039
- PAGES_VERSION_BASE="version3"
@@ -48,27 +57,39 @@ install:
4857
- bash .travis/install_sqlcl.sh
4958
- sudo mkdir -p /dev/pdbs
5059
- sudo chmod -R 777 /dev/pdbs
51-
- bash .travis/start_db.sh
60+
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/start_db.sh; fi
61+
62+
before_script:
63+
#The update_project_version is done before deployment to validate that the change of project files does not break installation
64+
- bash .travis/update_project_version.sh
65+
- git config --global user.email "[email protected]"
66+
- git config --global user.name "${UTPLSQL_BUILD_USER_NAME}"
67+
- git remote rm origin
68+
- git remote add origin https://${github_api_token}@github.com/${UTPLSQL_REPO}
5269

5370
script:
54-
- bash .travis/install.sh
55-
- bash .travis/run_examples_and_tests.sh
56-
# - bash .travis/run_test_as_user.sh
57-
# - bash .travis/build_docs.sh
58-
# - bash .travis/push_docs_to_gh_pages.sh
59-
- sonar-scanner
60-
- bash .travis/coveralls_uploader.sh
71+
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi
72+
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples_and_tests.sh; fi
73+
- if [ "${TRAVIS_TAG}" = "" ]; then sonar-scanner; fi
74+
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi
75+
- bash .travis/build_docs.sh
76+
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/push_release_version.sh; fi
77+
78+
before_deploy:
79+
- bash .travis/build_release_archive.sh
6180

6281
deploy:
6382
provider: releases
6483
api_key: $github_api_token
6584
file:
66-
- utPLSQL$TRAVIS_TAG.zip
67-
- utPLSQL$TRAVIS_TAG.tar.gz
85+
- utPLSQL${UTPLSQL_BUILD_VERSION}.zip
86+
- utPLSQL${UTPLSQL_BUILD_VERSION}.tar.gz
6887
skip_cleanup: true
6988
on:
70-
repo: utPLSQL/utPLSQL
89+
repo: ${UTPLSQL_REPO}
7190
tags: true
91+
# when building from a release tag, use only first job "#xxx.1" to publish artifacts
92+
condition: "${TRAVIS_JOB_NUMBER} =~ \\.1$"
7293

7394
notifications:
7495
slack: utplsql:oiMuXO95TvKeAUENuDt4cPrB

.travis/build_release_archive.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
mv -f .gitattributes.release .gitattributes
4+
git add .
5+
git commit -m "tmp commit for building a release archive"
6+
7+
git archive --prefix="utPLSQL${UTPLSQL_BUILD_VERSION}"/ -o "utPLSQL${UTPLSQL_BUILD_VERSION}".zip --format=zip HEAD
8+
git archive --prefix="utPLSQL${UTPLSQL_BUILD_VERSION}"/ -o "utPLSQL${UTPLSQL_BUILD_VERSION}".tar.gz --format=tar.gz HEAD
9+
10+

.travis/create_release.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

.travis/create_release_archive.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
echo `sed -r "s/(v?[0-9]+\.)([0-9]+\.)([0-9]+)(-.*)/\1\2\3\.${UTPLSQL_BUILD_NO}\4/" <<< "${UTPLSQL_VERSION}"`

.travis/get_project_version.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
#If building a new version from a release branch - then version is taken from release branch name
3+
if [[ "${CURRENT_BRANCH}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
4+
version=${CURRENT_BRANCH#release\/}
5+
elif [[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
6+
version=${TRAVIS_TAG}
7+
else
8+
version=`cat VERSION`
9+
fi
10+
echo ${version}

.travis/install_libraries.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)