4 POSTGRES_DB: pleroma_test
5 POSTGRES_USER: postgres
6 POSTGRES_PASSWORD: postgres
11 key: ${CI_COMMIT_REF_SLUG}
22 - mix local.hex --force
23 - mix local.rebar --force
34 - stable@pleroma/pleroma
35 - develop@pleroma/pleroma
52 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
57 - mix coveralls --preload-modules
62 - name: minibikini/postgres-with-rum:12
64 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
71 - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
72 - mix test --preload-modules
77 - mix format --check-formatted
83 - mix credo --strict --only=warnings,todo,fixme,consistency,readability
90 - apk update && apk add openssh-client rsync
93 - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
94 - eval $(ssh-agent -s)
95 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
96 - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"
102 - apk update && apk add openssh-client git
105 name: review/$CI_COMMIT_REF_NAME
106 url: https://$CI_ENVIRONMENT_SLUG.pleroma.online/
107 on_stop: stop_review_app
114 - echo "$CI_ENVIRONMENT_SLUG"
116 - eval $(ssh-agent -s)
117 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
118 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
119 - (ssh -t dokku@pleroma.online -- apps:create "$CI_ENVIRONMENT_SLUG") || true
120 - ssh -t dokku@pleroma.online -- config:set "$CI_ENVIRONMENT_SLUG" APP_NAME="$CI_ENVIRONMENT_SLUG" APP_HOST="$CI_ENVIRONMENT_SLUG.pleroma.online" MIX_ENV=dokku
121 - (ssh -t dokku@pleroma.online -- postgres:create $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db) || true
122 - (ssh -t dokku@pleroma.online -- postgres:link $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db "$CI_ENVIRONMENT_SLUG") || true
123 - (ssh -t dokku@pleroma.online -- certs:add "$CI_ENVIRONMENT_SLUG" /home/dokku/server.crt /home/dokku/server.key) || true
124 - git push -f dokku@pleroma.online:$CI_ENVIRONMENT_SLUG $CI_COMMIT_SHA:refs/heads/master
130 - apk update && apk add openssh-client git
133 name: review/$CI_COMMIT_REF_NAME
136 - echo "$CI_ENVIRONMENT_SLUG"
138 - eval $(ssh-agent -s)
139 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
140 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
141 - ssh -t dokku@pleroma.online -- --force apps:destroy "$CI_ENVIRONMENT_SLUG"
142 - ssh -t dokku@pleroma.online -- --force postgres:destroy $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db
146 # TODO: Replace with upstream image when 1.9.0 comes out
147 image: rinpatch/elixir:1.9.0-rc.0
149 - stable@pleroma/pleroma
150 - develop@pleroma/pleroma
151 - /^maint/.*$/@pleroma/pleroma
152 - /^release/.*$/@pleroma/pleroma
153 artifacts: &release-artifacts
154 name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
157 # Ideally it would be never for master branch and with the next commit for develop,
158 # but Gitlab does not support neither `only` for artifacts
159 # nor setting it to never from .gitlab-ci.yml
160 # nor expiring with the next commit
163 cache: &release-cache
164 key: $CI_COMMIT_REF_NAME-$CI_JOB_NAME
167 variables: &release-variables
169 before_script: &before-release
170 - echo "import Mix.Config" > config/prod.secret.exs
171 - mix local.hex --force
172 - mix local.rebar --force
174 - mix deps.get --only prod
176 - export PLEROMA_BUILD_BRANCH=$CI_COMMIT_REF_NAME
177 - mix release --path release
182 artifacts: *release-artifacts
184 # TODO: Replace with upstream image when 1.9.0 comes out
185 image: rinpatch/elixir:1.9.0-rc.0-alpine
186 cache: *release-cache
187 variables: *release-variables
188 before_script: &before-release-musl
189 - apk add git gcc g++ musl-dev make
190 - echo "import Mix.Config" > config/prod.secret.exs
191 - mix local.hex --force
192 - mix local.rebar --force
197 artifacts: *release-artifacts
201 # TODO: Replace with upstream image when 1.9.0 comes out
202 image: rinpatch/elixir:1.9.0-rc.0-arm
203 cache: *release-cache
204 variables: *release-variables
205 before_script: *before-release
210 artifacts: *release-artifacts
214 # TODO: Replace with upstream image when 1.9.0 comes out
215 image: rinpatch/elixir:1.9.0-rc.0-arm-alpine
216 cache: *release-cache
217 variables: *release-variables
218 before_script: *before-release-musl
223 artifacts: *release-artifacts
227 # TODO: Replace with upstream image when 1.9.0 comes out
228 image: rinpatch/elixir:1.9.0-rc.0-arm64
229 cache: *release-cache
230 variables: *release-variables
231 before_script: *before-release
236 artifacts: *release-artifacts
240 # TODO: Replace with upstream image when 1.9.0 comes out
241 image: rinpatch/elixir:1.9.0-rc.0-arm64-alpine
242 cache: *release-cache
243 variables: *release-variables
244 before_script: *before-release-musl