prima-twig 0.51.2 → 0.51.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/twig-feature +210 -224
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4daefd86d6b8588d2053ea1f8867465ec13fb94c859cc08fcb900ee98ff88fe1
4
- data.tar.gz: eb7ed6e7bcba2b74b02a7588d8f62ea66a0871088118d4f80bad0c1a98192985
3
+ metadata.gz: 5488fc6ea6ed3d3f53fd2cfd34a0ab21727dd0f6617c180d904daa5c006258a6
4
+ data.tar.gz: afd83811b53f7c41dccae36a564620483c434384260ebba24c11573af69d3f3d
5
5
  SHA512:
6
- metadata.gz: 0babe143608d39ac25852573a22e8445e8130ff8402476b0fa28611e88b899193cef8789742931e106f845c10b702dfb0b7862afe0ed210672825e977af3b3b7
7
- data.tar.gz: fd664530292d52279eeee4f40e92c0196da5ca908179c768e3eb87ed727c7c08c0fe488e1c89384afda81f675d41cb242cca2d0ee7d127c8b708ee72b088ea36
6
+ metadata.gz: 15a1d1787fb54f04ec3412bb00633cde429f5a8fb95219e9ddc5f06ac5113974122f58bc35ed567bd9cab0cb402217c7f6750d137fe670208c0b355520da44cf
7
+ data.tar.gz: 9a33b7ba7672d691a6415be2091b94f15f9bafcfc54051ca9a1011a79724a722b6c7a8298910f3f4cfd244f78fa47287286a1558fc01ca96ec1bd3490f0e7ffa
@@ -375,7 +375,7 @@ class Release
375
375
  envs.each do |key, env|
376
376
  title = ""
377
377
  env.each do |e|
378
- title << "\n#{e.key.upcase}: #{e.value}"
378
+ title << "#{e.value}" if e.key == 'qainit'
379
379
  end
380
380
  msg = "#{@prima.reduce_size(title, 1000)}".light_blue
381
381
  menu.choice(msg) { key }
@@ -1856,9 +1856,7 @@ class Release
1856
1856
  output projects_text.cyan
1857
1857
  output "Deploy effettuato, everything is awesome!\n".green
1858
1858
 
1859
- if @qainit
1860
- qainit_write_output(projects_text, 'Indirizzi scritti su ')
1861
- end
1859
+ qainit_write_output(projects_text, 'Indirizzi scritti su ')
1862
1860
  end
1863
1861
 
1864
1862
  def get_route53_hostname(stack_name)
@@ -2013,23 +2011,28 @@ class Release
2013
2011
  )
2014
2012
  end
2015
2013
 
2016
- def create_urania_artifact(revision)
2017
- output "Preparo l'artifact urania .zip\n".yellow
2014
+ def create_activia_artifact(revision)
2015
+ output "Preparo l'artifact activia .zip\n".yellow
2018
2016
 
2019
- git_checkout_version('urania', revision)
2017
+ git_checkout_version('activia', revision)
2020
2018
 
2021
- Dir.chdir 'projects/urania'
2019
+ Dir.chdir 'projects/activia'
2022
2020
 
2023
2021
  decrypt_secrets()
2024
2022
 
