This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #539 from stevekuznetsov/skuznets/jenkins"
This reverts commit eabc55f, reversing changes made to b2200a2. Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
- Loading branch information
1 parent
8f5f653
commit cd03a63
Showing
11 changed files
with
204 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
lib/vagrant-openshift/action/create_bare_repo_placeholders.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#-- | ||
# Copyright 2013 Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#++ | ||
|
||
module Vagrant | ||
module Openshift | ||
module Action | ||
class CreateBareRepoPlaceholders | ||
include CommandHelper | ||
|
||
def initialize(app, env) | ||
@app = app | ||
@env = env | ||
end | ||
|
||
def call(env) | ||
remote_write(env[:machine], "/root/.ssh/config", "root:root", "0600") { | ||
%{Host github.com | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile=/dev/null | ||
}} | ||
|
||
git_clone_commands = "" | ||
Constants.repos(env).each do |repo_name, url| | ||
bare_repo_name = repo_name + "-bare" | ||
bare_repo_path = Constants.build_dir + bare_repo_name | ||
|
||
git_clone_commands += "[ ! -d #{bare_repo_path} ] && git init --bare #{bare_repo_path};\n" | ||
end | ||
|
||
ssh_user = env[:machine].ssh_info[:username] | ||
sudo(env[:machine], "mkdir -p #{Constants.build_dir}") | ||
sudo(env[:machine], "mkdir -p #{Constants.build_dir + "builder"} && chown -R #{ssh_user}:#{ssh_user} #{Constants.build_dir}") | ||
do_execute env[:machine], git_clone_commands | ||
|
||
@app.call(env) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#-- | ||
# Copyright 2013 Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#++ | ||
|
||
module Vagrant | ||
module Openshift | ||
module Action | ||
class SyncUpstreamRepository | ||
include CommandHelper | ||
|
||
def initialize(app, env) | ||
@app = app | ||
@env = env | ||
end | ||
|
||
def call(env) | ||
env[:machine].env.ui.info("Synchronizing upstream sources\n") | ||
command = "set -e\n" | ||
|
||
Constants.repos(env).each do |repo_name, url| | ||
|
||
branch="master" | ||
|
||
bare_repo_name = repo_name + "-bare" | ||
bare_repo_wc_name = repo_name + "-bare-working_copy" | ||
bare_repo_path = Constants.build_dir + bare_repo_name | ||
bare_repo_wc_path = Constants.build_dir + bare_repo_wc_name | ||
|
||
command += "export GIT_SSH=#{Constants.git_ssh};\n" unless Constants.git_ssh.nil? or Constants.git_ssh.empty? | ||
command += %{ | ||
if [ ! -d #{bare_repo_wc_path} ]; then | ||
echo 'Cloning #{repo_name} ...' | ||
git clone -l --quiet #{bare_repo_path} #{bare_repo_wc_path} | ||
fi | ||
cd #{bare_repo_wc_path} | ||
git remote add upstream #{url} | ||
git fetch upstream | ||
git checkout master | ||
git reset --hard upstream/#{branch} | ||
git push origin master -f | ||
} | ||
end | ||
|
||
do_execute(env[:machine], command) | ||
|
||
env[:machine].env.ui.info("Done") | ||
@app.call(env) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters