- Openshift Online (Next Gen) account expire 30 days after registering.
- After my account expires, I’ll a new account and then a fresh set of resources is provided.
- I wanna restore the app on resources for the new account as it is for the old account.
- Target web application: Super simple sinatra webapp. (No Database (postgresql, mysql, …))
require "sinatra" get "/" do "Hello, world!" end
Since config.ru and Gemfile are very very straight forward, they’re omitted.
In my situation, I hosted these codes on private git repository, e.g.
(I’ve pushed a public key for the repository to openshift;
like described on “Deploying From Private Git Repositories”)
buildconfig and the public key for the app:
% oc export buildconfig helloworldapp -o yaml > buildconfig-helloworldapp.yaml % oc export secret sshsecret -o yaml > sshsecret.yaml
Note: I must do this work before my account expires.
Create new app according to the method written on the Developer Guide: Creating New Applications.
% oc new-project foobar-project % oc new-app git@private:repository-of/helloworldapp.git
The first build will fail because of lack of the public key and any other build configuration.
% oc create -f sshsecret.yaml % oc replace -f buildconfig-helloworldapp.yaml
The second build would be successed.
- Find a much more suitable method
- Support for DB (postgresql, mysql, …)
- Investigate why
oc export all -o yaml > project.yamland
oc create -f project.yamldoes not work