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 - master@pleroma/pleroma
35 - develop@pleroma/pleroma
50 - name: lainsoykaf/postgres-with-rum
52 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
57 - mix coveralls --trace --preload-modules
62 - name: lainsoykaf/postgres-with-rum
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 --trace --preload-modules
77 - mix format --check-formatted
83 - mix credo --strict --only=warnings,todo,fixme,consistency,readability
89 - master@pleroma/pleroma
90 - develop@pleroma/pleroma
92 - apk update && apk add openssh-client rsync
95 - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
96 - eval $(ssh-agent -s)
97 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
98 - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"
104 - apk update && apk add openssh-client git
107 name: review/$CI_COMMIT_REF_NAME
108 url: https://$CI_ENVIRONMENT_SLUG.pleroma.online/
109 on_stop: stop_review_app
116 - echo "$CI_ENVIRONMENT_SLUG"
118 - eval $(ssh-agent -s)
119 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
120 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
121 - (ssh -t dokku@pleroma.online -- apps:create "$CI_ENVIRONMENT_SLUG") || true
122 - 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
123 - (ssh -t dokku@pleroma.online -- postgres:create $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db) || true
124 - (ssh -t dokku@pleroma.online -- postgres:link $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db "$CI_ENVIRONMENT_SLUG") || true
125 - (ssh -t dokku@pleroma.online -- certs:add "$CI_ENVIRONMENT_SLUG" /home/dokku/server.crt /home/dokku/server.key) || true
126 - git push -f dokku@pleroma.online:$CI_ENVIRONMENT_SLUG $CI_COMMIT_SHA:refs/heads/master
132 - apk update && apk add openssh-client git
135 name: review/$CI_COMMIT_REF_NAME
138 - echo "$CI_ENVIRONMENT_SLUG"
140 - eval $(ssh-agent -s)
141 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
142 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
143 - ssh -t dokku@pleroma.online -- --force apps:destroy "$CI_ENVIRONMENT_SLUG"
144 - ssh -t dokku@pleroma.online -- --force postgres:destroy $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db
146 # TODO: Restrict to master and develop
150 # TODO: Replace with upstream image when 1.9.0 comes out
151 image: rinpatch/elixir:1.9.0-rc.0
153 - master@pleroma/pleroma
154 - develop@pleroma/pleroma
155 - feature/ci-release-build@pleroma/pleroma
156 artifacts: &release-artifacts
157 name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
160 # Ideally it would be never for master branch and with the next commit for develop,
161 # but Gitlab does not support neither `only` for artifacts
162 # nor setting it to never from .gitlab-ci.yml
163 # nor expiring with the next commit
166 cache: &release-cache
167 key: $CI_COMMIT_REF_NAME-$CI_JOB_NAME
170 variables: &release-variables
172 before_script: &before-release
173 - echo "import Mix.Config" > config/prod.secret.exs
174 - mix local.hex --force
175 - mix local.rebar --force
177 - mix deps.get --only prod
179 - mix release --path release
184 artifacts: *release-artifacts
186 # TODO: Replace with upstream image when 1.9.0 comes out
187 image: rinpatch/elixir:1.9.0-rc.0-alpine
188 cache: *release-cache
189 variables: *release-variables
190 before_script: &before-release-musl
191 - apk add git gcc g++ musl-dev make
192 - echo "import Mix.Config" > config/prod.secret.exs
193 - mix local.hex --force
194 - mix local.rebar --force
199 artifacts: *release-artifacts
203 # TODO: Replace with upstream image when 1.9.0 comes out
204 image: rinpatch/elixir:1.9.0-rc.0-arm
205 cache: *release-cache
206 variables: *release-variables
207 before_script: *before-release
212 artifacts: *release-artifacts
216 # TODO: Replace with upstream image when 1.9.0 comes out
217 image: rinpatch/elixir:1.9.0-rc.0-arm-alpine
218 cache: *release-cache
219 variables: *release-variables
220 before_script: *before-release-musl
225 artifacts: *release-artifacts
229 # TODO: Replace with upstream image when 1.9.0 comes out
230 image: rinpatch/elixir:1.9.0-rc.0-arm64
231 cache: *release-cache
232 variables: *release-variables
233 before_script: *before-release
238 artifacts: *release-artifacts
242 # TODO: Replace with upstream image when 1.9.0 comes out
243 image: rinpatch/elixir:1.9.0-rc.0-arm64-alpine
244 cache: *release-cache
245 variables: *release-variables
246 before_script: *before-release-musl