Skip to content

Commit

Permalink
V0.95 fbs buildserver integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dl1com committed Nov 12, 2018
1 parent 5144162 commit bcb1451
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 193 deletions.
236 changes: 77 additions & 159 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ variables:

stages:
- build
- test
- deploy
- test2

cache:
paths:
Expand All @@ -18,8 +16,8 @@ cache:

before_script:
- TAG=$(git describe --tags | sed 's/-/.post/' | cut -f1 -d'-')
- echo $TAG > package_version
- cat package_version
- echo $TAG > src/main/resources/base/ayab/package_version
- cat src/main/resources/base/ayab/package_version

build:osx:
tags:
Expand All @@ -31,52 +29,48 @@ build:osx:
paths:
- dist/release/
script:
- mac-build/install.sh
- mac-build/build.sh
after_script:
- TAG=$(cat package_version)
- cd dist/release
- ls
- mv AYAB.dmg AYAB-${TAG}-osx.dmg
- ls
- cd ../..
- ls -lisa

build:linux:
image: python:3.5
tags:
- linux
- docker
stage: build
artifacts:
when: always
paths:
- dist/release/
script:
- cp linux-build/README.rst .
- linux-build/install.sh
after_script:
- TAG=$(cat package_version)
- cd dist/release
- ls
- mv ayab*.tar.gz AYAB-${TAG}-linux.tar.gz
- mv ayab*.whl AYAB-${TAG}-py3-none-any.whl
- ls
- cd ../..
#build:linux:
# image: python:3.5
# tags:
# - linux
# - docker
# stage: build
# artifacts:
# when: always
# paths:
# - dist/release/
# script:
# - cp linux-build/README.rst .
# - linux-build/install.sh
# after_script:
# - TAG=$(cat package_version)
# - cd dist/release
# - ls
# - mv ayab*.tar.gz AYAB-${TAG}-linux.tar.gz
# - mv ayab*.whl AYAB-${TAG}-py3-none-any.whl
# - ls
# - cd ../..

build:win7:
tags:
- win7
- virtualbox
stage: build
artifacts:
when: always
paths:
- dist/release/
script:
- windows-build/install.sh 7
after_script:
- cd dist/release
- ls
- cd ../..
#build:win7:
# tags:
# - win7
# - virtualbox
# stage: build
# artifacts:
# when: always
# paths:
# - dist/release/
# script:
# - windows-build/build.sh 7
# after_script:
# - cd dist/release
# - ls
# - cd ../..

build:win10:
tags:
Expand All @@ -88,120 +82,44 @@ build:win10:
paths:
- dist/release/
script:
- windows-build/install.sh 10
- windows-build/build.sh 10
after_script:
- cd dist/release
- ls
- cd ../..
- ls -lisa

test:pypi_source:
tags:
- linux
- docker
stage: test
image: python:3.5
before_script:
- cd dist/release
- ls
script:
- pip3 install AYAB*.tar.gz

test:pypi_wheel:
tags:
- linux
- docker
stage: test
image: python:3.5
before_script:
- cd dist/release
- ls
script:
- pip3 install AYAB*.whl

test:pypi_git:
tags:
- linux
- docker
stage: test
image: python:3.5
script:
- pip3 install -e git+https://gitlab.derchris.eu:10443/AllYarnsAreBeautiful/ayab-desktop.git@$CI_COMMIT_REF_NAME#egg=ayab

