forked from sharbov/open-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildspec.yml
More file actions
26 lines (25 loc) · 979 Bytes
/
buildspec.yml
File metadata and controls
26 lines (25 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
version: 0.2
env:
shell: bash
phases:
pre_build:
commands:
- mkdir -p $HOME/.docker/cli-plugins
- wget https://github.com/christian-korneck/docker-pushrm/releases/download/v1.8.0/docker-pushrm_linux_amd64 -O $HOME/.docker/cli-plugins/docker-pushrm
- chmod +x $HOME/.docker/cli-plugins/docker-pushrm
- echo "Logging in to dockerhub ..."
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_ACCESS_TOKEN
build:
commands:
- echo "Image build started at `date`"
- echo "Building image ${PRODUCT_NAME}:${IMAGE_TAG}..."
- docker build -t $PRODUCT_NAME:$IMAGE_TAG -f Dockerfile .
- echo "Image build completed at `date`"
- python3 -m pip install --upgrade build
- python3 -m pip install --upgrade twine
- python3 -m build
post_build:
commands:
- docker push $PRODUCT_NAME:$IMAGE_TAG
- docker pushrm $PRODUCT_NAME:$IMAGE_TAG
- python3 -m twine upload --repository pypi dist/*