-
-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devops: Update Docker process for releasing
- Loading branch information
Showing
4 changed files
with
123 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
function docker_image_name() { | ||
echo browsh/browsh:v"$BROWSH_VERSION" | ||
} | ||
|
||
function docker_build() { | ||
local og_xpi && og_xpi=$(versioned_xpi_file) | ||
[ ! -f "$og_xpi" ] && _panic "Can't find latest webextension build: $og_xpi" | ||
[ ! -f "$XPI_PATH" ] && _panic "Can't find bundleable browsh.xpi: $XPI_PATH" | ||
if [ "$(_md5 "$og_xpi")" != "$(_md5 "$XPI_PATH")" ]; then | ||
_panic "XPI file's MD5 does not match original XPI file's MD5" | ||
fi | ||
docker build -t "$(docker_image_name)" . | ||
} | ||
|
||
function is_docker_logged_in() { | ||
docker system info | grep -E 'Username|Registry' | ||
} | ||
|
||
function docker_login() { | ||
docker login docker.io \ | ||
-u tombh \ | ||
-p "$DOCKER_ACCESS_TOKEN" | ||
} | ||
|
||
function docker_release() { | ||
! is_docker_logged_in && try_docker_login | ||
docker_build | ||
docker push "$(docker_image_name)" | ||
} |
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