deploy:s3:
tags:
- linux
- docker
stage: deploy
environment:
name: s3
url: http://ayab-debug.s3-website.eu-central-1.amazonaws.com
image: python:latest
before_script:
- cp deploy/*.tpl dist/
- cd dist/release
- for i in `ls`; do echo "<li class=\"file\"><a href=\"$i\">$i</a></li>"; done > ../main.tpl
- cd ../
- cat header.tpl main.tpl footer.tpl > release/index.html
- cd ../
script:
- pip install awscli
- aws s3 rm s3://$S3_BUCKET_NAME/ --recursive
- aws s3 cp --acl public-read ./dist/release/ s3://$S3_BUCKET_NAME/ --recursive

deploy:github:
tags:
- linux
- docker
stage: deploy
environment:
name: github
url: https://github.com/AllYarnsAreBeautiful/ayab-desktop/releases
image: python:latest
script:
- cd dist/release
- ls
- /tools/upload.sh $CI_COMMIT_TAG master
only:
- tags

deploy:pypi_test:
tags:
- linux
- docker
stage: deploy
environment:
name: pypi_test
url: https://testpypi.python.org/pypi/ayab
image: python:latest
script:
- pip install twine
- cd dist/release
- ls
- /tools/pypi.sh test

deploy:pypi:
tags:
- linux
- docker
stage: deploy
environment:
name: pypi
url: https://pypi.python.org/pypi/ayab
image: python:latest
script:
- pip install twine
- cd dist/release
- ls
- /tools/pypi.sh prod
only:
- tags
#deploy:s3:
# tags:
# - linux
# - docker
# stage: deploy
# environment:
# name: s3
# url: http://ayab-debug.s3-website.eu-central-1.amazonaws.com
# image: python:latest
# before_script:
# - cp deploy/*.tpl dist/
# - cd dist/release
# - for i in `ls`; do echo "<li class=\"file\"><a href=\"$i\">$i</a></li>"; done > ../main.tpl
# - cd ../
# - cat header.tpl main.tpl footer.tpl > release/index.html
# - cd ../
# script:
# - pip install awscli
# - aws s3 rm s3://$S3_BUCKET_NAME/ --recursive
# - aws s3 cp --acl public-read ./dist/release/ s3://$S3_BUCKET_NAME/ --recursive

test2:pypi_test:
tags:
- linux
- docker
stage: test2
image: python:3.5
script:
- TAG=$(cat package_version)
- pip3 install --extra-index-url https://test.pypi.org/pypi ayab==${TAG}
#deploy:github:
# tags:
# - linux
# - docker
# stage: deploy
# environment:
# name: github
# url: https://github.com/AllYarnsAreBeautiful/ayab-desktop/releases
# image: python:latest
# script:
# - cd dist/release
# - ls
# - /tools/upload.sh $CI_COMMIT_TAG master
# only:
# - tags
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ You can install it using Homebrew
brew install pyenv
brew install pyenv-virtualenv

You also need the Xcode command line tools installed.
You also need the Xcode command line tools installed (xcode-select --install).
Once these have been installed, you need to get the Python version installed

env PYTHON_CONFIGURE_OPTS="--enable-framework" CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.5.3
Expand All @@ -139,10 +139,21 @@ Create a virtual enviroment in the cloned repository
pyenv virtualenv 3.5.3 venv
pyenv activate venv

(If the pyenv commands don't work out, you probably have to add

eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

to your ~/.bash_profile)

Then install the remaining prerequisites with

pip3 install -r requirements.txt

To solve pip3 SSL:TLSV1_ALERT_PROTOCOL_VERSION problem:

curl https://bootstrap.pypa.io/get-pip.py | python3

Now start ayab with

python3 -m fbs run
Expand Down
8 changes: 8 additions & 0 deletions mac-build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# mac-build

macOS version has to be the oldest version which shall be supported by the app.

Additional to the environment described in the README.md (main directory) in the "macOS - Running from source & Development" section , you need:

* gitlab-runner

8 changes: 4 additions & 4 deletions mac-build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ set -e
HERE="`dirname \"$0\"`"
USER="$1"
PACKAGE_VERSION="`cat src/main/resources/base/ayab/package_version`"
cd "$HERE"

mkdir -p dist/release
python3 -m pip install -r requirements.txt

echo "# build the app"
python -m fbs freeze
python3 -m fbs freeze

echo "# create the .dmg file"
python -m fbs installer
python3 -m fbs installer

mkdir -p dist/release
mv target/AYAB.dmg dist/release/AYAB-$PACKAGE_VERSION.dmg
ls -l dist/

Expand Down
9 changes: 0 additions & 9 deletions mac-build/install.sh

This file was deleted.

1 change: 0 additions & 1 deletion mac-build/package_version

This file was deleted.

Empty file removed windows-build/LICENSE
Empty file.
29 changes: 29 additions & 0 deletions windows-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,32 @@ To build the NSIS installer, run
python3 -m fbs installer

(NSIS must be on the Windows PATH)

## Win10 Build dependencies

* vcredist packages
* https://www.microsoft.com/en-us/download/confirmation.aspx?id=26999
* https://www.microsoft.com/en-us/download/confirmation.aspx?id=30679
* https://www.microsoft.com/en-us/download/confirmation.aspx?id=48145
* https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

* git for windows (https://git-scm.com/download/win)
* python 3.5.3 (64 bit) (https://www.python.org/downloads/release/python-353/)
* NSIS http://nsis.sourceforge.net/Download
* gitlab-runner (https://docs.gitlab.com/runner/install/windows.html)

## Settings

* Add to Path
* C:\Programs and Files\Git\bin\
* NSIS
* %SystemRoot%/SysWOW64

* config.toml
* executor = "shell"
* shell = "bash"
* build_dir = "/c/gitlab-runner/builds/"
* builds_cache = "/c/gitlab-runner/cache/"

## Gitlab Runner Call
C:\Program Files\Git\bin\bash.exe -c "/c/gitlab-runner/gitlab-runner.exe run --working-directory /c/gitlab-runner --config /c/gitlab-runner/config.toml --service gitlab-runner --syslog"
Loading

0 comments on commit bcb1451

Please sign in to comment.