2025
2023
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2026
- exec_step 'prepare-docker-compose --directory urania && cp docker-compose-qainit.yml docker-compose.yml'
2027
-
2028
- execute_command "docker-compose build web"
2029
-
2030
- [ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2024
+ exec_step 'prepare-docker-compose --directory activia && cp docker-compose-qainit.yml docker-compose.yml'
2025
+ [
2026
+ "docker-compose build web",
2027
+ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2031
2028
  '-c' 'mix local.hex --force && mix hex.info && \
2032
2029
  mix deps.get && mix compile && mix deps.compile && \
2030
+ cd assets && \
2031
+ rm -rf node_modules && \
2032
+ yarn --cache-folder ~/.cache/yarn && \
2033
+ sysconfcpus -n 2 ./node_modules/.bin/webpack --mode production && \
2034
+ cd .. && \
2035
+ mix phx.digest && \
2033
2036
  rm -rf _build/qa/rel/ && \
2034
2037
  mix release --env=qa'"
2035
2038
  ].each do |cmd|
@@ -2038,29 +2041,30 @@ class Release
2038
2041
 
2039
2042
  cleanup_containers
2040
2043
 
2041
- artifact_path = Dir.glob("_build/qa/rel/urania/releases/*/urania.tar.gz").first
2042
- upload_artifact(artifact_path, "microservices/urania/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2044
+ artifact_path = Dir.glob("_build/qa/rel/activia/releases/*/activia.tar.gz").first
2045
+
2046
+ upload_artifact(artifact_path, "microservices/activia/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2043
2047
 
2044
2048
  Dir.chdir '../../'
2045
2049
  end
2046
2050
 
2047
- def create_rachele_artifact(revision)
2048
- output "Preparo l'artifact rachele .zip\n".yellow
2051
+ def create_assange_artifact(revision)
2052
+ output "Preparo l'artifact assange .zip\n".yellow
2049
2053
 
2050
- git_checkout_version('rachele', revision)
2054
+ git_checkout_version('assange', revision)
2051
2055
 
2052
- Dir.chdir 'projects/rachele'
2056
+ Dir.chdir 'projects/assange'
2053
2057
 
2054
2058
  decrypt_secrets()
2055
2059
 
2056
2060
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2057
- exec_step 'prepare-docker-compose --directory rachele && cp docker-compose-qainit.yml docker-compose.yml'
2058
-
2059
- execute_command "docker-compose build web"
2060
-
2061
- [ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2061
+ exec_step 'prepare-docker-compose --directory assange && cp docker-compose-qainit.yml docker-compose.yml'
2062
+ [
2063
+ "docker-compose build web",
2064
+ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2062
2065
  '-c' 'mix local.hex --force && mix hex.info && \
2063
2066
  mix deps.get && mix compile && mix deps.compile && \
2067
+ mix phx.digest && \
2064
2068
  rm -rf _build/qa/rel/ && \
2065
2069
  mix release --env=qa'"
2066
2070
  ].each do |cmd|
@@ -2069,70 +2073,75 @@ class Release
2069
2073
 
2070
2074
  cleanup_containers
2071
2075
 
2072
- artifact_path = Dir.glob("_build/qa/rel/rachele/releases/*/rachele.tar.gz").first
2073
- upload_artifact(artifact_path, "microservices/rachele/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2076
+ artifact_path = Dir.glob("_build/qa/rel/assange/releases/*/assange.tar.gz").first
2077
+ upload_artifact(artifact_path, "microservices/assange/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2074
2078
 
2075
2079
  Dir.chdir '../../'
2076
2080
  end
2077
2081
 
2078
- def create_ermes_artifact(revision)
2079
- output "Preparo l'artifact ermes .zip\n".yellow
2082
+ def create_bburago_artifact(revision)
2083
+ output "Preparo l'artifact bburago .zip\n".yellow
2080
2084
 
2081
- git_checkout_version('ermes', revision)
2085
+ git_checkout_version('bburago', revision)
2082
2086
 
2083
- Dir.chdir 'projects/ermes'
2087
+ Dir.chdir 'projects/bburago'
2084
2088
 
2085
2089
  decrypt_secrets()
2086
2090
 
2087
2091
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2088
- exec_step 'prepare-docker-compose --directory ermes && cp docker-compose-qainit.yml docker-compose.yml'
2089
-
2092
+ exec_step 'prepare-docker-compose --directory bburago && cp docker-compose-qainit.yml docker-compose.yml'
2090
2093
  [
2091
- "if echo `docker network ls` | grep crash_default; \
2092
- then echo 'crash_default network already existing'; \
2093
- else docker network create crash_default; fi",
2094
- 'docker-compose build web'
2094
+ "docker-compose build web",
2095
+ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint deploy/create_qa_artifact web"
2095
2096
  ].each do |cmd|
2096
2097
  execute_command cmd
2097
2098
  end
2098
2099
 
2099
- [ "docker-compose run --rm -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2100
+ cleanup_containers
2101
+
2102
+ artifact_path = Dir.glob('_build/qa/rel/bburago/releases/*/bburago.tar.gz').first
2103
+ upload_artifact(artifact_path, "microservices/bburago/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2104
+
2105
+ Dir.chdir '../../'
2106
+ end
2107
+
2108
+ def create_borat_artifact(revision)
2109
+ output "Preparo l'artifact borat .zip\n".yellow
2110
+
2111
+ git_checkout_version('borat', revision)
2112
+
2113
+ Dir.chdir 'projects/borat'
2114
+
2115
+ decrypt_secrets()
2116
+
2117
+ exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2118
+ exec_step 'prepare-docker-compose --directory borat && cp docker-compose-qainit.yml docker-compose.yml'
2119
+ [
2120
+ "docker network create borat_network || true",
2121
+ "docker-compose build web",
2122
+ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2100
2123
  '-c' 'mix local.hex --force && mix hex.info && \
2101
- mix deps.get && mix compile && mix deps.compile && \
2124
+ mix deps.get && \
2125
+ cd assets && \
2126
+ yarn --cache-folder ~/.cache/yarn && \
2127
+ sysconfcpus -n 2 ./node_modules/.bin/webpack -p --config config/webpack.config.prod.js && \
2128
+ cd ../ && \
2102
2129
  mix phx.digest && \
2130
+ mix compile && mix deps.compile && \
2103
2131
  rm -rf _build/qa/rel/ && \
2104
- mix release --env=qa'"
2132
+ mix distillery.release --env=qa'"
2105
2133
  ].each do |cmd|
2106
2134
  execute_command cmd
2107
2135
  end
2108
2136
 
2109
2137
  cleanup_containers
2110
2138
 
2111
- artifact_path = Dir.glob("_build/qa/rel/ermes/releases/*/ermes.tar.gz").first
2112
- upload_artifact(artifact_path, "microservices/ermes/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2139
+ artifact_path = Dir.glob("_build/qa/rel/borat/releases/*/borat.tar.gz").first
2140
+ upload_artifact(artifact_path, "microservices/borat/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2113
2141
 
2114
2142
  Dir.chdir '../../'
2115
2143
  end
2116
2144
 
2117
- def deploy_pyxis?
2118
- if defined? @deploy_pyxis
2119
- @deploy_pyxis
2120
- else
2121
- pyxis_updated = `git log -p -1 --unified=0 | grep pyxis-npm:`.length > 0
2122
-
2123
- update_pyxis = !@projects['pyxis-npm'].empty? && @projects['pyxis-npm'][:name] != 'master' && pyxis_updated
2124
-
2125
- @deploy_pyxis = update_pyxis
2126
- return update_pyxis
2127
- end
2128
- end
2129
-
2130
- def deploy_crash?
2131
- crash_present = !@projects['crash'].empty? && @projects['crash'][:name] != 'master' && !@projects['crash'][:default_branch]
2132
- leftorium_present = !@projects['leftorium'].empty? && @projects['leftorium'][:name] != 'master' && !@projects['leftorium'][:default_branch]
2133
- crash_present || leftorium_present
2134
- end
2135
-
2136
2145
  def create_crash_artifact(revision, deploy_id)
2137
2146
  output "Preparo l'artifact crash .zip\n".yellow
2138
2147
 
@@ -2173,48 +2182,62 @@ class Release
2173
2182
  Dir.chdir '../../'
2174
2183
  end
2175
2184
 
2176
- def create_bburago_artifact(revision)
2177
- output "Preparo l'artifact bburago .zip\n".yellow
2185
+ def create_ermes_artifact(revision)
2186
+ output "Preparo l'artifact ermes .zip\n".yellow
2178
2187
 
2179
- git_checkout_version('bburago', revision)
2188
+ git_checkout_version('ermes', revision)
2180
2189
 
2181
- Dir.chdir 'projects/bburago'
2190
+ Dir.chdir 'projects/ermes'
2182
2191
 
2183
2192
  decrypt_secrets()
2184
2193
 
2185
2194
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2186
- exec_step 'prepare-docker-compose --directory bburago && cp docker-compose-qainit.yml docker-compose.yml'
2195
+ exec_step 'prepare-docker-compose --directory ermes && cp docker-compose-qainit.yml docker-compose.yml'
2196
+
2187
2197
  [
2188
- "docker-compose build web",
2189
- "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint deploy/create_qa_artifact web"
2198
+ "if echo `docker network ls` | grep crash_default; \
2199
+ then echo 'crash_default network already existing'; \
2200
+ else docker network create crash_default; fi",
2201
+ 'docker-compose build web'
2202
+ ].each do |cmd|
2203
+ execute_command cmd
2204
+ end
2205
+
2206
+ [ "docker-compose run --rm -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2207
+ '-c' 'mix local.hex --force && mix hex.info && \
2208
+ mix deps.get && mix compile && mix deps.compile && \
2209
+ mix phx.digest && \
2210
+ rm -rf _build/qa/rel/ && \
2211
+ mix release --env=qa'"
2190
2212
  ].each do |cmd|
2191
2213
  execute_command cmd
2192
2214
  end
2193
2215
 
2194
2216
  cleanup_containers
2195
2217
 
2196
- artifact_path = Dir.glob('_build/qa/rel/bburago/releases/*/bburago.tar.gz').first
2197
- upload_artifact(artifact_path, "microservices/bburago/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2218
+ artifact_path = Dir.glob("_build/qa/rel/ermes/releases/*/ermes.tar.gz").first
2219
+ upload_artifact(artifact_path, "microservices/ermes/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2198
2220
 
2199
2221
  Dir.chdir '../../'
2200
2222
  end
2201
2223
 
2202
- def create_leftorium_artifact(revision)
2203
- output "Preparo l'artifact leftorium .zip\n".yellow
2224
+ def create_fidaty_artifact(revision)
2225
+ output "Preparo l'artifact fidaty .zip\n".yellow
2204
2226
 
2205
- git_checkout_version('leftorium', revision)
2227
+ git_checkout_version('fidaty', revision)
2206
2228
 
2207
- Dir.chdir 'projects/leftorium'
2229
+ Dir.chdir 'projects/fidaty'
2208
2230
 
2209
2231
  decrypt_secrets()
2210
2232
 
2211
2233
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2212
- exec_step 'prepare-docker-compose --directory leftorium && cp docker-compose-qainit.yml docker-compose.yml'
2234
+ exec_step 'prepare-docker-compose --directory fidaty && cp docker-compose-qainit.yml docker-compose.yml'
2213
2235
  [
2214
2236
  "docker-compose build web",
2215
2237
  "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2216
2238
  '-c' 'mix local.hex --force && mix hex.info && \
2217
2239
  mix deps.get && mix compile && mix deps.compile && \
2240
+ mix phx.digest && \
2218
2241
  rm -rf _build/qa/rel/ && \
2219
2242
  mix release --env=qa'"
2220
2243
  ].each do |cmd|
@@ -2223,8 +2246,8 @@ class Release
2223
2246
 
2224
2247
  cleanup_containers
2225
2248
 
2226
- artifact_path = Dir.glob('_build/qa/rel/leftorium/releases/*/leftorium.tar.gz').first
2227
- upload_artifact(artifact_path, "microservices/leftorium/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2249
+ artifact_path = Dir.glob("_build/qa/rel/fidaty/releases/*/fidaty.tar.gz").first
2250
+ upload_artifact(artifact_path, "microservices/fidaty/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2228
2251
 
2229
2252
  Dir.chdir '../../'
2230
2253
  end
@@ -2260,23 +2283,22 @@ class Release
2260
2283
  Dir.chdir '../../'
2261
2284
  end
2262
2285
 
2263
- def create_fidaty_artifact(revision)
2264
- output "Preparo l'artifact fidaty .zip\n".yellow
2286
+ def create_leftorium_artifact(revision)
2287
+ output "Preparo l'artifact leftorium .zip\n".yellow
2265
2288
 
2266
- git_checkout_version('fidaty', revision)
2289
+ git_checkout_version('leftorium', revision)
2267
2290
 
2268
- Dir.chdir 'projects/fidaty'
2291
+ Dir.chdir 'projects/leftorium'
2269
2292
 
2270
2293
  decrypt_secrets()
2271
2294
 
2272
2295
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2273
- exec_step 'prepare-docker-compose --directory fidaty && cp docker-compose-qainit.yml docker-compose.yml'
2296
+ exec_step 'prepare-docker-compose --directory leftorium && cp docker-compose-qainit.yml docker-compose.yml'
2274
2297
  [
2275
2298
  "docker-compose build web",
2276
2299
  "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2277
2300
  '-c' 'mix local.hex --force && mix hex.info && \
2278
2301
  mix deps.get && mix compile && mix deps.compile && \
2279
- mix phx.digest && \
2280
2302
  rm -rf _build/qa/rel/ && \
2281
2303
  mix release --env=qa'"
2282
2304
  ].each do |cmd|
@@ -2285,8 +2307,8 @@ class Release
2285
2307
 
2286
2308
  cleanup_containers
2287
2309
 
2288
- artifact_path = Dir.glob("_build/qa/rel/fidaty/releases/*/fidaty.tar.gz").first
2289
- upload_artifact(artifact_path, "microservices/fidaty/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2310
+ artifact_path = Dir.glob('_build/qa/rel/leftorium/releases/*/leftorium.tar.gz').first
2311
+ upload_artifact(artifact_path, "microservices/leftorium/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2290
2312
 
2291
2313
  Dir.chdir '../../'
2292
2314
  end
@@ -2321,89 +2343,90 @@ class Release
2321
2343
  Dir.chdir '../../'
2322
2344
  end
2323
2345
 
2324
- def create_rogoreport_artifact(revision)
2325
- output "Preparo l'artifact rogoreport .zip\n".yellow
2346
+ def create_prima_artifact(revision, branch_name, deploy_id, minimal = false)
2347
+ output "Preparo l'artifact prima .zip\n".yellow
2326
2348
 
2327
- git_checkout_version('rogoreport', revision)
2349
+ git_checkout_version('prima', revision)
2328
2350
 
2329
- Dir.chdir 'projects/rogoreport'
2351
+ Dir.chdir 'projects/prima'
2330
2352
 
2331
- decrypt_secrets() unless File.exist?('config/secrets.yml')
2353
+ ['vendor'].each do |dir|
2354
+ unless File.directory?(dir)
2355
+ if File.directory?("../../../prima/#{dir}")
2356
+ exec_step "rsync -a ../../../prima/#{dir} ."
2357
+ end
2358
+ end
2359
+ end
2332
2360
 
2333
- exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2334
- exec_step 'prepare-docker-compose --directory rogoreport && cp docker-compose-qainit.yml docker-compose.yml'
2361
+ exec_step 'mv docker-compose-ci.yml docker-compose.yml'
2362
+ exec_step 'prepare-docker-compose --directory prima'
2363
+ exec_step 'sed -i "s/\\/home\\/app/\\/root/g" docker-compose.yml'
2364
+ `sed -i 's/"@prima-assicurazioni/pyxis-npm": ".*",/"@prima-assicurazioni/pyxis-npm": "#{@pyxis_version}",/' package.json` if deploy_pyxis?
2335
2365
  [
2336
- "docker-compose build web",
2337
- "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2338
- '-c' 'mix local.hex --force && mix hex.info && \
2339
- mix deps.get && mix compile && mix deps.compile && \
2340
- rm -rf _build/qa/rel/ && \
2341
- mix release --name=rogoreport --env=qa'"
2366
+ "bin/qa_build_artifact.sh #{branch_name} #{'update' if @deploy_update}"
2342
2367
  ].each do |cmd|
2343
2368
  execute_command cmd
2344
2369
  end
2345
2370
 
2346
2371
  cleanup_containers
2347
2372
 
2348
- artifact_path = Dir.glob("_build/qa/rel/rogoreport/releases/*/rogoreport.tar.gz").first
2349
- upload_artifact(artifact_path, "microservices/rogoreport/rogoreport-#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2350
-
2351
- Dir.chdir '../../'
2373
+ Dir.chdir "../../"
2352
2374
  end
2353
2375
 
2354
- def create_assange_artifact(revision)
2355
- output "Preparo l'artifact assange .zip\n".yellow
2376
+ def create_pyxis_artifact(revision, deploy_id)
2377
+ if (deploy_pyxis?)
2378
+ output "Preparo l'artifact pyxis\n".yellow
2356
2379
 
2357
- git_checkout_version('assange', revision)
2380
+ git_checkout_version('pyxis-npm', revision)
2358
2381
 
2359
- Dir.chdir 'projects/assange'
2382
+ Dir.chdir 'projects/pyxis-npm'
2360
2383
 
2361
- decrypt_secrets()
2384
+ decrypt_secrets()
2362
2385
 
2363
- exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2364
- exec_step 'prepare-docker-compose --directory assange && cp docker-compose-qainit.yml docker-compose.yml'
2365
- [
2366
- "docker-compose build web",
2367
- "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2368
- '-c' 'mix local.hex --force && mix hex.info && \
2369
- mix deps.get && mix compile && mix deps.compile && \
2370
- mix phx.digest && \
2371
- rm -rf _build/qa/rel/ && \
2372
- mix release --env=qa'"
2373
- ].each do |cmd|
2374
- execute_command cmd
2375
- end
2386
+ exec_step 'mv .fakenpmrc .npmrc'
2387
+ exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2388
+ exec_step 'prepare-docker-compose --directory pyxis-npm && cp docker-compose-qainit.yml docker-compose.yml'
2389
+ exec_step 'docker-compose build web'
2376
2390
 
2377
- cleanup_containers
2391
+ exec_step "docker-compose run -w $PWD -u root -e NPM_TOKEN=$NPM_TOKEN --entrypoint /bin/sh web \
2392
+ '-c' 'npm view prima-assicurazioni/pyxis-npm versions --json > versions.json'" # posso recuperare le versioni pubblicate solo da dentro al container, scrivo su un file che leggo subito dopo
2393
+ published_versions = `cat versions.json`
2394
+ qa_versions = JSON.parse(published_versions).select{ |version| version.include? get_pyxis_version(deploy_id) }
2378
2395
 
2379
- artifact_path = Dir.glob("_build/qa/rel/assange/releases/*/assange.tar.gz").first
2380
- upload_artifact(artifact_path, "microservices/assange/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2396
+ @pyxis_version = "0.#{get_pyxis_version(deploy_id)}.#{qa_versions.size}"
2381
2397
 
2382
- Dir.chdir '../../'
2398
+ `sed -i '3s/".*/"version": "#{@pyxis_version}",/' package.json`
2399
+ [
2400
+ "docker-compose run -w $PWD -u root -e NPM_TOKEN=$NPM_TOKEN --entrypoint /bin/sh web \
2401
+ '-c' 'yarn install && \
2402
+ yarn build:prod && \
2403
+ npm publish'"
2404
+ ].each do |cmd|
2405
+ execute_command cmd
2406
+ end
2407
+
2408
+ cleanup_containers
2409
+ Dir.chdir '../../'
2410
+ end
2383
2411
  end
2384
2412
 
2385
- def create_activia_artifact(revision)
2386
- output "Preparo l'artifact activia .zip\n".yellow
2413
+ def create_rachele_artifact(revision)
2414
+ output "Preparo l'artifact rachele .zip\n".yellow
2387
2415
 
2388
- git_checkout_version('activia', revision)
2416
+ git_checkout_version('rachele', revision)
2389
2417
 
2390
- Dir.chdir 'projects/activia'
2418
+ Dir.chdir 'projects/rachele'
2391
2419
 
2392
2420
  decrypt_secrets()
2393
2421
 
2394
2422
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2395
- exec_step 'prepare-docker-compose --directory activia && cp docker-compose-qainit.yml docker-compose.yml'
2396
- [
2397
- "docker-compose build web",
2398
- "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2423
+ exec_step 'prepare-docker-compose --directory rachele && cp docker-compose-qainit.yml docker-compose.yml'
2424
+
2425
+ execute_command "docker-compose build web"
2426
+
2427
+ [ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2399
2428
  '-c' 'mix local.hex --force && mix hex.info && \
2400
2429
  mix deps.get && mix compile && mix deps.compile && \
2401
- cd assets && \
2402
- rm -rf node_modules && \
2403
- yarn --cache-folder ~/.cache/yarn && \
2404
- sysconfcpus -n 2 ./node_modules/.bin/webpack --mode production && \
2405
- cd .. && \
2406
- mix phx.digest && \
2407
2430
  rm -rf _build/qa/rel/ && \
2408
2431
  mix release --env=qa'"
2409
2432
  ].each do |cmd|
@@ -2412,12 +2435,8 @@ class Release
2412
2435
 
2413
2436
  cleanup_containers
2414
2437
 
2415
- if @qainit
2416
- artifact_path = Dir.glob("_build/qa/rel/activia/releases/*/activia.tar.gz").first
2417
- else
2418
- artifact_path = Dir.glob("_build/qa/rel/activia/releases/*/activia.tar.gz").first
2419
- end
2420
- upload_artifact(artifact_path, "microservices/activia/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2438
+ artifact_path = Dir.glob("_build/qa/rel/rachele/releases/*/rachele.tar.gz").first
2439
+ upload_artifact(artifact_path, "microservices/rachele/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2421
2440
 
2422
2441
  Dir.chdir '../../'
2423
2442
  end
@@ -2453,39 +2472,32 @@ class Release
2453
2472
  Dir.chdir '../../'
2454
2473
  end
2455
2474
 
2456
- def create_borat_artifact(revision)
2457
- output "Preparo l'artifact borat .zip\n".yellow
2475
+ def create_rogoreport_artifact(revision)
2476
+ output "Preparo l'artifact rogoreport .zip\n".yellow
2458
2477
 
2459
- git_checkout_version('borat', revision)
2478
+ git_checkout_version('rogoreport', revision)
2460
2479
 
2461
- Dir.chdir 'projects/borat'
2480
+ Dir.chdir 'projects/rogoreport'
2462
2481
 
2463
- decrypt_secrets()
2482
+ decrypt_secrets() unless File.exist?('config/secrets.yml')
2464
2483
 
2465
2484
  exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2466
- exec_step 'prepare-docker-compose --directory borat && cp docker-compose-qainit.yml docker-compose.yml'
2485
+ exec_step 'prepare-docker-compose --directory rogoreport && cp docker-compose-qainit.yml docker-compose.yml'
2467
2486
  [
2468
- "docker network create borat_network || true",
2469
2487
  "docker-compose build web",
2470
2488
  "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2471
2489
  '-c' 'mix local.hex --force && mix hex.info && \
2472
- mix deps.get && \
2473
- cd assets && \
2474
- yarn --cache-folder ~/.cache/yarn && \
2475
- sysconfcpus -n 2 ./node_modules/.bin/webpack -p --config config/webpack.config.prod.js && \
2476
- cd ../ && \
2477
- mix phx.digest && \
2478
- mix compile && mix deps.compile && \
2490
+ mix deps.get && mix compile && mix deps.compile && \
2479
2491
  rm -rf _build/qa/rel/ && \
2480
- mix distillery.release --env=qa'"
2492
+ mix release --name=rogoreport --env=qa'"
2481
2493
  ].each do |cmd|
2482
2494
  execute_command cmd
2483
2495
  end
2484
2496
 
2485
2497
  cleanup_containers
2486
2498
 
2487
- artifact_path = Dir.glob("_build/qa/rel/borat/releases/*/borat.tar.gz").first
2488
- upload_artifact(artifact_path, "microservices/borat/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2499
+ artifact_path = Dir.glob("_build/qa/rel/rogoreport/releases/*/rogoreport.tar.gz").first
2500
+ upload_artifact(artifact_path, "microservices/rogoreport/rogoreport-#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2489
2501
 
2490
2502
  Dir.chdir '../../'
2491
2503
  end
@@ -2508,73 +2520,56 @@ class Release
2508
2520
  Dir.chdir '../../'
2509
2521
  end
2510
2522
 
2511
- def create_prima_artifact(revision, branch_name, deploy_id, minimal = false)
2512
- output "Preparo l'artifact prima .zip\n".yellow
2523
+ def create_urania_artifact(revision)
2524
+ output "Preparo l'artifact urania .zip\n".yellow
2513
2525
 
2514
- git_checkout_version('prima', revision)
2526
+ git_checkout_version('urania', revision)
2515
2527
 
2516
- Dir.chdir 'projects/prima'
2528
+ Dir.chdir 'projects/urania'
2517
2529
 
2518
- ['vendor'].each do |dir|
2519
- unless File.directory?(dir)
2520
- if File.directory?("../../../prima/#{dir}")
2521
- exec_step "rsync -a ../../../prima/#{dir} ."
2522
- end
2523
- end
2524
- end
2530
+ decrypt_secrets()
2525
2531
 
2526
- exec_step 'mv docker-compose-ci.yml docker-compose.yml'
2527
- exec_step 'prepare-docker-compose --directory prima'
2528
- exec_step 'sed -i "s/\\/home\\/app/\\/root/g" docker-compose.yml'
2529
- `sed -i 's/"@prima-assicurazioni/pyxis-npm": ".*",/"@prima-assicurazioni/pyxis-npm": "#{@pyxis_version}",/' package.json` if deploy_pyxis?
2530
- [
2531
- "bin/qa_build_artifact.sh #{branch_name} #{'update' if @deploy_update}"
2532
+ exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2533
+ exec_step 'prepare-docker-compose --directory urania && cp docker-compose-qainit.yml docker-compose.yml'
2534
+
2535
+ execute_command "docker-compose build web"
2536
+
2537
+ [ "docker-compose run -w $PWD -u root -e MIX_ENV=qa --entrypoint /bin/sh web \
2538
+ '-c' 'mix local.hex --force && mix hex.info && \
2539
+ mix deps.get && mix compile && mix deps.compile && \
2540
+ rm -rf _build/qa/rel/ && \
2541
+ mix release --env=qa'"
2532
2542
  ].each do |cmd|
2533
2543
  execute_command cmd
2534
2544
  end
2535
2545
 
2536
2546
  cleanup_containers
2537
2547
 
2538
- Dir.chdir "../../"
2539
- end
2540
-
2541
- def create_pyxis_artifact(revision, deploy_id)
2542
- if (deploy_pyxis?)
2543
- output "Preparo l'artifact pyxis\n".yellow
2544
-
2545
- git_checkout_version('pyxis-npm', revision)
2546
-
2547
- Dir.chdir 'projects/pyxis-npm'
2548
-
2549
- decrypt_secrets()
2550
-
2551
- exec_step 'mv .fakenpmrc .npmrc'
2552
- exec_step 'cp docker-compose.yml docker-compose-ci.yml'
2553
- exec_step 'prepare-docker-compose --directory pyxis-npm && cp docker-compose-qainit.yml docker-compose.yml'
2554
- exec_step 'docker-compose build web'
2548
+ artifact_path = Dir.glob("_build/qa/rel/urania/releases/*/urania.tar.gz").first
2549
+ upload_artifact(artifact_path, "microservices/urania/#{revision}-qa.tar.gz", "#{@s3_bucket}-encrypted")
2555
2550
 
2556
- exec_step "docker-compose run -w $PWD -u root -e NPM_TOKEN=$NPM_TOKEN --entrypoint /bin/sh web \
2557
- '-c' 'npm view prima-assicurazioni/pyxis-npm versions --json > versions.json'" # posso recuperare le versioni pubblicate solo da dentro al container, scrivo su un file che leggo subito dopo
2558
- published_versions = `cat versions.json`
2559
- qa_versions = JSON.parse(published_versions).select{ |version| version.include? get_pyxis_version(deploy_id) }
2551
+ Dir.chdir '../../'
2552
+ end
2560
2553
 
2561
- @pyxis_version = "0.#{get_pyxis_version(deploy_id)}.#{qa_versions.size}"
2554
+ def deploy_pyxis?
2555
+ if defined? @deploy_pyxis
2556
+ @deploy_pyxis
2557
+ else
2558
+ pyxis_updated = `git log -p -1 --unified=0 | grep pyxis-npm:`.length > 0
2562
2559
 
2563
- `sed -i '3s/".*/"version": "#{@pyxis_version}",/' package.json`
2564
- [
2565
- "docker-compose run -w $PWD -u root -e NPM_TOKEN=$NPM_TOKEN --entrypoint /bin/sh web \
2566
- '-c' 'yarn install && \
2567
- yarn build:prod && \
2568
- npm publish'"
2569
- ].each do |cmd|
2570
- execute_command cmd
2571
- end
2560
+ update_pyxis = !@projects['pyxis-npm'].empty? && @projects['pyxis-npm'][:name] != 'master' && pyxis_updated
2572
2561
 
2573
- cleanup_containers
2574
- Dir.chdir '../../'
2562
+ @deploy_pyxis = update_pyxis
2563
+ return update_pyxis
2575
2564
  end
2576
2565
  end
2577
2566
 
2567
+ def deploy_crash?
2568
+ crash_present = !@projects['crash'].empty? && @projects['crash'][:name] != 'master' && !@projects['crash'][:default_branch]
2569
+ leftorium_present = !@projects['leftorium'].empty? && @projects['leftorium'][:name] != 'master' && !@projects['leftorium'][:default_branch]
2570
+ crash_present || leftorium_present
2571
+ end
2572
+
2578
2573
  def get_pyxis_version(deploy_id)
2579
2574
  (deploy_id.delete '[a-z0]')[0..9]
2580
2575
  end
@@ -2845,20 +2840,11 @@ class Release
2845
2840
 
2846
2841
  def decrypt_secrets()
2847
2842
  docker_image = "prima/biscuit_populate_configs"
2848
- if @qainit
2849
- [
2850
- "docker pull #{docker_image}",
2851
- "docker run -t --rm -v $HOME/.aws:/root/.aws -w $PWD --volumes-from #{get_host_container_name} #{docker_image}"
2852
- ].each do |cmd|
2853
- execute_command cmd
2854
- end
2855
- else
2856
- [
2857
- "docker pull #{docker_image}",
2858
- "docker run -t --rm -v $HOME/.aws:/root/.aws -v $PWD:$PWD -w $PWD #{docker_image}"
2859
- ].each do |cmd|
2860
- execute_command cmd
2861
- end
2843
+ [
2844
+ "docker pull #{docker_image}",
2845
+ "docker run -t --rm -v $HOME/.aws:/root/.aws -w $PWD --volumes-from #{get_host_container_name} #{docker_image}"
2846
+ ].each do |cmd|
2847
+ execute_command cmd
2862
2848
  end
2863
2849
  end
2864
2850
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prima-twig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.51.2
4
+ version: 0.51.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Giachino
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2019-09-06 00:00:00.000000000 Z
17
+ date: 2019-09-13 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aws-sdk