Hi
Maybe this information could be useful on documentation. Since there is no support for GitLab on build.snapcraft.io, you can use the following:
-
Login into snapcraft, create a credential file, convert in base64 and copy to clipboard
snapcraft login snapcraft export-login snapcraft.login base64 snapcraft.login | xsel --clipboard
-
Set GitLab-CI variable with your credentials
- Go to your project Settings - CI / CD
- on Environment Variables, add
SNAPCRAFT_LOGIN_FILE
with your credentials from the clipboard - click on Save variables
-
create or edit a file in your project root folder called
.gitlab-ci.yml
with the following content (you can edit as you need)staging: image: ubuntu:18.04 type: deploy script: - apt-get update -qy - apt-get install -y snapcraft - snapcraft - echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > snapcraft.login - snapcraft login --with snapcraft.login - snapcraft push *.snap --release edge only: - master