diff --git a/db/src/scripts/generate_ddl.pl b/db/src/scripts/generate_ddl.pl index a977683e..07a9706c 100644 --- a/db/src/scripts/generate_ddl.pl +++ b/db/src/scripts/generate_ddl.pl @@ -165,6 +165,10 @@ =head1 HISTORY =over 4 +=item 2022-04-26 + +Solved bug for objects named like "name" where name is not totally upper case. + =item 2021-08-27 Create the file in the output directory only when it is different from the @@ -247,7 +251,6 @@ =head1 HISTORY use 5.016003; # Strawberry perl: 5.18.2, Jenkins server: 5.16.3 use Carp; -use Data::Dumper; use English; use File::Basename; use File::Compare; @@ -269,7 +272,7 @@ =head1 HISTORY # VARIABLES -my $VERSION = "2021-08-27"; +my $VERSION = "2022-04-26"; my $program = &basename($0); my $encoding = ''; # was :crlf:encoding(UTF-8) @@ -395,12 +398,14 @@ =head1 HISTORY sub remove_trailing_empty_lines ($); sub beautify_line ($$$$$$); sub split_single_output_file($); +sub get_object_seq ($); sub add_object_seq ($;$); sub read_object_seq (); sub error (@); sub warning (@); sub info (@); sub debug (@); +sub trace (@); # MAIN @@ -409,6 +414,10 @@ =head1 HISTORY # SUBROUTINES sub main () { + trace((caller(0))[3]); + + eval "use Data::Dumper; 1" or warn("Could not load Data::Dumper"); + info("\@ARGV: @ARGV"); process_command_line(); print_run_info(\*STDERR, 0); @@ -416,8 +425,9 @@ () process(); } -sub process_command_line () -{ +sub process_command_line () { + trace((caller(0))[3]); + # Windows FTYPE and ASSOC cause the command 'generate_ddl -h -c file' # to have ARGV[0] == ' -h -c file' and number of arguments 1. # Hence strip the spaces from $ARGV[0] and recreate @ARGV. @@ -457,6 +467,8 @@ () } sub process () { + trace((caller(0))[3]); + my $install_sql = ($skip_install_sql ? undef : File::Spec->catfile($output_directory, 'install.sql')); my $in; @@ -472,9 +484,9 @@ () # These files are not needed anymore since the directory contents are used to determine the object sequence for interface V5 unlink(File::Spec->catfile($output_directory, OLD_INSTALL_SEQUENCE_TXT), File::Spec->catfile($output_directory, NEW_INSTALL_SEQUENCE_TXT)); - + # always make the output directory - make_path($output_directory, { verbose => 0 }); + make_path($output_directory, { verbose => $verbose > 0 }); # turn autoflush on for both STDOUT and STDERR select(STDERR); @@ -516,7 +528,7 @@ () # read interface (first line with '-- ') # my $interface_expr = '^-- (' . PKG_DDL_UTIL_V4 . '|' . PKG_DDL_UTIL_V5 . ')$'; - + INTERFACE: while (defined(my $line = <$in>)) { print $fh $line @@ -533,7 +545,7 @@ () } $interface = '' unless defined($interface); - + error("Unknown interface: $interface") unless ( $interface eq PKG_DDL_UTIL_V4 || $interface eq PKG_DDL_UTIL_V5 ); @@ -589,7 +601,9 @@ () } } - debug(Data::Dumper->Dump([%sql_statements], [qw(sql_statements)])); + eval { + debug(Data::Dumper->Dump([%sql_statements], [qw(sql_statements)])); + }; all_sql_statements_flush($fh_install_sql, \$fh, \$nr_sql_statements, \%sql_statements); smart_close($fh) @@ -629,6 +643,8 @@ () } # process sub process_object_type ($$$$) { + trace((caller(0))[3]); + my ($object_type, $r_object_type_lines, $r_ddl_no, $r_sql_statements) = @_; debug("Process object type $object_type with $#$r_object_type_lines lines") if (defined($object_type)); @@ -702,6 +718,8 @@ ($$$$) } sub get_object_type_line ($$) { + trace((caller(0))[3]); + my ($object_type, $r_object_type_lines) = @_; # Remove a block like this: @@ -731,6 +749,8 @@ ($$) } sub parse_object($) { + trace((caller(0))[3]); + my ($owner, $name) = ($source_schema, @_); if ($name =~ qr/(?$id_expr)\s*\.\s*(?$id_expr)/) { @@ -748,6 +768,8 @@ ($) } sub get_object ($$$;$$$) { + trace((caller(0))[3]); + my ($object_schema, $object_type, $object_name, $base_object_schema, $base_object_type, $base_object_name) = @_; my $sep = ':'; @@ -781,6 +803,8 @@ ($$$;$$$) } sub object_file_name ($$$) { + trace((caller(0))[3]); + my ($object_schema, $object_type, $object_name) = @_; if (length($source_schema) > 0 && $object_schema !~ m/^(PUBLIC|$source_schema)$/) { @@ -802,13 +826,13 @@ ($$$) my $object_file_name; my $nr_zeros = ($interface eq PKG_DDL_UTIL_V4 ? 2 : 4); - if (!exists($object_seq{$object_seq_key})) { + if (!defined(get_object_seq($object_seq_key))) { add_object_seq($object_seq_key); } $object_file_name = uc(sprintf("%s%0${nr_zeros}d.%s%s.%s", ($object_type_info{$object_type}->{'repeatable'} ? 'R__' : ''), - ($interface eq PKG_DDL_UTIL_V4 ? $object_type_info{$object_type}->{'seq'} : $object_seq{$object_seq_key}), + ($interface eq PKG_DDL_UTIL_V4 ? $object_type_info{$object_type}->{'seq'} : get_object_seq($object_seq_key)), (${strip_source_schema} && $source_schema eq $object_schema ? '' : $object_schema . '.'), $object_type, $object_name)) . '.sql'; @@ -817,6 +841,8 @@ ($$$) } sub open_file ($$$$) { + trace((caller(0))[3]); + my ($file, $fh_install_sql, $r_fh, $ignore_warning_when_file_exists) = @_; if (defined $fh_install_sql && !$install_sql_preamble_printed) { @@ -845,6 +871,8 @@ ($$$$) } sub close_file ($$) { + trace((caller(0))[3]); + my ($file, $r_fh) = @_; # close before comparing/copying/removing @@ -858,6 +886,8 @@ ($$) # open file for writing sub smart_open ($;$) { + trace((caller(0))[3]); + my ($file, $append) = @_; my $basename = basename($file); my ($tmpfile, $fh) = (File::Spec->catfile($TMPDIR, $basename)); @@ -872,6 +902,8 @@ ($;$) } sub smart_close ($) { + trace((caller(0))[3]); + my $fh = shift @_; error("File handle unknown") @@ -901,6 +933,8 @@ ($) } sub add_sql_statement ($$$$;$) { + trace((caller(0))[3]); + my ($r_sql_line, $r_sql_statements, $object, $ddl_no, $ddl_info) = @_; debug("Adding '$$r_sql_line' for object $object and statement $ddl_no"); @@ -929,6 +963,8 @@ ($$$$;$) } sub sort_sql_statements ($$$) { + trace((caller(0))[3]); + my ($r_sql_statements, $a, $b) = @_; my $result; @@ -937,13 +973,16 @@ ($$$) $result = ($r_sql_statements->{$a}->{seq} <=> $r_sql_statements->{$b}->{seq}); } else { # $object_seq{$a} and $object_seq{$b} will exists do to call to add_object_seq() in add_sql_statement() - $result = ($object_seq{$a} <=> $object_seq{$b}); + debug(sprintf("get_object_seq('%s'); '%s'; get_object_seq('%s'): '%s'", $a, get_object_seq($a), $b, get_object_seq($b))); + $result = (get_object_seq($a) <=> get_object_seq($b)); } return $result; } sub sort_dependent_objects ($$$) { + trace((caller(0))[3]); + my ($object_type, $a, $b) = @_; if ($object_type eq 'OBJECT_GRANT') { @@ -959,6 +998,8 @@ ($$$) } sub all_sql_statements_flush ($$$$) { + trace((caller(0))[3]); + my ($fh_install_sql, $r_fh, $r_nr_sql_statements, $r_sql_statements) = @_; debug("Flushing all objects"); @@ -976,6 +1017,8 @@ ($$$$) } sub object_sql_statements_flush ($$$$$) { + trace((caller(0))[3]); + my ($fh_install_sql, $r_fh, $r_nr_sql_statements, $r_sql_statements, $object) = @_; my $ignore_warning_when_file_exists = 0; @@ -1084,6 +1127,8 @@ ($$$$$) } # object_sql_statements_flush sub sql_statement_flush ($$$$$$) { + trace((caller(0))[3]); + my ($fh, $r_nr_sql_statements, $r_sql_statement, $object, $ddl_no, $ddl_info) = @_; debug("Flushing statement for $object with ", scalar(@$r_sql_statement), " line(s)"); @@ -1308,6 +1353,8 @@ ($$$$$$) } sub print_run_info ($$) { + trace((caller(0))[3]); + my ($fh, $install) = @_; error("File handle must be defined") unless defined($fh); @@ -1324,12 +1371,16 @@ ($$) } sub remove_cr_lf ($) { + trace((caller(0))[3]); + my $r_line = $_[0]; $$r_line =~ s/\r?\n//mg; } sub remove_leading_empty_lines ($) { + trace((caller(0))[3]); + my $r_lines = $_[0]; REMOVE_LEADING_EMPTY_LINES: { @@ -1346,6 +1397,8 @@ ($) } sub remove_trailing_empty_lines ($) { + trace((caller(0))[3]); + my $r_lines = $_[0]; REMOVE_TRAILING_EMPTY_LINES: { @@ -1362,6 +1415,8 @@ ($) } sub beautify_line ($$$$$$) { + trace((caller(0))[3]); + my ($matched_object, $object_schema, $object_name, $object_type, $line_no, $r_line) = @_; return @@ -1411,6 +1466,8 @@ ($$$$$$) } sub split_single_output_file ($) { + trace((caller(0))[3]); + my $input_file = shift @_; # only one SQL statement allowed @@ -1444,14 +1501,34 @@ ($) unlink($input_file); } -sub add_object_seq ($;$) { +sub get_object_seq ($) { + trace((caller(0))[3]); + my ($object, $object_seq) = @_; + + $object = uc($object); + + error("Object '$object' must be in upper case") + unless $object eq uc($object); + + return exists($object_seq{$object}) ? $object_seq{$object} : undef; +} +sub add_object_seq ($;$) { + trace((caller(0))[3]); + + my ($object, $object_seq) = @_; + + $object = uc($object); + + error("Object '$object' must be in upper case") + unless $object eq uc($object); + error("Object '$object' should match 'SCHEMA:TYPE:NAME'") unless $object =~ m/^.+:.+:.+$/; - + error("Object sequence for '$object' already exists.") - if exists($object_seq{$object}); + if defined(get_object_seq($object)); if (defined($object_seq)) { # strip leading zeros otherwise it will be treated as an octal number @@ -1471,6 +1548,8 @@ ($;$) } sub read_object_seq () { + trace((caller(0))[3]); + my %objects; opendir my $dh, $output_directory or die "Could not open '$output_directory' for reading '$!'\n"; @@ -1505,3 +1584,8 @@ (@) print STDERR "DEBUG: @_\n" if ($verbose >= 2); } + +sub trace (@) { + carp "TRACE: @_\n" + if ($verbose >= 3); +} diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index fe75923a..4657a1f4 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -4,6 +4,10 @@ pipeline { options { skipDefaultCheckout() } + tools { + maven pipelineConfig.maven + jdk pipelineConfig.jdk + } stages { stage("dev") { steps { diff --git a/jenkins/libraries/maven/steps/process.groovy b/jenkins/libraries/maven/steps/process.groovy index ad0690ca..07b18bd2 100644 --- a/jenkins/libraries/maven/steps/process.groovy +++ b/jenkins/libraries/maven/steps/process.groovy @@ -12,10 +12,10 @@ void call(app_env){ assert pipelineConfig.conf_dir != null assert pipelineConfig.db_dir != null assert pipelineConfig.apex_dir != null - + env.SCM_BRANCH = app_env.scm_branch assert env.SCM_BRANCH != null - env.SCM_BRANCH_PREV = ( app_env.previous != null ? app_env.previous.scm_branch : '' ) + env.SCM_BRANCH_PREV = ( app_env.scm_branch_prev != null ? app_env.scm_branch_prev : ( app_env.previous != null ? app_env.previous.scm_branch : '' ) ) env.SCM_CREDENTIALS = ( app_env.scm_credentials != null ? app_env.scm_credentials : pipelineConfig.scm_credentials ) assert env.SCM_CREDENTIALS != null env.SCM_URL = ( app_env.scm_url != null ? app_env.scm_url : pipelineConfig.scm_url ) @@ -58,6 +58,14 @@ void call(app_env){ userRemoteConfigs: [[url: pipelineConfig.scm_url_oracle_tools]] ]) } + + script { + if (pipelineConfig.scm_url_config != null && pipelineConfig.scm_branch_config != null && pipelineConfig.scm_credentials_config != null) { + dir('config') { + git url: pipelineConfig.scm_url_config, branch: pipelineConfig.scm_branch_config, credentialsId: pipelineConfig.scm_credentials_config + } + } + } dir('myproject') { git branch: env.SCM_BRANCH, credentialsId: env.SCM_CREDENTIALS, url: env.SCM_URL @@ -67,76 +75,8 @@ void call(app_env){ findbugsPublisher(disabled: true), openTasksPublisher(disabled: true)]) { sshagent([env.SCM_CREDENTIALS]) { - sh(''' -pwd -unset JAVA_HOME -export GIT_SSH_COMMAND="ssh -oStrictHostKeyChecking=no" -git config user.name ${SCM_USERNAME} -git config user.email ${SCM_EMAIL} -if [ -n "$SCM_BRANCH_PREV" ] -then - git checkout "$SCM_BRANCH_PREV" - git checkout "$SCM_BRANCH" - git merge "$SCM_BRANCH_PREV" -fi - -db_config_dir=`cd ${CONF_DIR} && pwd` -oracle_tools_dir=$WORKSPACE/oracle-tools - -# First DB run -echo "processing DB actions ${DB_ACTIONS} in ${DB_DIR} with configuration directory $db_config_dir" -set -- ${DB_ACTIONS} -for profile; do mvn -f ${DB_DIR} -Doracle-tools.dir=$oracle_tools_dir -Ddb.config.dir=$db_config_dir -Ddb=${DB} -D$DB_USERNAME_PROPERTY=$DB_USERNAME -Ddb.password=$DB_PASSWORD -P$profile; done -if [ -n "`git status --porcelain`" ] -then - git add . - git commit -m"Database changes. Triggered Build: $BUILD_NUMBER" -fi -if [ "`git diff --stat --cached origin/${SCM_BRANCH} | wc -l`" -ne 0 ] -then - git push --set-upstream origin ${SCM_BRANCH} -fi - -# Second DB run: verify that there are no changes after a second round (just install and generate DDL) -DB_ACTIONS="db-install db-generate-ddl-full" -echo "checking that there are no changes after a second round of ${DB_ACTIONS} (standard output is suppressed)" -set -- ${DB_ACTIONS} -for profile; do mvn -f ${DB_DIR} -Doracle-tools.dir=$oracle_tools_dir -Ddb.config.dir=$db_config_dir -Ddb=${DB} -D$DB_USERNAME_PROPERTY=$DB_USERNAME -Ddb.password=$DB_PASSWORD -P$profile -l mvn-${profile}.log; done -echo "there should be no files to add for Git:" -test -z "`git status --porcelain`" - -echo "processing APEX actions ${APEX_ACTIONS} in ${APEX_DIR} with configuration directory $db_config_dir" -set -- ${APEX_ACTIONS} -for profile; do mvn -f ${APEX_DIR} -Doracle-tools.dir=$oracle_tools_dir -Ddb.config.dir=$db_config_dir -Ddb=${DB} -D$DB_USERNAME_PROPERTY=$DB_USERNAME -Ddb.password=$DB_PASSWORD -P$profile; done - -# ${APEX_DIR}/src/export/application/create_application.sql changes its p_flow_version so use git diff --compact-summary to verify it is just that file and that line -# -# % git diff --compact-summary -# apex/app/src/export/application/create_application.sql | 2 +- -# 1 file changed, 1 insertion(+), 1 deletion(-) - -create_application=${APEX_DIR}/src/export/application/create_application.sql -# Use a little bit of awk to check that the file and its changes are matched and that the total number of lines is just 2 -result="`git diff --compact-summary | awk -f $oracle_tools_dir/jenkins/only_create_application_changed.awk`" -if [ "$result" = "YES" ] -then - git update-index --assume-unchanged $create_application - workspace_changed="`git status --porcelain`" - git update-index --no-assume-unchanged $create_application -else - workspace_changed="`git status --porcelain`" -fi - -if [ -n "$workspace_changed" ] -then - git add . - git commit -m"APEX changes. Triggered Build: $BUILD_NUMBER" -fi -if [ "`git diff --stat --cached origin/${SCM_BRANCH} | wc -l`" -ne 0 ] -then - git push --set-upstream origin ${SCM_BRANCH} -fi - ''') + sh('chmod +x $WORKSPACE/oracle-tools/jenkins/process.sh') + sh('$WORKSPACE/oracle-tools/jenkins/process.sh') } } } diff --git a/jenkins/only_create_application_changed.awk b/jenkins/only_create_application_changed.awk index c9ebbd89..17cce8a8 100644 --- a/jenkins/only_create_application_changed.awk +++ b/jenkins/only_create_application_changed.awk @@ -1,3 +1,10 @@ -/create_application\.sql/,/1 file changed, 1 insertion\(+\), 1 deletion\(-\)/ { ++m } +# % git diff --stat +# apex/app/src/export/application/create_application.sql | 2 +- +# 1 file changed, 1 insertion(+), 1 deletion(-) + +# count the number of lines with create_application.sql where there are two changes: one insertion and one deletion +/create_application\.sql[ \t\r\n]+\|[ \t\r\n]+2[ \t\r\n]+\+-$/ { ++m } +# count all lines including the last line with totals { ++n } -END { if ( n == 2 && m == 2 ) { print "YES" } else { print "NO" } } +# If only create_application.sql has changed with one insertion and one deletion print YES, else NO. +END { if ( m >= 1 && m == n - 1 ) { print "YES" } else { print "NO" } } diff --git a/jenkins/pipeline_config.groovy b/jenkins/pipeline_config.groovy index 45ac1190..6b9ac91b 100644 --- a/jenkins/pipeline_config.groovy +++ b/jenkins/pipeline_config.groovy @@ -1,8 +1,19 @@ // accessible via JTEs pipelineConfig maven = 'maven-3' -scm_branch_oracle_tools = 'development' +jdk = 'jdk-9' + // a clone without credentials scm_url_oracle_tools = 'http://github.com/paulissoft/oracle-tools.git' +scm_branch_oracle_tools = 'development' + +scm_url = 'git@github.com:paulissoft/oracle-tools.git' +scm_credentials = 'paulissoft' +scm_username = 'paulissoft' +scm_email = 'paulissoft@gmail.com' + +conf_dir = 'conf/src' +db_dir = 'db/app' +apex_dir = 'apex/app' libraries{ // merge = true @@ -13,37 +24,21 @@ application_environments{ dev{ // Oracle tools info scm_branch = 'development' - scm_credentials = 'paulissoft' - scm_url = 'git@github.com:paulissoft/oracle-tools.git' - scm_username = 'paulissoft' - scm_email = 'paulissoft@gmail.com' - - conf_dir = 'conf/src' db = 'docker' db_credentials = 'oracle-tools-development' - db_dir = 'db/app' db_actions = 'db-info db-install db-generate-ddl-full' - apex_dir = 'apex/app' apex_actions = 'apex-export' } test{ // Oracle tools info scm_branch = 'test' - scm_credentials = 'paulissoft' - scm_url = 'git@github.com:paulissoft/oracle-tools.git' - scm_username = 'paulissoft' - scm_email = 'paulissoft@gmail.com' - - conf_dir = 'conf/src' db = 'docker' db_credentials = 'oracle-tools-development' - db_dir = 'db/app' db_actions = 'db-info db-install db-generate-ddl-full' - apex_dir = 'apex/app' apex_actions = 'apex-import' } } diff --git a/jenkins/process.sh b/jenkins/process.sh new file mode 100644 index 00000000..b6009485 --- /dev/null +++ b/jenkins/process.sh @@ -0,0 +1,93 @@ +#!/bin/sh -xeu + +process_git() +{ + description=$1 + + workspace_changes="`git status --porcelain`" + + echo "workspace changes: ${workspace_changes}" + + if [ -n "$workspace_changes" ] + then + git add --all . + git commit -m"${description}. Triggered Build: $BUILD_NUMBER" + fi + if [ "`git diff --stat --cached origin/${SCM_BRANCH} | wc -l`" -ne 0 ] + then + git push --set-upstream origin ${SCM_BRANCH} + fi +} + +# Script to be invoked from a Jenkins build. +# Environment variables must be set otherwise an error occurs (-eu above). + +oracle_tools_dir="`dirname $0`/.." + +# checking environment +pwd +git --version + +export GIT_SSH_COMMAND="ssh -oStrictHostKeyChecking=no" +git config user.name ${SCM_USERNAME} +git config user.email ${SCM_EMAIL} + +set +eu # come variables may be unset + +if [ -n "$SCM_BRANCH_PREV" -a "$SCM_BRANCH_PREV" != "$SCM_BRANCH" ] +then + git checkout "$SCM_BRANCH_PREV" + git checkout "$SCM_BRANCH" + git merge "$SCM_BRANCH_PREV" +fi + +test -n "$DB_ACTIONS" || export DB_ACTIONS="" +test -n "$APEX_ACTIONS" || export APEX_ACTIONS="" + +set -xeu + +db_config_dir=`cd ${CONF_DIR} && pwd` + +# First DB run +echo "processing DB actions ${DB_ACTIONS} in ${DB_DIR} with configuration directory $db_config_dir" +set -- ${DB_ACTIONS} +for profile; do mvn -f ${DB_DIR} -Doracle-tools.dir=$oracle_tools_dir -Ddb.config.dir=$db_config_dir -Ddb=${DB} -D$DB_USERNAME_PROPERTY=$DB_USERNAME -Ddb.password=$DB_PASSWORD -P$profile; done +process_git "Database changes" + +# Both db-install and db-generate-ddl-full part of DB_ACTIONS? +# If so, a second run should change nothing +if echo $DB_ACTIONS | grep db-install && echo $DB_ACTIONS | grep db-generate-ddl-full +then + # Second DB run: verify that there are no changes after a second round (just install and generate DDL) + DB_ACTIONS="db-install db-generate-ddl-full" + echo "checking that there are no changes after a second round of ${DB_ACTIONS} (standard output is suppressed)" + set -- ${DB_ACTIONS} + for profile; do mvn -f ${DB_DIR} -Doracle-tools.dir=$oracle_tools_dir -Ddb.config.dir=$db_config_dir -Ddb=${DB} -D$DB_USERNAME_PROPERTY=$DB_USERNAME -Ddb.password=$DB_PASSWORD -P$profile -l mvn-${profile}.log; rm mvn-${profile}.log; done + echo "there should be no files to add for Git:" + test -z "`git status --porcelain`" +fi + +echo "processing APEX actions ${APEX_ACTIONS} in ${APEX_DIR} with configuration directory $db_config_dir" +set -- ${APEX_ACTIONS} +for profile; do mvn -f ${APEX_DIR} -Doracle-tools.dir=$oracle_tools_dir -Ddb.config.dir=$db_config_dir -Ddb=${DB} -D$DB_USERNAME_PROPERTY=$DB_USERNAME -Ddb.password=$DB_PASSWORD -P$profile; done + +# ${APEX_DIR}/src/export/application/create_application.sql changes its p_flow_version so use git diff --stat to verify it is just that file and that line +# +# % git diff --stat +# apex/app/src/export/application/create_application.sql | 2 +- +# 1 file changed, 1 insertion(+), 1 deletion(-) + +# Check if only create_application.sql files have changed their p_flow_version. +result="`git diff --stat -- ${APEX_DIR} | awk -f $oracle_tools_dir/jenkins/only_create_application_changed.awk`" +if [ "$result" = "YES" ] +then + # 1) Retrieve all create_application.sql files that have changed only in two places (one insertion, one deletion) + # 2) Restore them since the change is due to the version date change + # 3) This prohibits a git commit when the APEX export has not changed really + for create_application in "`git diff --stat -- ${APEX_DIR} | grep -E '\bcreate_application\.sql\s+\|\s+2\s+\+-$' | cut -d '|' -f 1`" + do + git checkout -- $create_application + done +fi + +process_git "APEX changes" diff --git a/jenkins/setup.sh b/jenkins/setup.sh index 3fc9f8ea..2a2629f7 100755 --- a/jenkins/setup.sh +++ b/jenkins/setup.sh @@ -83,7 +83,13 @@ EOF ;; 5) docker container exec -it $jenkins_name /bin/sh -c 'test -f /var/jenkins_home/.ssh/id_rsa || ssh-keygen -t rsa -f /var/jenkins_home/.ssh/id_rsa' # generate SSH keys ;; - 6) nohup open http://localhost:8080 1>/dev/null 2>&1 & + 6) url='http://localhost:8080' + if which open 1>/dev/null + then + nohup open $url 1>/dev/null 2>&1 & + else + echo "Please open $url in your browser." + fi ;; # TBD: setting up SSH agent later 7) docker container exec -it $jenkins_name /bin/sh -c 'test -f /var/jenkins_home/.ssh/jenkins_agent_key || ssh-keygen -t rsa -f /var/jenkins_home/.ssh/jenkins_agent_key' # generate SSH keys