# Starter pipeline # Start with a minimal pipeline that you can customize to build and deploy your code. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml trigger: - main pool: vmImage: ubuntu-latest steps: - task: SqlDacpacDeploymentOnMachineGroup@0 displayName: _D03091 - INDEX - Load items CDS and prescribers from PharmIndex to Arizona - Central inputs: TaskType: 'sqlInline' InlineSql: | use pharmindexTP GO /* step 1 - Check download from Pharmindex is finished */ declare @today datetime; select @today = convert(datetime, convert(varchar(20), getdate(),102)) if not exists ( select top 1 * from BatchImportHistory bih where bih.Success = 1 and bih.EndImportDate > @today) begin /* Download not OK */ raiserror('Pharmindex download in process, job not executed', 16,1) end; GO begin try declare @out_param_int_1 int execute[dbo].[pdx_loading] @in_job_type = 20 ,@skip_mapping = 0 ,@in_subsidiary = 100 ,@in_table_name = null ,@in_debug = 0 ,@out_param_int_1 = @out_param_int_1 output end try begin catch declare @mail_message nvarchar(2000), @mail_subject nvarchar(255); set @mail_message = '

Résumé des erreurs dans le tableau ci-dessous :

' +' ' + ''+ '
ErrorNumber ErrorSeverity ErrorState ErrorProcedure ErrorLine ErrorMessage
' + isnull(convert(varchar, ERROR_NUMBER()), '') + ' ' + isnull(convert(varchar, ERROR_SEVERITY()), '') + ' ' + isnull(convert(varchar, ERROR_STATE()), '') + ' ' + isnull(ERROR_PROCEDURE(), '') + ' ' + isnull(convert(varchar, ERROR_LINE()), '') + ' ' + isnull(ERROR_MESSAGE(), '') + '
'; set @mail_subject = 'INDEX - Transfert PharmIndex to PHGD_xx for items using checksum (Instance ' + @@SERVERNAME + ') - Job _D01941 - INDEX'; /* envoi du mail */ exec Arizona.dbo.aps_Send_Mail_with_template @in_param_varchar_2 = 'HCI_PharmIndex;HCI_DataManagement', @in_param_varchar_3 = @mail_message, @in_param_subject = @mail_subject, @in_job_type = 4; end catch ServerName: 'localhost' DatabaseName: 'master' AuthScheme: 'windowsAuthentication' - script: echo Hello, world! displayName: 'Run a one-line script' - script: | echo Add other tasks to build, test, and deploy your project. echo See https://aka.ms/yaml displayName: 'Run a multi-line script'