4 POSTGRES_DB: pleroma_test
5 POSTGRES_USER: postgres
6 POSTGRES_PASSWORD: postgres
11 key: ${CI_COMMIT_REF_SLUG}
23 - mix local.hex --force
24 - mix local.rebar --force
39 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
44 - mix pleroma.load_testing
51 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
56 - mix coveralls --trace --preload-modules
61 - name: minibikini/postgres-with-rum:12
63 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
70 - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
71 - mix test --trace --preload-modules
76 - mix format --check-formatted
82 - mix credo --strict --only=warnings,todo,fixme,consistency,readability
88 - stable@pleroma/pleroma
89 - develop@pleroma/pleroma
93 - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' -F"variables[BRANCH]=$CI_COMMIT_REF_NAME" https://git.pleroma.social/api/v4/projects/673/trigger/pipeline
98 - apk update && apk add openssh-client git
101 name: review/$CI_COMMIT_REF_NAME
102 url: https://$CI_ENVIRONMENT_SLUG.pleroma.online/
103 on_stop: stop_review_app
110 - echo "$CI_ENVIRONMENT_SLUG"
112 - eval $(ssh-agent -s)
113 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
114 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
115 - (ssh -t dokku@pleroma.online -- apps:create "$CI_ENVIRONMENT_SLUG") || true
116 - (ssh -t dokku@pleroma.online -- git:set "$CI_ENVIRONMENT_SLUG" keep-git-dir true) || true
117 - 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
118 - (ssh -t dokku@pleroma.online -- postgres:create $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db) || true
119 - (ssh -t dokku@pleroma.online -- postgres:link $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db "$CI_ENVIRONMENT_SLUG") || true
120 - (ssh -t dokku@pleroma.online -- certs:add "$CI_ENVIRONMENT_SLUG" /home/dokku/server.crt /home/dokku/server.key) || true
121 - git push -f dokku@pleroma.online:$CI_ENVIRONMENT_SLUG $CI_COMMIT_SHA:refs/heads/master
127 - apk update && apk add openssh-client git
130 name: review/$CI_COMMIT_REF_NAME
133 - echo "$CI_ENVIRONMENT_SLUG"
135 - eval $(ssh-agent -s)
136 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
137 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
138 - ssh -t dokku@pleroma.online -- --force apps:destroy "$CI_ENVIRONMENT_SLUG"
139 - ssh -t dokku@pleroma.online -- --force postgres:destroy $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db
143 # TODO: Replace with upstream image when 1.9.0 comes out
144 image: rinpatch/elixir:1.9.0-rc.0
146 - stable@pleroma/pleroma
147 - develop@pleroma/pleroma
148 - /^maint/.*$/@pleroma/pleroma
149 - /^release/.*$/@pleroma/pleroma
150 artifacts: &release-artifacts
151 name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
154 # Ideally it would be never for master branch and with the next commit for develop,
155 # but Gitlab does not support neither `only` for artifacts
156 # nor setting it to never from .gitlab-ci.yml
157 # nor expiring with the next commit
160 cache: &release-cache
161 key: $CI_COMMIT_REF_NAME-$CI_JOB_NAME
164 variables: &release-variables
166 before_script: &before-release
167 - echo "import Mix.Config" > config/prod.secret.exs
168 - mix local.hex --force
169 - mix local.rebar --force
171 - mix deps.get --only prod
173 - export PLEROMA_BUILD_BRANCH=$CI_COMMIT_REF_NAME
174 - mix release --path release
179 artifacts: *release-artifacts
181 # TODO: Replace with upstream image when 1.9.0 comes out
182 image: rinpatch/elixir:1.9.0-rc.0-alpine
183 cache: *release-cache
184 variables: *release-variables
185 before_script: &before-release-musl
186 - apk add git gcc g++ musl-dev make
187 - echo "import Mix.Config" > config/prod.secret.exs
188 - mix local.hex --force
189 - mix local.rebar --force
194 artifacts: *release-artifacts
198 # TODO: Replace with upstream image when 1.9.0 comes out
199 image: rinpatch/elixir:1.9.0-rc.0-arm
200 cache: *release-cache
201 variables: *release-variables
202 before_script: *before-release
207 artifacts: *release-artifacts
211 # TODO: Replace with upstream image when 1.9.0 comes out
212 image: rinpatch/elixir:1.9.0-rc.0-arm-alpine
213 cache: *release-cache
214 variables: *release-variables
215 before_script: *before-release-musl
220 artifacts: *release-artifacts
224 # TODO: Replace with upstream image when 1.9.0 comes out
225 image: rinpatch/elixir:1.9.0-rc.0-arm64
226 cache: *release-cache
227 variables: *release-variables
228 before_script: *before-release
233 artifacts: *release-artifacts
237 # TODO: Replace with upstream image when 1.9.0 comes out
238 image: rinpatch/elixir:1.9.0-rc.0-arm64-alpine
239 cache: *release-cache
240 variables: *release-variables
241 before_script: *before-release-musl