Sergio Slobodrian | 4d30710 | 2017-04-24 10:19:00 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | # 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 Slobodrian | 4d30710 | 2017-04-24 10:19:00 -0400 | [diff] [blame] | 15 | |
David K. Bainbridge | 737b74f | 2018-01-22 12:57:52 -0800 | [diff] [blame] | 16 | TAG=${TAG:-latest} |
| 17 | |
Sergio Slobodrian | 6f5fc4c | 2017-11-17 15:31:12 -0500 | [diff] [blame] | 18 | docker run -d --name pbuild -p 9999:9000 portainer/portainer:1.15.2 |
Sergio Slobodrian | 4d30710 | 2017-04-24 10:19:00 -0400 | [diff] [blame] | 19 | rm -fr tmp_portainer |
| 20 | mkdir tmp_portainer |
| 21 | docker cp pbuild:/ tmp_portainer |
| 22 | |
| 23 | sed -i -e ' |
| 24 | s~constant("DOCKER_ENDPOINT","api/docker")~constant("DOCKER_ENDPOINT","docker/api/docker")~ |
| 25 | s~constant("CONFIG_ENDPOINT","api/settings")~constant("CONFIG_ENDPOINT","docker/api/settings")~ |
| 26 | s~constant("AUTH_ENDPOINT","api/auth")~constant("AUTH_ENDPOINT","docker/api/auth")~ |
| 27 | s~constant("USERS_ENDPOINT","api/users")~constant("USERS_ENDPOINT","docker/api/users")~ |
| 28 | s~constant("ENDPOINTS_ENDPOINT","api/endpoints")~constant("ENDPOINTS_ENDPOINT","docker/api/endpoints")~ |
| 29 | s~constant("TEMPLATES_ENDPOINT","api/templates")~constant("TEMPLATES_ENDPOINT","docker/api/templates")~ |
| 30 | ' tmp_portainer/js/app.*.js |
Sergio Slobodrian | 7d7bb96 | 2017-05-04 09:54:39 -0400 | [diff] [blame] | 31 | sed -i -e ' |
| 32 | s~href="~href="docker/~ |
| 33 | s~href='\''~href='\''docker/~ |
| 34 | s~src="~src="docker/~ |
| 35 | s~src='\''~src='\''docker/~ |
| 36 | s~"images/logo.png"~"docker/images/logo.png"~ |
| 37 | ' tmp_portainer/index.html |
Sergio Slobodrian | 4d30710 | 2017-04-24 10:19:00 -0400 | [diff] [blame] | 38 | |
David K. Bainbridge | 737b74f | 2018-01-22 12:57:52 -0800 | [diff] [blame] | 39 | docker build -t ${REGISTRY}${REPOSITORY}voltha-portainer:${TAG} -f docker/Dockerfile.portainer . |
Sergio Slobodrian | 4d30710 | 2017-04-24 10:19:00 -0400 | [diff] [blame] | 40 | rm -fr tmp_portainer |
| 41 | docker stop pbuild |
Sergio Slobodrian | 7d7bb96 | 2017-05-04 09:54:39 -0400 | [diff] [blame] | 42 | docker rm -f pbuild |
Sergio Slobodrian | 4d30710 | 2017-04-24 10:19:00 -0400 | [diff] [blame] | 43 | |