Skip to content

Commit

Permalink
Fetch artifacts from correct docker tag (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
PFigs authored Jul 22, 2019
1 parent 7b1f4a7 commit 7faea31
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
17 changes: 10 additions & 7 deletions .ci/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export GIT_MANIFEST_URL
export GIT_MANIFEST_BRANCH
export LXGW_C_MESH_API_HASH
export LXGW_SERVICES_HASH
export BUILD_TAG

SKIP_PULL=${1:-}

Expand Down Expand Up @@ -100,15 +101,17 @@ function _main
_build "${DOCKERFILE_PATH}/stable/x86/docker-compose.yml" "x86" "--no-cache"
else
BUILD_TAG="edge"
fi

# builds x86 and arm images based on top of current revision
if [[ -z ${SKIP_PULL} ]]
then
_fetch_dependencies
# builds x86 and arm images based on top of current revision
if [[ -z ${SKIP_PULL} ]]
then
_fetch_dependencies
fi
_build "${DOCKERFILE_PATH}/dev/docker-compose.yml" "arm"
_build "${DOCKERFILE_PATH}/dev/docker-compose.yml" "x86"
fi
_build "${DOCKERFILE_PATH}/dev/docker-compose.yml" "arm"
_build "${DOCKERFILE_PATH}/dev/docker-compose.yml" "x86"


}


Expand Down
12 changes: 12 additions & 0 deletions .ci/deploy-pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Wirepas Oy

ARTIFACT_PATH=${1:-"./dist/*"}

TWINE_USERNAME=${TWINE_USERNAME:-"Wirepas"}
TWINE_PASSWORD=${TWINE_PASSWORD:-${PYPI_PWD}}
TWINE_REPOSITORY=${TWINE_REPOSITORY}
TWINE_REPOSITORY_URL=${TWINE_REPOSITORY_URL}

twine check "${ARTIFACT_PATH}"
twine upload "${ARTIFACT_PATH}"
10 changes: 7 additions & 3 deletions .ci/fetch-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
# Copyright 2019 Wirepas Ltd

BUILD_TAG=${BUILD_TAG:-"edge"}

rm -rf dist/ || true
mkdir dist

USERGROUP="$(id -u):$(id -g)"
COMMAND="cp -v --no-preserve=ownership \${TRANSPORT_SERVICE}/wirepas_gateway-*.whl . \
COMMAND="cp -v --no-preserve=ownership \${TRANSPORT_SERVICE}/wirepas_gateway-* . \
&& cp -v --no-preserve=ownership /usr/local/bin/sinkService . \
&& tar -czvf sinkService-\${ARCH}.tar.gz sinkService \
&& rm sinkService \
Expand All @@ -19,7 +21,7 @@ docker run \
-e ARCH="x86" \
-w /data \
-v "$(pwd)/dist":/data \
wirepas/gateway-x86:edge \
wirepas/gateway-x86:"${BUILD_TAG}" \
bash -c "${COMMAND}"

echo "fetching arm wheel"
Expand All @@ -30,5 +32,7 @@ docker run \
-w /data \
-v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static \
-v "$(pwd)/dist":/data \
wirepas/gateway-rpi:latest \
wirepas/gateway-arm:"${BUILD_TAG}" \
bash -c "${COMMAND}"

twine check dist/wirepas_gateway*
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ deploy:
tags: true
branch: master

- provider: pypi
user: Wirepas
password: ${PYPI_PWD}
skip_existing: true
skip_cleanup: true
distributions: "sdist bdist_wheel"
- provider: script
script: bash .ci/deploy-pypi.sh ${TRAVIS_BUILD_DIR}/dist/${PYTHON_PKG_NAME}*
on:
tags: true
branch: master
Expand Down

0 comments on commit 7faea31

Please sign in to comment.