blob: ca23d92c01231143202d6621466cc21bd6bb5346 [file] [log] [blame]
Sergio Slobodrian4d307102017-04-24 10:19:00 -04001#!/bin/bash
Zack Williams41513bf2018-07-07 20:08:35 -07002# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Sergio Slobodrian4d307102017-04-24 10:19:00 -040015
David K. Bainbridge737b74f2018-01-22 12:57:52 -080016TAG=${TAG:-latest}
17
Sergio Slobodrian6f5fc4c2017-11-17 15:31:12 -050018docker run -d --name pbuild -p 9999:9000 portainer/portainer:1.15.2
Sergio Slobodrian4d307102017-04-24 10:19:00 -040019rm -fr tmp_portainer
20mkdir tmp_portainer
21docker cp pbuild:/ tmp_portainer
22
23sed -i -e '
24s~constant("DOCKER_ENDPOINT","api/docker")~constant("DOCKER_ENDPOINT","docker/api/docker")~
25s~constant("CONFIG_ENDPOINT","api/settings")~constant("CONFIG_ENDPOINT","docker/api/settings")~
26s~constant("AUTH_ENDPOINT","api/auth")~constant("AUTH_ENDPOINT","docker/api/auth")~
27s~constant("USERS_ENDPOINT","api/users")~constant("USERS_ENDPOINT","docker/api/users")~
28s~constant("ENDPOINTS_ENDPOINT","api/endpoints")~constant("ENDPOINTS_ENDPOINT","docker/api/endpoints")~
29s~constant("TEMPLATES_ENDPOINT","api/templates")~constant("TEMPLATES_ENDPOINT","docker/api/templates")~
30' tmp_portainer/js/app.*.js
Sergio Slobodrian7d7bb962017-05-04 09:54:39 -040031sed -i -e '
32s~href="~href="docker/~
33s~href='\''~href='\''docker/~
34s~src="~src="docker/~
35s~src='\''~src='\''docker/~
36s~"images/logo.png"~"docker/images/logo.png"~
37' tmp_portainer/index.html
Sergio Slobodrian4d307102017-04-24 10:19:00 -040038
David K. Bainbridge737b74f2018-01-22 12:57:52 -080039docker build -t ${REGISTRY}${REPOSITORY}voltha-portainer:${TAG} -f docker/Dockerfile.portainer .
Sergio Slobodrian4d307102017-04-24 10:19:00 -040040rm -fr tmp_portainer
41docker stop pbuild
Sergio Slobodrian7d7bb962017-05-04 09:54:39 -040042docker rm -f pbuild
Sergio Slobodrian4d307102017-04-24 10:19:00 -040043