{"id":1629,"date":"2024-03-05T20:52:29","date_gmt":"2024-03-05T19:52:29","guid":{"rendered":"https:\/\/chaoyu.nl\/?p=1629"},"modified":"2024-03-11T21:44:28","modified_gmt":"2024-03-11T20:44:28","slug":"bitbucket-pipelines","status":"publish","type":"post","link":"https:\/\/chaoyu.nl\/?p=1629","title":{"rendered":"Use BitBucket Pipelines to Automate Oracle APEX deployment"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li style=\"font-size:25px\"><a href=\"#BRANCH\" data-type=\"internal\" data-id=\"#BRANCH\">branching strategy<\/a><\/li>\n\n\n\n<li style=\"font-size:25px\"><a href=\"#RUNNER\" data-type=\"internal\" data-id=\"#RUNNER\">bitbucket Runners<\/a><\/li>\n\n\n\n<li style=\"font-size:25px\"><a href=\"#YMALFILE\" data-type=\"internal\" data-id=\"#YMALFILE\">pipeline yaml file<\/a><\/li>\n\n\n\n<li style=\"font-size:25px\"><a href=\"#FLYWAY\" data-type=\"internal\" data-id=\"#FLYWAY\">flyway<\/a><\/li>\n\n\n\n<li style=\"font-size:25px\"><a href=\"#SQLCL\" data-type=\"internal\" data-id=\"#SQLCL\">sqlcl<\/a><\/li>\n\n\n\n<li style=\"font-size:25px\"><a href=\"#RSYNC\" data-type=\"internal\" data-id=\"#RSYNC\">rsync<\/a><\/li>\n\n\n\n<li style=\"font-size:25px\"><a href=\"#DBAPEXIMAGE\" data-type=\"internal\" data-id=\"#DBAPEXIMAGE\">oracel db + apex in container<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BRANCH\"><strong>Branch Strategy<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac1122b450d0&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac1122b450d0\" class=\"wp-block-image size-full is-style-default wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1176\" height=\"764\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-22.44.51.png\" alt=\"\" class=\"wp-image-1651\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-22.44.51.png 1176w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-22.44.51-300x195.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-22.44.51-1024x665.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-22.44.51-768x499.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-22.44.51-850x552.png 850w\" sizes=\"auto, (max-width: 1176px) 100vw, 1176px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"RUNNER\"><strong>Runners<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ul class=\"wp-block-list\">\n<li>configure your on primise running (<a href=\"https:\/\/support.atlassian.com\/bitbucket-cloud\/docs\/adding-a-new-runner-in-bitbucket\/\" data-type=\"link\" data-id=\"https:\/\/support.atlassian.com\/bitbucket-cloud\/docs\/adding-a-new-runner-in-bitbucket\/\">follow the guide from bitbucket<\/a>)\n<ul class=\"wp-block-list\">\n<li><strong>it entire process takes 2 mins or less<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>make sure all necessary ports are openning <\/li>\n\n\n\n<li>when all are set up correctly, you should see the status &#8220;online&#8221;<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-cover is-light has-black-color has-text-color has-link-color has-x-large-font-size wp-elements-1\" style=\"min-height:464px;aspect-ratio:unset;\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim-0 has-background-dim\"><\/span><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"406\" class=\"wp-block-cover__image-background wp-image-1635\" alt=\"\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16-1024x406.png\" style=\"object-position:0% 47%\" data-object-fit=\"cover\" data-object-position=\"0% 47%\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16-1024x406.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16-300x119.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16-768x305.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16-1536x609.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16-850x337.png 850w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.16.16.png 1780w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-medium-font-size wp-block-paragraph\">Portainer Container List<\/p>\n<\/div><\/div>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac1122b46288&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac1122b46288\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"949\" height=\"175\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.13.18.png\" alt=\"\" class=\"wp-image-1632\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.13.18.png 949w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.13.18-300x55.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.13.18-768x142.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-05-at-23.13.18-850x157.png 850w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Runner Status in bitbucket<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Create bitbucket-pipelines.yml<\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">here is an example of a feature branch and with explainations.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>this pipeline snippt will do a spin up a docker container (XE 21, APEX 23.1 and ORDs are in this container)<\/li>\n\n\n\n<li>after container is ready ( ORDs is ready)<\/li>\n\n\n\n<li>we can then connect the database and install db objects + apex application<\/li>\n\n\n\n<li>copy static files to server<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"836\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-11-at-21.43.41-1024x836.png\" alt=\"\" class=\"wp-image-1718\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-11-at-21.43.41-1024x836.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-11-at-21.43.41-300x245.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-11-at-21.43.41-768x627.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-11-at-21.43.41-850x694.png 850w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-11-at-21.43.41.png 1178w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml line-numbers\">    feature\/*:\n      - step:\n          name: (commit) start docker container on host machine 2\n          runs-on:\n            - self.hosted  \n          script:\n            - echo \"find running container with this image stop it &amp;&amp; remove it\"\n            - ssh -o StrictHostKeyChecking=no chaoyuim@192.168.178.70 '.\/my_custom_scripts\/cleanup_container.sh chaoyuim\/img_db21_apex23:1.0.0'\n\n            #- ssh -o StrictHostKeyChecking=no chaoyuim@192.168.178.70 'docker network rm database_network_1521 &amp;&amp; docker network create database_network_1521'\n            #- ssh -o StrictHostKeyChecking=no chaoyuim@192.168.178.70 '.\/my_custom_scripts\/add_containers_to_network.sh chaoyuim\/oracle_host:2.0.0'\n\n            - echo \"done cleaning........... ready to start new container ........\"\n            - ssh -o StrictHostKeyChecking=no chaoyuim@192.168.178.70 'docker run --network database_network_1521 --name db21_apex23_test_docker -d -p 8822:8080 -p 1521:1521 chaoyuim\/img_db21_apex23:1.0.0'\n\n            - echo \"write a function to get localhost:8822, release control only after httpcode 302 ( it runs 60 x 5 seconds) it stops earlier if 302 is received.\"    \n            - ssh -o StrictHostKeyChecking=no chaoyuim@192.168.178.70 '.\/my_custom_scripts\/http_request.sh localhost:8822 60'\n\n            - echo \"Database + ORDs is alive, do you thing , db is at port 1521 , apex at port 8822\"\n\n      - step:    \n          name: Feature test build on commit \n          runs-on:\n            - self.hosted              \n          script:\n            - chmod +x .\/00-generic\/01-scripts\/change_file_ext_to_sql.sh\n            - chmod +x .\/00-generic\/01-scripts\/check_invalids.sh\n            - chmod +x .\/00-generic\/01-scripts\/install_app.sh\n            - chmod +x .\/00-generic\/01-scripts\/kill_ssh_tunnel.sh\n            - echo \"build anytime a commit is done to a branch prefixed with feature\" \n            - echo $BITBUCKET_BRANCH  \n            - cat ~\/.ssh\/id_rsa.pub\n            - sleep 2\n            - echo \"sleep done\"  \n            - ssh -o StrictHostKeyChecking=no -L 3306:192.168.178.70:1521 chaoyuim@&lt;server_public_id> -fN\n            # after the ssh tunnel , i can connect to the db to install db ojects + apex\n            - sql sys\/Apex_12345@localhost:3306\/XEPDB1 as sysdba\n            # here , we copy files to static file server using rsync\n            - yum install rsync -y\n            - rsync -avruz -e \"ssh -o StrictHostKeyChecking=no\" --delete .\/03-docroot\/* opc@&lt;server_public_id>:\/home\/opc\/docker\n            - pkill -f \"ssh -L\" || true\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Tagging in pipeline<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml line-numbers\">pipelines:\n  default:\n    - step:\n        script:\n        - echo \"Made a change in build ${BITBUCKET_BUILD_NUMBER}\" >> changes.txt\n        - git add changes.txt\n        - git commit -m \"Updating changes.txt with latest build number.\"\n        - git tag -am \"Tagging for release ${BITBUCKET_BUILD_NUMBER}\" release-${BITBUCKET_BUILD_NUMBER}\n        - git push origin release-${BITBUCKET_BUILD_NUMBER}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>you should chose to create pipeline variables for sensitive data like pwd and username\n<ul class=\"wp-block-list\">\n<li>use it like <code>$CONTAINER_REGISTRY_USERNAME<\/code> online 3 and 4<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>I have created a custom docker image with JAVA, sqlcl, sqlplus , git  when they are required to perform task like check out branch , connect to database and rsync static files to file server<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"FLYWAY\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\"><a href=\"https:\/\/documentation.red-gate.com\/flyway\/quickstart-how-flyway-works\" data-type=\"link\" data-id=\"https:\/\/documentation.red-gate.com\/flyway\/quickstart-how-flyway-works\">How flyway works?<\/a><\/mark><\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>to make sure flyways works we need to change or database artifacts into .sql extension\n<ul class=\"wp-block-list\">\n<li>a quick chatgpt can fix it , it scans all child folders and change the extension<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">#!\/bin\/bash\n\n# Check if the correct number of arguments is provided\nif [ $# -ne 1 ]; then\n    echo \"Usage: $0 &lt;folder_path&gt;\"\n    exit 1\nfi\n\nfolder_path=$1\n\n# Check if the provided folder exists\nif [ ! -d \"$folder_path\" ]; then\n    echo \"Error: Folder '$folder_path' does not exist.\"\n    exit 1\nfi\n\n# Loop through all the files in the folder\nfind \"$folder_path\" -type f -exec sh -c '\n    for file do\n        if [ -f \"$file\" ]; then\n            # Check if the file extension is \".gitkeep\"\n            if [[ \"${file##*.}\" == \"gitkeep\" ]]; then\n                echo \"Skipping .gitkeep file: $file\"\n            else\n                # Change the file extension to \".sql\"\n                new_filename=\"${file%.*}.sql\"\n\n                # Check if the new filename already exists\n                if [ -e \"$new_filename\" ]; then\n                    echo \"Warning: File '$new_filename' already exists. Skipping '$file'.\"\n                else\n                    # Rename the file\n                    mv \"$file\" \"$new_filename\"\n                    echo \"Renamed: $file -&gt; $new_filename\"\n                fi\n            fi\n        fi\n    done' sh {} +\n\necho \"File extension change completed.\"\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>after all files are changed to .sql use flyway cli to issue a migrate<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml line-numbers\">## this is snippet from yaml file\n\n- flyway -url=jdbc:oracle:thin:@$SERVICE_NAME -user=$DB_USER -password=$DB_PWD -locations=filesystem:.\/YOU_FILE_LOACTION  migrate\n\n#flyway will scan and execute .sql files in sub folders as well automatically<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"SQLCL\"><strong><a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/apex\/22.1\/aeadm\/exporting-one-or-more-applications.html#GUID-EC03A6A5-9C99-491F-9EFA-A00AAA1E8F9F\" data-type=\"link\" data-id=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/apex\/22.1\/aeadm\/exporting-one-or-more-applications.html#GUID-EC03A6A5-9C99-491F-9EFA-A00AAA1E8F9F\">SQLcl to export \/ install APEX applications<\/a><\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\"># use sqlcl to log into your apex parsing schema to do export\n\nsql&gt; apex export -applicationid 1234 -split<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-verse has-luminous-vivid-amber-background-color has-background\" style=\"font-style:normal;font-weight:100\">To be able to install an exported application, the apex parsing schema need to have such role \"<strong>APEX_ADMINISTRATOR_ROLE<\/strong>\"  <\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\"># to install \n\nsql $DB_USER\/$DB_PWD@$DB_SERVICE_NAME .\/LOCATION_TO_YOUR\/install.sql\n<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"606\" height=\"489\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-23.16.28.png\" alt=\"\" class=\"wp-image-1666\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-23.16.28.png 606w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-23.16.28-300x242.png 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image is-style-default\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac1122b46e7f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac1122b46e7f\" class=\"aligncenter size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"268\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-23.14.21.png\" alt=\"\" class=\"wp-image-1665\" style=\"width:645px;height:auto\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-23.14.21.png 620w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-07-at-23.14.21-300x130.png 300w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<!--more YAML Example-->\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"YMALFILE\"><strong>YAML Examples<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml line-numbers\">\nimage:\n  name: chaoyuim\/oracle_host:2.0.0\n  username: $CONTAINER_REGISTRY_USERNAME\n  password: $CONTAINER_REGISTRY_PASSWORD\n\npipelines:\n  branches:\n    develop:\n      - step:\n          name: Build develop on commit\n          runs-on:\n            - self.hosted          \n          script:\n            - echo \"build anytime a commit is done to develop\"\n            - cd $BITBUCKET_CLONE_DIR\n            - echo \"current dir $(pwd)\"\n            - git fetch \n            - git checkout $BITBUCKET_BRANCH\n            - git pull \n            - ls -a\n            - flyway --help\n    feature\/*:\n      - step:\n          name: Feature build on commit\n          runs-on:\n            - self.hosted              \n          script:\n            - echo \"build anytime a commit is done to a branch prefixed with feature\"            \n  pull-requests:\n    test:\n      - step:\n          name: test build on PR\n          runs-on:\n            - self.hosted              \n          script:\n            - echo \"test, this is a step will run each time a pull request is done to test\" \n    develop:\n      - step:\n          name: develop build PR\n          runs-on:\n            - self.hosted              \n          script:\n            - echo \"develop, this is a step will run each time a pull request is done to develop\"\n    feature\/*:\n      - step:\n          name: Build for feature branch pull request (overlaps with PR dev?)\n          runs-on:\n            - self.hosted              \n          script:\n            - echo \"Hello, feature branch PR!\"            \n  default:\n    - step:\n        name: this runs on each commits on any branch\n        runs-on:\n          - self.hosted            \n        script:\n          - echo \"Hello, World!\"<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"RSYNC\"><strong>Rsync to send static files to file server<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ul class=\"wp-block-list\">\n<li>store customs images public key on to your file server <code><strong>\/.ssh\/authorized_keys<\/strong> <\/code><\/li>\n\n\n\n<li>install nginx on the static file server, configure ports open 22, 80 and 443<\/li>\n\n\n\n<li>create sub folders in html doc root , e.g .\/dev .\/test &#8230; <\/li>\n\n\n\n<li>change permission or change owner of these folders to your user will do rsync <\/li>\n\n\n\n<li>do rsync <\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml line-numbers\">## this is yaml file \n- rsync -avruz -e \"ssh -o StrictHostKeyChecking=no\" --delete .\/03-docroot\/* opc@141.144.195.253:\/home\/opc\/dev<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"DBAPEXIMAGE\"><strong>Create DB + APEX images<\/strong><\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download Oracle Database XE .rpm file<\/li>\n\n\n\n<li>Download Oracle APEX .zip file<\/li>\n\n\n\n<li>create first Dockerfile and build it as base image so that we can install it<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"docker\" class=\"language-docker line-numbers\">FROM oraclelinux:7-slim\n\nUSER root\nRUN cd\nWORKDIR .\n\nENV ORACLE_DOCKER_INSTALL=true\nRUN yum -y install oracle-database-preinstall-21c\nhttps:\/\/download.oracle.com\/otn-pub\/otn_software\/db-express\/oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm\n\nCOPY .\/*.zip .\/\nCOPY .\/*.rpm .\/\nCOPY .\/install_db.sh .\/<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create a container with this image<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>APEX installation Guide<\/strong> (sqlplus)<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>install APEX<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">sql&gt; alter session set container=XEPDB1;\nsql&gt; @apexins.sql SYSAUX SYSAUX TEMP \/i\/ \nsql&gt; quit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Set WorkSpace Admin account (only needed on fresh installs)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">sql&gt; alter session set container=XEPDB1;\nsql&gt; @apxchpwd.sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. set user APEX_PUBLIC_USER<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">sql&gt; alter session set container=XEPDB1;\nsql&gt; ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;\nsql&gt; ALTER USER APEX_PUBLIC_USER IDENTIFIED BY YOUR_PWD;\nsql&gt; quit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Branch Strategy Runners Create bitbucket-pipelines.yml here is an example of a feature branch and with explainations. Tagging in pipeline How flyway works? SQLcl to export \/ install APEX applications To be able to install an exported application, the apex parsing schema need to have such role &#8220;APEX_ADMINISTRATOR_ROLE&#8221;<\/p>\n","protected":false},"author":1,"featured_media":1675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,54,17],"tags":[],"class_list":["post-1629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apex","category-docker","category-linux"],"_links":{"self":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1629"}],"version-history":[{"count":67,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1629\/revisions"}],"predecessor-version":[{"id":1719,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1629\/revisions\/1719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/media\/1675"}],"wp:attachment":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}