Exemplo n.º 1
0
#     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.
from datetime import datetime
from build_pack_utils import Builder
from compile_helpers import setup_webdir_if_it_doesnt_exist
from compile_helpers import setup_log_dir

if __name__ == '__main__':
    (Builder().configure().default_config()  # noqa
     .stack_config().user_config().validate().done().execute().method(
         setup_webdir_if_it_doesnt_exist).execute().method(setup_log_dir).
     register().extension().from_build_pack('lib/{WEB_SERVER}').extension(
     ).from_build_pack('lib/php').extension().from_build_pack(
         'lib/env').extension().from_build_pack('extensions/dynatrace').
     extension().from_build_pack('extensions/geoip').extension(
     ).from_build_pack('extensions/newrelic').extension(
     ).from_build_pack('extensions/sessions').extension().from_build_pack(
         'extensions/composer').extensions().from_application('.extensions').
     extension().from_build_pack('lib/additional_commands').done().install(
     ).build_pack_utils().extensions().done().copy().under('{BP_DIR}/bin').
     into('{BUILD_DIR}/.bp/bin').where_name_is('rewrite').where_name_is(
         'start').any_true().done().save().runtime_environment().process_list(
         ).done().create_start_script().using_process_manager().write())

    print 'Finished: [%s]' % datetime.now()
Exemplo n.º 2
0
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from build_pack_utils import Builder
import sys

(Builder().configure()  # noqa
 .default_config().user_config(
     step='detect').done().detect().find_composer_path().if_found_output(
         'php ' + sys.argv[2]).when_not_found_continue().done().detect().
 ends_with(".php").recursive().if_found_output(
     'php ' + sys.argv[2]).when_not_found_continue().done().detect().by_name(
         '{WEBDIR}').if_found_output('php ' + sys.argv[2]).done())
Exemplo n.º 3
0
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from datetime import datetime
from build_pack_utils import Builder
from compile_helpers import setup_webdir_if_it_doesnt_exist
from compile_helpers import setup_log_dir

if __name__ == '__main__':
    (Builder().configure().default_config().user_config().done().execute(
    ).method(setup_webdir_if_it_doesnt_exist).execute().method(setup_log_dir).
     register().extension().from_build_pack('lib/{WEB_SERVER}').extension().
     from_build_pack('lib/{PHP_VM}').extensions().from_build_pack('extensions')
     .extensions().from_application('.extensions').done().install(
     ).build_pack_utils().extensions().done().copy().under('{BP_DIR}/bin').
     into('{BUILD_DIR}/.bp/bin').where_name_is('rewrite').where_name_is(
         'start').any_true().done().save().runtime_environment().process_list(
         ).done().create_start_script().using_process_manager().write())
    print 'Finished: [%s]' % datetime.now()
Exemplo n.º 4
0
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from build_pack_utils import Builder

(Builder().configure().default_config().user_config().done().detect().
 ends_with(".php").recursive().if_found_output('PHP').when_not_found_continue(
 ).done().detect().by_name('{WEBDIR}').if_found_output('STATIC').done())
Exemplo n.º 5
0
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from build_pack_utils import Builder

(Builder()
    .configure()
        .done()
    .release())
Exemplo n.º 6
0
        '-Dmaven.repo.local=%s' % mvnRepo, '-f', pom, mvnCmd, '--batch-mode'
    ]


def copy_maven_repo_to_droplet(cfg):
    return ['cp', '-R', os.path.join(cfg['CACHE_DIR'], 'repo'), '.']


def log_run(cmd, retcode, stdout, stderr):
    print 'Command %s completed with [%d]' % (str(cmd), retcode)
    print 'STDOUT:'
    print stdout
    print 'STDERR:'
    print stderr
    if retcode != 0:
        raise RuntimeError('Script Failure')


if __name__ == '__main__':
    (Builder().configure().default_config().user_config().done().install(
    ).package('JAVA').package('MAVEN').done().run().command('rm java/src.zip').
     out_of('BUILD_DIR').done().run().command(maven_command).
     environment_variable().name('JAVA_HOME').value('JAVA_INSTALL_PATH').
     out_of('BUILD_DIR').with_shell().on_finish(log_run).done().run().command(
         copy_maven_repo_to_droplet).out_of('BUILD_DIR').done().
     create_start_script().environment_variable().export().name('JAVA_HOME').
     value('JAVA_INSTALL_PATH').environment_variable().export().name('M2_HOME')
     .value('MAVEN_INSTALL_PATH').command().run('$M2_HOME/bin/mvn').
     with_argument('-Dmaven.repo.local=$HOME/repo').with_argument(
         'MAVEN_RUN_COMMAND').with_argument('--batch-mode').done().write())
Exemplo n.º 7
0
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from build_pack_utils import Builder

(Builder().configure().default_config().user_config().done().release())
Exemplo n.º 8
0
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from build_pack_utils import Builder

(Builder().configure().done().detect().ends_with(
    ".php").recursive().if_found_output('PHP').when_not_found_continue().done(
    ).detect().by_name('htdocs').if_found_output('STATIC').done())
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
from build_pack_utils import Builder

(Builder().configure().done().detect().by_name('pom.xml').if_found_output(
    'Maven').done())