This page (revision-14) was last changed on 23-Apr-2022 17:06 by Harry Metske

This page was created on 23-Apr-2022 17:06 by Harry Metske

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
14 23-Apr-2022 17:06 15 KB Harry Metske to previous
13 23-Apr-2022 17:06 15 KB Harry Metske to previous | to last
12 23-Apr-2022 17:06 15 KB Harry Metske to previous | to last
11 23-Apr-2022 17:06 15 KB Harry Metske to previous | to last
10 23-Apr-2022 17:06 14 KB Harry Metske to previous | to last
9 23-Apr-2022 17:06 13 KB Harry Metske to previous | to last
8 23-Apr-2022 17:06 11 KB Harry Metske to previous | to last
7 23-Apr-2022 17:06 9 KB Harry Metske to previous | to last
6 23-Apr-2022 17:06 8 KB Harry Metske to previous | to last
5 23-Apr-2022 17:06 7 KB Harry Metske to previous | to last
4 23-Apr-2022 17:06 7 KB Harry Metske to previous | to last
3 23-Apr-2022 17:06 2 KB Harry Metske to previous | to last
2 23-Apr-2022 17:06 1 KB Harry Metske to previous | to last
1 23-Apr-2022 17:06 670 bytes Harry Metske to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 3 added one line
[{TableOfContents}]
At line 71 changed one line
! Download oc/rhc cli
!! Download oc/rhc cli
At line 231 added one line
!! Developing
At line 233 added 57 lines
Our source code has been copied from the github repo to an internal RedHat repo. The overview page tells use what this RedHat git repo is: __ssh://583f185e2d5271b8c6000069@diy-computerhok.rhcloud.com/~/git/diy.git/__ . %%warning I don't see an option for an https URL %%
So we (locally) add this remote repo : {{git remote add openshift ssh://583f185e2d5271b8c6000069@diy-computerhok.rhcloud.com/~/git/diy.git/}}.
We also have to provide special [Action hooks|https://developers.openshift.com/managing-your-applications/action-hooks.html] because we have to specify how to start our application, and we have to specify the port to listen on (the latter can be solved better/differently I think).
So created 2 additional scripts in our git repo:
* .openshift/action_hooks/deploy
* .openshift/action_hooks/start
Containing:
__deploy__
%%prettify
{{{
#!/bin/bash
cd $OPENSHIFT_REPO_DIR
sed -i 's/@OPENSHIFT_DIY_IP@/'"$OPENSHIFT_DIY_IP"'/g' src/main/resources/demoapp1.openshift.yaml
sed -i 's/@OPENSHIFT_DIY_PORT@/'"$OPENSHIFT_DIY_PORT"'/g' src/main/resources/demoapp1.openshift.yaml
}}}
%%
__start__
%%prettify
{{{
#!/bin/bash
cd $OPENSHIFT_REPO_DIR
export DROPWIZARD_YAML=src/main/resources/demoapp1.openshift.yaml
nohup java -jar target/demoapp1-0.1.0.jar > ${OPENSHIFT_DIY_LOG_DIR}/demoapp1.log 2>&1 &
}}}
%%
Then when we git push:
{{{
➜ demoapp1 git:(master) ✗ git push openshift master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 474 bytes | 0 bytes/s, done.
Total 5 (delta 2), reused 0 (delta 0)
remote: Stopping DIY cartridge
remote: Building git ref 'master', commit cfb642e
remote: Preparing build for deployment
remote: Deployment id is fcb8b14e
remote: Activating deployment
remote: Starting DIY cartridge
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://583f185e2d5271b8c6000069@diy-computerhok.rhcloud.com/~/git/diy.git/
4c0c10b..cfb642e master -> master
}}}