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
38 PLEROMA_BUILD_ENV: prod
51 - name: lainsoykaf/postgres-with-rum
53 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
58 - mix coveralls --trace --preload-modules
63 - name: lainsoykaf/postgres-with-rum
65 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
72 - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
73 - mix test --trace --preload-modules
78 - mix format --check-formatted
84 - mix credo --strict --only=warnings,todo,fixme,consistency,readability
90 - stable@pleroma/pleroma
91 - develop@pleroma/pleroma
93 - apk update && apk add openssh-client rsync
96 - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
97 - eval $(ssh-agent -s)
98 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
99 - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"
105 - apk update && apk add openssh-client git
108 name: review/$CI_COMMIT_REF_NAME
109 url: https://$CI_ENVIRONMENT_SLUG.pleroma.online/
110 on_stop: stop_review_app
117 - echo "$CI_ENVIRONMENT_SLUG"
119 - eval $(ssh-agent -s)
120 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
121 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
122 - (ssh -t dokku@pleroma.online -- apps:create "$CI_ENVIRONMENT_SLUG") || true
123 - 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
124 - (ssh -t dokku@pleroma.online -- postgres:create $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db) || true
125 - (ssh -t dokku@pleroma.online -- postgres:link $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db "$CI_ENVIRONMENT_SLUG") || true
126 - (ssh -t dokku@pleroma.online -- certs:add "$CI_ENVIRONMENT_SLUG" /home/dokku/server.crt /home/dokku/server.key) || true
127 - git push -f dokku@pleroma.online:$CI_ENVIRONMENT_SLUG $CI_COMMIT_SHA:refs/heads/master
133 - apk update && apk add openssh-client git
136 name: review/$CI_COMMIT_REF_NAME
139 - echo "$CI_ENVIRONMENT_SLUG"
141 - eval $(ssh-agent -s)
142 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
143 - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts
144 - ssh -t dokku@pleroma.online -- --force apps:destroy "$CI_ENVIRONMENT_SLUG"
145 - ssh -t dokku@pleroma.online -- --force postgres:destroy $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db
149 # TODO: Replace with upstream image when 1.9.0 comes out
150 image: rinpatch/elixir:1.9.0-rc.0
152 - stable@pleroma/pleroma
153 - develop@pleroma/pleroma
154 - /^maint/.*$/@pleroma/pleroma
155 - /^release/.*$/@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 - export PLEROMA_BUILD_BRANCH=$CI_COMMIT_REF_NAME
180 - mix release --path release
185 artifacts: *release-artifacts
187 # TODO: Replace with upstream image when 1.9.0 comes out
188 image: rinpatch/elixir:1.9.0-rc.0-alpine
189 cache: *release-cache
190 variables: *release-variables
191 before_script: &before-release-musl
192 - apk add git gcc g++ musl-dev make
193 - echo "import Mix.Config" > config/prod.secret.exs
194 - mix local.hex --force
195 - mix local.rebar --force
200 artifacts: *release-artifacts
204 # TODO: Replace with upstream image when 1.9.0 comes out
205 image: rinpatch/elixir:1.9.0-rc.0-arm
206 cache: *release-cache
207 variables: *release-variables
208 before_script: *before-release
213 artifacts: *release-artifacts
217 # TODO: Replace with upstream image when 1.9.0 comes out
218 image: rinpatch/elixir:1.9.0-rc.0-arm-alpine
219 cache: *release-cache
220 variables: *release-variables
221 before_script: *before-release-musl
226 artifacts: *release-artifacts
230 # TODO: Replace with upstream image when 1.9.0 comes out
231 image: rinpatch/elixir:1.9.0-rc.0-arm64
232 cache: *release-cache
233 variables: *release-variables
234 before_script: *before-release
239 artifacts: *release-artifacts
243 # TODO: Replace with upstream image when 1.9.0 comes out
244 image: rinpatch/elixir:1.9.0-rc.0-arm64-alpine
245 cache: *release-cache
246 variables: *release-variables
247 before_script: *before-release-musl